You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
- using System;
- using System.Collections.Generic;
- using UnityEngine;
-
- namespace coa4u
- {
- public class MethodHolder
- {
- protected Action method;
- protected string methodName;
-
- public MethodHolder()
- {
- }
-
- public MethodHolder(Action tgtMethod)
- {
- method = tgtMethod;
- methodName = tgtMethod.Method.Name;
- }
-
- public virtual void run(object param = null)
- {
- if (method != null)
- method.Invoke();
- }
-
- public string name
- {
- get
- {
- return methodName;
- }
- }
- }
-
- public class MethodHolder<T> : MethodHolder
- {
- protected Action<T> methodParam;
-
- public MethodHolder(Action<T> tgtMethod)
- {
- methodParam = tgtMethod;
- methodName = tgtMethod.Method.Name;
- }
-
- public override void run(object param)
- {
- if (methodParam != null)
- methodParam.Invoke((T)param);
- }
- }
- }
|