66 lines
1.4 KiB
C#
66 lines
1.4 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class AnimEventData : MonoBehaviour
|
||
|
|
{
|
||
|
|
public GameObject go_info;
|
||
|
|
public TextMeshProUGUI label;
|
||
|
|
|
||
|
|
string m_funcName;
|
||
|
|
int m_a;
|
||
|
|
float m_b;
|
||
|
|
string m_c;
|
||
|
|
|
||
|
|
int m_frame, index = 0;
|
||
|
|
|
||
|
|
public void Set_Data(int frame, string funcName)
|
||
|
|
{
|
||
|
|
go_info.SetActive(false);
|
||
|
|
index = 0;
|
||
|
|
m_frame = frame;
|
||
|
|
m_funcName = funcName;
|
||
|
|
}
|
||
|
|
public void Set_Data(int frame, string funcName, int a)
|
||
|
|
{
|
||
|
|
go_info.SetActive(false);
|
||
|
|
index = 1;
|
||
|
|
m_frame = frame;
|
||
|
|
m_funcName = funcName;
|
||
|
|
m_a = a;
|
||
|
|
}
|
||
|
|
public void Set_Data(int frame, string funcName, float b)
|
||
|
|
{
|
||
|
|
go_info.SetActive(false);
|
||
|
|
index = 2;
|
||
|
|
m_frame = frame;
|
||
|
|
m_funcName = funcName;
|
||
|
|
m_b = b;
|
||
|
|
}
|
||
|
|
public void Set_Data(int frame, string funcName, string c)
|
||
|
|
{
|
||
|
|
go_info.SetActive(false);
|
||
|
|
index = 3;
|
||
|
|
m_frame = frame;
|
||
|
|
m_funcName = funcName;
|
||
|
|
m_c = c;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void OnClick_ShowInfo()
|
||
|
|
{
|
||
|
|
go_info.SetActive(!go_info.activeInHierarchy);
|
||
|
|
label.text = DSUtil.Format("Frame {0}\n{1}\n{2}", m_frame, m_funcName, Get_Param());
|
||
|
|
}
|
||
|
|
object Get_Param()
|
||
|
|
{
|
||
|
|
switch (index)
|
||
|
|
{
|
||
|
|
case 1: return m_a;
|
||
|
|
case 2: return m_b;
|
||
|
|
case 3: return m_c;
|
||
|
|
}
|
||
|
|
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}
|