
1.引入URP 2.引入InputSystem 3.引入Fungus 4.引入DoTween 5.引入CinemaMachine 6.引入BehaviorTree 7.引入BehaviorTree动作包 8.配置了渲染管线资源 🥵🥵🥵🥵🥵
31 lines
1012 B
C#
31 lines
1012 B
C#
using UnityEngine;
|
|
|
|
namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityQuaternion
|
|
{
|
|
[TaskCategory("Unity/Quaternion")]
|
|
[TaskDescription("Stores the quaternion after a rotation.")]
|
|
public class RotateTowards : Action
|
|
{
|
|
[Tooltip("The from rotation")]
|
|
public SharedQuaternion fromQuaternion;
|
|
[Tooltip("The to rotation")]
|
|
public SharedQuaternion toQuaternion;
|
|
[Tooltip("The maximum degrees delta")]
|
|
public SharedFloat maxDeltaDegrees;
|
|
[Tooltip("The stored result")]
|
|
[RequiredField]
|
|
public SharedQuaternion storeResult;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
storeResult.Value = Quaternion.RotateTowards(fromQuaternion.Value, toQuaternion.Value, maxDeltaDegrees.Value);
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
public override void OnReset()
|
|
{
|
|
fromQuaternion = toQuaternion = storeResult = Quaternion.identity;
|
|
maxDeltaDegrees = 0;
|
|
}
|
|
}
|
|
} |