AK056/Assets/GameLogic/Game/Core/Component/AnimationEventComponent.cs

42 lines
1.2 KiB
C#

using System;
using UnityEngine;
namespace GameLogic
{
public class AnimationEventComponent : MonoBehaviour
{
public void PlayStretchComplete(int data)
{
if (Enum.IsDefined(typeof(ToolActionType), data))
{
ToolActionType action = (ToolActionType)data;
Debug.Log($"Received ToolActionType: {action}");
switch (action)
{
case ToolActionType.PickUp:
GameEvent.Send(EventSetting.PlayStretchPickUpComplete);
break;
case ToolActionType.PutDown:
GameEvent.Send(EventSetting.PlayStretchPutDownComplete);
break;
default:
Debug.LogWarning($"Unhandled ToolActionType: {action}");
break;
}
}
else
{
Debug.LogWarning($"Invalid ToolActionType value: {data}");
}
}
public void PlayShrinkComplete()
{
GameEvent.Send(EventSetting.PlayShrinkComplete);
}
}
}