浏览代码

Added random branch logic

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

20
Runtime/LevelScripting/Logic/RandomLogic.cs


using NaughtyAttributes;
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
namespace GameplayIngredients.Logic
{
public class RandomLogic : LogicBase
{
[ReorderableList]
public Callable[] RandomCalls;
public override void Execute(GameObject instigator = null)
{
int r = Random.Range(0, RandomCalls.Length);
Callable.Call(RandomCalls[r], instigator);
}
}
}

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


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