Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the current game object.
|
||||
/// </summary>
|
||||
[SpecialUnit]
|
||||
[RenamedFrom("Bolt.Self")]
|
||||
[RenamedFrom("Unity.VisualScripting.Self")]
|
||||
public sealed class This : Unit
|
||||
{
|
||||
/// <summary>
|
||||
/// The current game object.
|
||||
/// </summary>
|
||||
[DoNotSerialize]
|
||||
[PortLabelHidden]
|
||||
[PortLabel("This")]
|
||||
public ValueOutput self { get; private set; }
|
||||
|
||||
protected override void Definition()
|
||||
{
|
||||
self = ValueOutput(nameof(self), Result).PredictableIf(IsPredictable);
|
||||
}
|
||||
|
||||
private GameObject Result(Flow flow)
|
||||
{
|
||||
return flow.stack.self;
|
||||
}
|
||||
|
||||
private bool IsPredictable(Flow flow)
|
||||
{
|
||||
return flow.stack.self != null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue