Skip to content

Instantly share code, notes, and snippets.

@suakig
Created May 8, 2015 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suakig/c39b3098706e8d886008 to your computer and use it in GitHub Desktop.
Save suakig/c39b3098706e8d886008 to your computer and use it in GitHub Desktop.
ArgumentChangeStringToMethod.cs
using UnityEngine;
using System;
using System.Collections;
public class ArgumentChangeStringToMethod : MonoBehaviour
{
/// <summary>
/// 関数,呼出までの遅延秒数
/// </summary>
/// <param name="action">Action.</param>
/// <param name="time">Time.</param>
public void Invoke(Action action, float time)
{
Invoke (action.Method.Name, time);
}
/// <summary>
/// 関数,初回呼出までの遅延秒数,次回呼出までの遅延秒数
/// </summary>
/// <param name="action">Action.</param>
/// <param name="time">Time.</param>
/// <param name="repeatRate">Repeat rate.</param>
public void InvokeRepeating (Action action, float time, float repeatRate)
{
InvokeRepeating (action.Method.Name, time, repeatRate);
}
public void SendMessage (Action action)
{
SendMessage (action.Method.Name);
}
public void SendMessage (Action action, object value)
{
SendMessage (action.Method.Name, value);
}
public void SendMessage (Action action, SendMessageOptions options)
{
SendMessage (action.Method.Name, options);
}
public void SendMessage (Action action, object value, SendMessageOptions options)
{
SendMessage (action.Method.Name, value, options);
}
public void BroadcastMessage (Action action)
{
BroadcastMessage (action.Method.Name);
}
public void BroadcastMessage (Action action, object value)
{
BroadcastMessage (action.Method.Name, value);
}
public void BroadcastMessage (Action action, SendMessageOptions options)
{
BroadcastMessage (action.Method.Name, options);
}
public void BroadcastMessage (Action action, object value, SendMessageOptions options)
{
BroadcastMessage (action.Method.Name, value, options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment