浏览代码

Added a way to change instigator in logic

/2018.3
Thomas ICHÉ 6 年前
当前提交
e5c0dcfb
共有 3 个文件被更改,包括 47 次插入0 次删除
  1. 8
      Runtime/Ingredients/Factory/Factory.cs
  2. 28
      Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs
  3. 11
      Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs.meta

8
Runtime/Ingredients/Factory/Factory.cs


}
}
public GameObject GetInstance(int index)
{
if (m_Instances.Count > index)
return m_Instances[index];
else
return null;
}
public void Spawn()
{
if(SpawnTarget == null || FactoryBlueprints == null || FactoryBlueprints.Length == 0)

28
Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs


using NaughtyAttributes;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GameplayIngredients.Logic
{
public class SetInstigatorFromFactoryLogic : LogicBase
{
[ReorderableList]
public Callable[] Next;
[NonNullCheck]
public Factory Factory;
public int FactoryIndex = 0;
public override void Execute(GameObject instigator = null)
{
if(Factory != null)
{
GameObject instance = Factory.GetInstance(FactoryIndex);
if (instance != null)
Call(Next, instance);
}
}
}
}

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


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