예제 #1
0
 private void StartWarmUpShader()
 {
     Debug.Log("==>StartWarmUpShader");
     ShaderManager.BeginInit(new Action(this.OnShaderManagerInited));
 }
예제 #2
0
    private void LoadTestGUI()
    {
        int num = -1;

        num++;
        this.resName = GUI.TextField(new Rect(100f, 20f, 300f, 30f), this.resName);
        num         += 5;
        if (GUI.Button(this.GetRect(num), "unload asset"))
        {
            AssetBundleLoader.Instance.Initialize(null);
            Debug.LogError("begin " + Time.get_time());
            AssetBundleLoader.Instance.UnloadAB(this.resName, delegate(bool isOK)
            {
                Debug.LogError("done " + Time.get_time());
            }, null);
        }
        num++;
        if (GUI.Button(this.GetRect(num), "load asset"))
        {
            AssetBundleLoader.Instance.Initialize(null);
            Debug.LogError("begin " + Time.get_time());
            AssetBundleLoader.Instance.AsyncLoadAB(this.resName, delegate(bool isOK)
            {
                Debug.LogError("done " + Time.get_time());
            }, null);
        }
        num++;
        if (GUI.Button(this.GetRect(num), "print all"))
        {
            List <string> list = new List <string>();
            using (Dictionary <string, Object> .Enumerator enumerator = AssetBundleLoader.Instance.m_alreadyLoaded.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <string, Object> current = enumerator.get_Current();
                    list.Add(current.get_Key());
                }
            }
            Debug.LogError("==>[print all]");
            list.Sort();
            using (List <string> .Enumerator enumerator2 = list.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    string current2 = enumerator2.get_Current();
                    Debug.LogError(current2);
                }
            }
        }
        num++;
        if (GUI.Button(this.GetRect(num), "ref stack"))
        {
            Debug.LogError("==>[ref stack]");
            AssetBundleLoader.Instance.OutputStackTrace(this.resName);
        }
        num++;
        if (GUI.Button(this.GetRect(num), "load jni"))
        {
            Debug.LogError("==>[load jni]");
            Debug.LogError(NativeCallManager.ContainsInAssets(string.Empty, "abmap.txt"));
            Debug.LogError(Encoding.get_UTF8().GetString(NativeCallManager.getFromAssets("abmap.txt")));
        }
        num++;
        if (GUI.Button(this.GetRect(num), "test shader"))
        {
            Debug.LogError("==>[test shader]");
            ShaderManager.BeginInit(delegate
            {
                for (int i = 0; i < ShaderManager.Instance.listShader.Length; i++)
                {
                    Debug.LogError(string.Concat(new object[]
                    {
                        "index = ",
                        i,
                        ", shader = ",
                        ShaderManager.Instance.listShader[i].get_name()
                    }));
                }
                for (int j = 0; j < ShaderManager.Instance.listShader.Length; j++)
                {
                    if (!ShaderManager.Instance.listShader[j].get_isSupported())
                    {
                        Debug.LogError("index = " + j + ", shader no supported");
                    }
                }
            });
        }
        num++;
        if (GUI.Button(this.GetRect(num), "test shader now"))
        {
            Debug.LogError("==>[test shader now]");
            Object @object = AssetManager.AssetOfNoPool.LoadAssetNowNoAB(FileSystem.GetPath("Shader", string.Empty), typeof(Object));
            if (@object != null)
            {
                Debug.LogError("shader asset not null");
            }
            else
            {
                Debug.LogError("shader asset is null");
            }
        }
    }