Invoke Node

From Intrigues Wiki
Revision as of 19:31, 14 December 2023 by Tayfunwiki (talk | contribs)

Description

[SchemeAttribute] ile işaretlenmiş IResult türünde ki bütün methodları çalıştırır.
Invoke Node.gif
Invoke Node.gif
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.
        }
    }
}

» Invoke node, methodu çalıştırır ve döndürdüğü değere göre akışa devam eder.