private void OnCollisionStay2D(Collision2D collision) { if (m_OnCollisionStay2D != null) { ILRuntimeService.InvokeMethod(m_OnCollisionStay2D, Instance, new object[] { collision }); } }
private void OnTriggerEnter2D(Collider2D collision) { if (m_OnTriggerEnter2D != null) { ILRuntimeService.InvokeMethod(m_OnTriggerEnter2D, Instance, new object[] { collision }); } }
private void Update() { if (m_UpdateMethod != null) { ILRuntimeService.InvokeMethod(m_UpdateMethod, Instance, EmptyParameters); } }
private void OnDestroy() { if (m_OnDestroyMethod != null) { ILRuntimeService.InvokeMethod(m_OnDestroyMethod, Instance, EmptyParameters); } }
private void Start() { if (m_StartMethod != null) { ILRuntimeService.InvokeMethod(m_StartMethod, Instance, EmptyParameters); } }
/* ctor */ private void Reset() { DeleteLatestABUpdator = true; m_AssetBundlePool = GetComponent <AssetBundlePool>(); m_AssetBundlePool.enabled = false; m_ILRuntimeService = GetComponent <ILRuntimeService>(); m_ILRuntimeService.enabled = false; m_TweenService = GetComponent <TweenService>(); m_TweenService.enabled = false; #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(this); #endif }
/* func */ /// <summary> /// 调用当前 HotFix 实例公开行为 /// </summary> /// <param name="actionName">方法名称</param> public void InvokeAction(string actionName) { Dictionary <string, IMethod> typeMethods = UpdatableComponentsBuffer.ComponentMethodsCache[ILTypeFullName]; if (typeMethods.TryGetValue(actionName, out IMethod method)) { #if UNITY_EDITOR if (method.ParameterCount > 0) { Debug.LogError($"Try to Invoke actionName : {ILTypeFullName}.{actionName}, but it's not a Action."); } #endif ILRuntimeService.InvokeMethod(method, Instance, EmptyParameters); } else { Debug.LogError($"Not Found Method Exception, {ILTypeFullName}.{actionName}"); } }