30 lines
790 B
C#
30 lines
790 B
C#
|
using Godot;
|
|||
|
|
|||
|
namespace BITKit;
|
|||
|
/// <summary>
|
|||
|
/// ECS中iFactory.Rotation的角度组件
|
|||
|
/// </summary>
|
|||
|
public partial class RotationComponent : EntityComponent
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 获取角度的路径
|
|||
|
/// </summary>
|
|||
|
[Export] public string Path { get; private set; }
|
|||
|
/// <summary>
|
|||
|
/// 角度的绝对权重,例如90*0,0,1 = 0,0,90
|
|||
|
/// </summary>
|
|||
|
[Export] public Vector3 Weight { get; private set; }
|
|||
|
/// <summary>
|
|||
|
/// 角度的相对偏移
|
|||
|
/// </summary>
|
|||
|
[Export] public Vector3 Offset { get; private set; }
|
|||
|
/// <summary>
|
|||
|
/// 默认角度的缓存
|
|||
|
/// </summary>
|
|||
|
public Vector3 OriginalEuler { get; private set; }
|
|||
|
public override void _Ready()
|
|||
|
{
|
|||
|
//保存默认角度
|
|||
|
OriginalEuler = Rotation;
|
|||
|
}
|
|||
|
}
|