iFactory.Godot/Artists/Scripts/Factory/RotationComponent.cs

37 lines
974 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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; }
/// <summary>
/// 可读可写的当前角度
/// </summary>
public float CurrentAngle;
[ExportCategory("Nodes")]
[Export] public Node3D node3D;
public override void _Ready()
{
//保存默认角度
OriginalEuler = node3D.RotationDegrees;
}
}