Example #1
0
        public override Material _borrowObj(string name)
        {
            ArrayList propNames = null;
            ArrayList texNames  = null;
            ArrayList texPaths  = null;

            if (getMaterialTexCfg(name, ref propNames, ref texNames, ref texPaths))
            {
                if (texNames != null)
                {
                    for (int i = 0; i < texNames.Count; i++)
                    {
                        CLTexturePool.borrowObj(texNames[i].ToString());
                    }
                }
            }
            return(base._borrowObj(name, true));
        }
Example #2
0
        public static void returnObj(string name)
        {
            //return texture
            ArrayList propNames = null;
            ArrayList texNames  = null;
            ArrayList texPaths  = null;

            if (getMaterialTexCfg(name, ref propNames, ref texNames, ref texPaths))
            {
                if (texNames != null)
                {
                    for (int i = 0; i < texNames.Count; i++)
                    {
                        CLTexturePool.returnObj(texNames[i].ToString());
                    }
                }
            }
            // Then return material
            pool._returnObj(name, null);
        }
Example #3
0
        public static void doresetTexRef(NewList inputs)
        {
            ArrayList texNames = inputs[4] as ArrayList;
            ArrayList texPaths = inputs[5] as ArrayList;
            int       i        = (int)(inputs[6]);

#if UNITY_EDITOR
            if (!CLCfgBase.self.isEditMode || Application.isPlaying)
            {
                CLTexturePool.setPrefab(texNames[i].ToString(), (Callback)onGetTexture, inputs, null);
            }
            else
            {
                string  tmpPath = "Assets/" + texPaths[i];
                Texture tex     = AssetDatabase.LoadAssetAtPath(
                    tmpPath, typeof(UnityEngine.Object)) as Texture;
                onGetTexture(tex, inputs);
            }
#else
            CLTexturePool.setPrefab(texNames [i].ToString(), (Callback)onGetTexture, inputs, null);
#endif
        }