Ejemplo n.º 1
0
 private void OnCollisionStay2D(Collision2D collision)
 {
     if (m_OnCollisionStay2D != null)
     {
         ILRuntimeService.InvokeMethod(m_OnCollisionStay2D, Instance, new object[] { collision });
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (m_OnTriggerEnter2D != null)
     {
         ILRuntimeService.InvokeMethod(m_OnTriggerEnter2D, Instance, new object[] { collision });
     }
 }
Ejemplo n.º 3
0
 private void Update()
 {
     if (m_UpdateMethod != null)
     {
         ILRuntimeService.InvokeMethod(m_UpdateMethod, Instance, EmptyParameters);
     }
 }
Ejemplo n.º 4
0
 private void OnDestroy()
 {
     if (m_OnDestroyMethod != null)
     {
         ILRuntimeService.InvokeMethod(m_OnDestroyMethod, Instance, EmptyParameters);
     }
 }
Ejemplo n.º 5
0
 private void Start()
 {
     if (m_StartMethod != null)
     {
         ILRuntimeService.InvokeMethod(m_StartMethod, Instance, EmptyParameters);
     }
 }
Ejemplo n.º 6
0
        /* 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
        }
Ejemplo n.º 7
0
        /* 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}");
            }
        }