Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.
|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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);
- }
- }
- }
|