浏览代码

add flip flop logic

/main
Laurent 5 年前
当前提交
cb462865
共有 2 个文件被更改,包括 41 次插入0 次删除
  1. 30
      Runtime/LevelScripting/Logic/FlipFlopLogic.cs
  2. 11
      Runtime/LevelScripting/Logic/FlipFlopLogic.cs.meta

30
Runtime/LevelScripting/Logic/FlipFlopLogic.cs


using UnityEngine;
using NaughtyAttributes;
namespace GameplayIngredients.Logic
{
public class FlipFlopLogic : LogicBase
{
[ReorderableList]
public Callable[] OnConditionValid;
[ReorderableList]
public Callable[] OnConditionInvalid;
private bool condition = true;
public override void Execute(GameObject instigator = null)
{
if (condition)
{
Callable.Call(OnConditionValid, instigator);
condition = false;
}
else
{
Callable.Call(OnConditionInvalid, instigator);
condition = true;
}
}
}
}

11
Runtime/LevelScripting/Logic/FlipFlopLogic.cs.meta


fileFormatVersion: 2
guid: 6331218ad8cbbe64cb1230f96dac5ffe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存