浏览代码

Factory : Set Target + Action

/main
Thomas ICHÉ 6 年前
当前提交
8344ab9b
共有 3 个文件被更改,包括 43 次插入0 次删除
  1. 8
      Runtime/Ingredients/Factory/Factory.cs
  2. 24
      Runtime/Ingredients/Factory/FactorySetTargetAction.cs
  3. 11
      Runtime/Ingredients/Factory/FactorySetTargetAction.cs.meta

8
Runtime/Ingredients/Factory/Factory.cs


}
}
public void SetTarget(GameObject target)
{
if(target != null)
{
SpawnTarget = target;
}
}
public void Spawn()
{
if(SpawnTarget == null || FactoryBlueprints == null || FactoryBlueprints.Length == 0)

24
Runtime/Ingredients/Factory/FactorySetTargetAction.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;
namespace GameplayIngredients.Actions
{
public class FactorySetTargetAction : ActionBase
{
[NonNullCheck]
public Factory factory;
[NonNullCheck]
public GameObject Target;
public override void Execute(GameObject instigator = null)
{
if (factory != null && Target != null)
{
factory.SetTarget(Target);
}
}
}
}

11
Runtime/Ingredients/Factory/FactorySetTargetAction.cs.meta


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