Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class SampleAnimHandler : MonoBehaviour
{
public enum AnimType
{
TYPE_1,
TYPE_2,
TYPE_3
}
/// <summary>
/// 引数の無い関数
/// 実行可能
/// </summary>
public void CallNoArg ()
{
Debug.Log ("no arg");
}
/// <summary>
/// float型の引数
/// 実行可能
/// </summary>
/// <param name="value">Value.</param>
public void SetFloat (float value)
{
Debug.Log (value);
}
/// <summary>
/// int型の引数
/// 実行可能
/// </summary>
/// <param name="value">Value.</param>
public void SetInt (int value)
{
Debug.Log (value);
}
/// <summary>
/// bool型の引数
/// 実行可能
/// </summary>
/// <param name="value">If set to <c>true</c> value.</param>
public void SetBool (bool value)
{
Debug.Log (value);
}
/// <summary>
/// string型の引数
/// 実行可能
/// </summary>
/// <param name="value">Value.</param>
public void SetString (string value)
{
Debug.Log (value);
}
/// <summary>
/// enum型の引数
/// 実行可能
/// </summary>
/// <param name="type">Type.</param>
public void SetType (AnimType type)
{
Debug.Log (type);
}
/// <summary>
/// 複数引数
/// 実行不可
/// </summary>
/// <param name="value1">Value1.</param>
/// <param name="value2">Value2.</param>
public void SetMultiArgs (int value1, float value2)
{
Debug.Log (value1 + " / " + value2);
}
/// <summary>
/// クラス型の引数
/// 実行不可
/// </summary>
/// <param name="data">Data.</param>
public void SetAnimData (AnimData data)
{
Debug.Log (data);
}
/// <summary>
/// List型
/// 実行不可
/// </summary>
/// <param name="list">List.</param>
public void SetList (List<int> list)
{
Debug.Log (list);
}
}
[System.Serializable]
public class AnimData
{
public int index;
public float value;
public bool flg;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment