A game about forced loneliness, made by TACStudios
1using UnityEngine;
2
3namespace Unity.VisualScripting
4{
5 /// <summary>
6 /// Returns the current game object.
7 /// </summary>
8 [SpecialUnit]
9 [RenamedFrom("Bolt.Self")]
10 [RenamedFrom("Unity.VisualScripting.Self")]
11 public sealed class This : Unit
12 {
13 /// <summary>
14 /// The current game object.
15 /// </summary>
16 [DoNotSerialize]
17 [PortLabelHidden]
18 [PortLabel("This")]
19 public ValueOutput self { get; private set; }
20
21 protected override void Definition()
22 {
23 self = ValueOutput(nameof(self), Result).PredictableIf(IsPredictable);
24 }
25
26 private GameObject Result(Flow flow)
27 {
28 return flow.stack.self;
29 }
30
31 private bool IsPredictable(Flow flow)
32 {
33 return flow.stack.self != null;
34 }
35 }
36}