using System.Collections.Generic; using System.Reflection; using UnityEngine; namespace UnityTemplateProjects { public class AnimProxy : MonoBehaviour { [SerializeField] private Component mono; private Dictionary cache = new Dictionary(); public void AnimProxyCallback(string method) { if (!cache.ContainsKey(method)) { cache[method] = mono.GetType().GetMethod(method); } cache[method].Invoke(mono, null); } } }