Invoke Node: Difference between revisions
Tayfunwiki (talk | contribs) No edit summary Tags: Reverted Visual edit |
Tayfunwiki (talk | contribs) No edit summary Tags: Reverted Visual edit |
||
Line 1: | Line 1: | ||
<b>Description</b><div class="description" style="padding-left:35px;">This node executes all methods of the IResult type that are marked with the <nowiki>< | <b>Description</b><div class="description" style="padding-left:35px;">This node executes all methods of the IResult type that are marked with the <nowiki><span style="color=#fcba03">[</nowiki>'''SchemeAttribute'''].<nowiki></span></nowiki> </div> | ||
[[File:Invoke-1.gif|thumb|Invoke Node.gif]] | [[File:Invoke-1.gif|thumb|Invoke Node.gif]] | ||
[[File:Invoke-2.gif|thumb|Invoke Node.gif]] | [[File:Invoke-2.gif|thumb|Invoke Node.gif]] |
Revision as of 02:06, 15 December 2023
Description
This node executes all methods of the IResult type that are marked with the <span style="color=#fcba03">[SchemeAttribute].</span>
using UnityEngine;
namespace Nullframes.Intrigues.Demo
{
public class Demo_Methods : MonoBehaviour
{
[Scheme("Conspirator Level Up")]
private IResult LevelUp(Scheme scheme) {
LevelComponent levelComponent = scheme.Conspirator.GetComponent<LevelComponent>();
if (levelComponent != null) {
levelComponent.LevelUp();
return IResult.True; // Level is Up.
}
return IResult.Null; // LevelComponent not found.
}
[Scheme("Conspirator Level > 5")]
private IResult LevelGreaterThanFive() {
LevelComponent levelComponent = scheme.Conspirator.GetComponent<LevelComponent>();
if (levelComponent != null) {
if (levelComponent.Level > 5) {
return IResult.True; // Level greater than 5
}
return IResult.False; // Level lesser or equal than 5
}
return IResult.Null; // LevelComponent not found.
}
}
}
ยป The Invoke node runs the method and continues the flow based on the returned value.