static StackObject *GetStaticPrivateField_6(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @name = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Type @t = (System.Type) typeof(System.Type).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = ClassPrivateTool.GetStaticPrivateField(@t, @name);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance, true));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method, true));
        }
Ejemplo n.º 2
0
        public static void CacheShader(object _this)
        {
            UnityEngine.Debug.LogError("ShaderManager CacheShader bug fix");

            ClassPrivateTool.SetStaticPrivateField(typeof(ShaderManager), "m_bLoadedShaderList", true);

            var main = ResourceManager.LoadPrefab(typeof(GameObject), "shader/shaderslist.jpg", "shaderslist");

            if (main != null)
            {
                GameObject clone = (GameObject)GameObject.Instantiate(main.m_UObjectList[0]);
                GameObject.DontDestroyOnLoad(clone);
                ShadersList _shaderslist = clone.GetComponent(typeof(ShadersList)) as ShadersList;

                Dictionary <string, Shader> m_ShaderList = (Dictionary <string, Shader>)ClassPrivateTool.GetStaticPrivateField(typeof(ShaderManager), "m_ShaderList");
                foreach (Shader _shader in _shaderslist.list)
                {
                    if (!m_ShaderList.ContainsKey(_shader.name))
                    {
                        UnityEngine.Debug.Log("Bugs_GameDll_ShaderManager, CacheShader, Add shader:" + _shader.name);
                        m_ShaderList.Add(_shader.name, _shader);
                    }
                }
                //GameObject.Destroy(main);
                UnityEngine.Debug.Log("加载shaderslist成功,加载" + m_ShaderList.Count.ToString() + "个shader");
            }
            else
            {
                UnityEngine.Debug.LogError("加载shaderslist失败");
            }
        }