TH1/Unity/Assets/Scripts/HotfixView/Client/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs
2025-07-17 18:26:28 +08:00

22 lines
663 B
C#

using UnityEngine;
namespace ET.Client
{
[Event(SceneType.Current)]
public class ChangeRotation_SyncGameObjectRotation: AEvent<Scene, ChangeRotation>
{
protected override async ETTask Run(Scene scene, ChangeRotation args)
{
Unit unit = args.Unit;
GameObjectComponent gameObjectComponent = unit.GetComponent<GameObjectComponent>();
if (gameObjectComponent == null)
{
return;
}
Transform transform = gameObjectComponent.GameObject.transform;
transform.rotation = unit.Rotation;
await ETTask.CompletedTask;
}
}
}