
1.引入URP 2.引入InputSystem 3.引入Fungus 4.引入DoTween 5.引入CinemaMachine 6.引入BehaviorTree 7.引入BehaviorTree动作包 8.配置了渲染管线资源 🥵🥵🥵🥵🥵
32 lines
915 B
C#
32 lines
915 B
C#
using UnityEngine;
|
|
|
|
namespace BehaviorDesigner.Runtime.Tasks.Unity.SharedVariables
|
|
{
|
|
[TaskCategory("Unity/SharedVariable")]
|
|
[TaskDescription("Gets the GameObject from the Transform component. Returns Success.")]
|
|
public class SharedTransformToGameObject : Action
|
|
{
|
|
[Tooltip("The Transform component")]
|
|
public SharedTransform sharedTransform;
|
|
[RequiredField]
|
|
[Tooltip("The GameObject to set")]
|
|
public SharedGameObject sharedGameObject;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
if (sharedTransform.Value == null) {
|
|
return TaskStatus.Failure;
|
|
}
|
|
|
|
sharedGameObject.Value = sharedTransform.Value.gameObject;
|
|
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
public override void OnReset()
|
|
{
|
|
sharedTransform = null;
|
|
sharedGameObject = null;
|
|
}
|
|
}
|
|
} |