Invoke Node: Difference between revisions

From Intrigues Wiki
No edit summary
No edit summary
Line 1: Line 1:
[[File:Invoke-1.gif|thumb|Invoke Node]]
[[File:Invoke-1.gif|thumb|Invoke Node]]
[[File:Invoke-2.gif|thumb|Invoke Node]]
[[File:Invoke-2.gif|thumb|Invoke Node]]
<b>Description</b><div class="description" style="padding-left:35px;">Girilen isme özel true ya da false değerinde tetikleme yapar.</div>
<b>Description</b><div class="description" style="padding-left:35px;">['''SchemeAttribute'''] ile işaretlenmiş IResult türünde ki bütün methodları çalıştırır. </div><syntaxhighlight lang="c#" line="1" start="1">
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;
        }
    }
}
</syntaxhighlight>

Revision as of 19:27, 14 December 2023

Invoke Node
Invoke Node

Description

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