Invoke Node

From Intrigues Wiki
Revision as of 20:28, 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 System.Linq;
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>(); // This is example component.
            if (levelComponent != null) {
                levelComponent.LevelUp();
                return IResult.True;
            }
            return IResult.Null;
        }
        
        [Scheme("Conspirator Level > 5")]
        private IResult LevelGreaterThanFive() {
            LevelComponent levelComponent = scheme.Conspirator.GetComponent<LevelComponent>(); // This is example component.
            if (levelComponent != null) {
                levelComponent.LevelUp();
                return IResult.True;
            }
            return IResult.Null;
        }
    }
}