
1.引入URP 2.引入InputSystem 3.引入Fungus 4.引入DoTween 5.引入CinemaMachine 6.引入BehaviorTree 7.引入BehaviorTree动作包 8.配置了渲染管线资源 🥵🥵🥵🥵🥵
29 lines
857 B
C#
29 lines
857 B
C#
using UnityEngine;
|
|
|
|
namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityQuaternion
|
|
{
|
|
[TaskCategory("Unity/Quaternion")]
|
|
[TaskDescription("Stores the quaternion of a forward vector.")]
|
|
public class LookRotation : Action
|
|
{
|
|
[Tooltip("The forward vector")]
|
|
public SharedVector3 forwardVector;
|
|
[Tooltip("The second Vector3")]
|
|
public SharedVector3 secondVector3;
|
|
[Tooltip("The stored quaternion")]
|
|
[RequiredField]
|
|
public SharedQuaternion storeResult;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
storeResult.Value = Quaternion.LookRotation(forwardVector.Value);
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
public override void OnReset()
|
|
{
|
|
forwardVector = Vector3.zero;
|
|
storeResult = Quaternion.identity;
|
|
}
|
|
}
|
|
} |