|
|
@@ -1,4 +1,4 @@
|
|
|
-using UnityEngine;
|
|
|
+using UnityEngine;
|
|
|
|
|
|
namespace ET
|
|
|
{
|
|
|
@@ -6,9 +6,14 @@ namespace ET
|
|
|
{
|
|
|
protected override async ETTask Run(EventType.ChangeRotation args)
|
|
|
{
|
|
|
- Transform transform = args.Unit.GetComponent<GameObjectComponent>().GameObject.transform;
|
|
|
+ GameObjectComponent gameObjectComponent = args.Unit.GetComponent<GameObjectComponent>();
|
|
|
+ if (gameObjectComponent == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Transform transform = gameObjectComponent.GameObject.transform;
|
|
|
transform.rotation = args.Unit.Rotation;
|
|
|
await ETTask.CompletedTask;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|