コード例 #1
0
 public void MoveNext()
 {
     using (var ctx = appDomain.BeginInvoke(mMoveNext))
     {
         ctx.PushObject(ILInstance);
         ctx.Invoke();
     }
 }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (m_updateMethod != null)
     {
         using (var ctx = m_appDomain.BeginInvoke(m_updateMethod))
         {
             ctx.PushObject(m_gameRoot);
             ctx.Invoke();
         }
     }
 }
コード例 #3
0
    private void OnHotFixLoaded(ILRuntime.Runtime.Enviorment.AppDomain appDomain)
    {
        Debug.Log("OnHotFixLoaded");
        m_appDomain = appDomain;
        IType hotFixGameRootType = m_appDomain.LoadedTypes["HotFix_Project.GameRoot"];

        m_gameRoot = ((ILType)hotFixGameRootType).Instantiate();
        UnityEngine.Object.Destroy(m_hotFixLoader);
        m_hotFixLoader = null;
        IMethod method = hotFixGameRootType.GetMethod("Start", 0);

        using (var ctx = appDomain.BeginInvoke(method))
        {
            ctx.PushObject(m_gameRoot);
            ctx.Invoke();
        }
        m_updateMethod = hotFixGameRootType.GetMethod("Update", 0);
    }
コード例 #4
0
            public override Single AbMethod2(Int32 arg1)
            {
                if (mAbMethod2 == null)
                {
                    mAbMethod2 = instance.Type.GetMethod("AbMethod2", 1);
                }

                if (mAbMethod2 != null)
                {
                    using (var ctx = appdomain.BeginInvoke(mAbMethod2))
                    {
                        ctx.PushObject(instance);
                        ctx.PushInteger(arg1);
                        ctx.Invoke();
                        return(ctx.ReadFloat());
                    }
                }

                return(0);
            }
コード例 #5
0
            public System.Int32 Compare(ILRuntime.Runtime.Intepreter.ILTypeInstance x, ILRuntime.Runtime.Intepreter.ILTypeInstance y)
            {
                if (method_Compare == null)
                {
                    method_Compare = instance.Type.GetMethod("Compare");
                }

                try
                {
                    using (var ctx = appdomain.BeginInvoke(method_Compare))
                    {
                        ctx.PushObject(instance);
                        ctx.PushObject(x, false);
                        ctx.PushObject(y, false);
                        ctx.Invoke();
                        return(ctx.ReadInteger());
                    }
                }
                finally
                {
                }
            }