iFactory.Godot/Scripts/Factory/RotationComponent.cs

30 lines
790 B
C#
Raw Normal View History

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; }
public override void _Ready()
{
//保存默认角度
OriginalEuler = Rotation;
}
}