Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.
|
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);
- }
- }
- }
|