浏览代码

Added NTimesLogic

/2018.3
Thomas ICHÉ 6 年前
当前提交
11458e14
共有 2 个文件被更改,包括 48 次插入0 次删除
  1. 37
      Runtime/LevelScripting/Logic/NTimesLogic.cs
  2. 11
      Runtime/LevelScripting/Logic/NTimesLogic.cs.meta

37
Runtime/LevelScripting/Logic/NTimesLogic.cs


using NaughtyAttributes;
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
namespace GameplayIngredients.Logic
{
public class NTimesLogic : LogicBase
{
[ReorderableList]
public Callable[] Calls;
[Min(1), SerializeField]
protected int Count = 1;
int m_RemainingCount;
void Awake()
{
Reset();
}
public void Reset()
{
m_RemainingCount = Count;
}
public override void Execute(GameObject instigator = null)
{
if(m_RemainingCount > 0)
{
m_RemainingCount--;
Callable.Call(Calls, instigator);
}
}
}
}

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


fileFormatVersion: 2
guid: e5238971271a4cd43b4a07ba72a48e09
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存