64 lines
2.0 KiB
C#
64 lines
2.0 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(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.PlayShrinkPickUpComplete);
|
|
break;
|
|
case ToolActionType.PutDown:
|
|
GameEvent.Send(EventSetting.PlayShrinkPutDownComplete);
|
|
break;
|
|
default:
|
|
Debug.LogWarning($"Unhandled ToolActionType: {action}");
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Debug.LogWarning($"Invalid ToolActionType value: {data}");
|
|
}
|
|
Debug.Log("Ëõ¶¯»Íê³É");
|
|
|
|
}
|
|
|
|
}
|
|
}
|