
1.引入URP 2.引入InputSystem 3.引入Fungus 4.引入DoTween 5.引入CinemaMachine 6.引入BehaviorTree 7.引入BehaviorTree动作包 8.配置了渲染管线资源 🥵🥵🥵🥵🥵
30 lines
868 B
C#
30 lines
868 B
C#
using UnityEngine;
|
|
|
|
namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityVector2
|
|
{
|
|
[TaskCategory("Unity/Vector2")]
|
|
[TaskDescription("Returns the distance between two Vector2s.")]
|
|
public class Distance : Action
|
|
{
|
|
[Tooltip("The first Vector2")]
|
|
public SharedVector2 firstVector2;
|
|
[Tooltip("The second Vector2")]
|
|
public SharedVector2 secondVector2;
|
|
[Tooltip("The distance")]
|
|
[RequiredField]
|
|
public SharedFloat storeResult;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
storeResult.Value = Vector2.Distance(firstVector2.Value, secondVector2.Value);
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
public override void OnReset()
|
|
{
|
|
firstVector2 = Vector2.zero;
|
|
secondVector2 = Vector2.zero;
|
|
storeResult = 0;
|
|
}
|
|
}
|
|
} |