2023-06-12 15:51:41 +08:00
|
|
|
|
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; }
|
2023-06-29 01:01:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 可读可写的当前角度
|
|
|
|
|
/// </summary>
|
|
|
|
|
public float CurrentAngle;
|
2023-06-12 15:51:41 +08:00
|
|
|
|
public override void _Ready()
|
|
|
|
|
{
|
|
|
|
|
//保存默认角度
|
|
|
|
|
OriginalEuler = Rotation;
|
|
|
|
|
}
|
|
|
|
|
}
|