コード例 #1
0
        public ResourceObjectMaterial(string shaderName)
        {
            Shader shader = ResourceObjectInterface.funcAddShader(shaderName);

            if (shader != null)
            {
                UnityEngine.Material material = new UnityEngine.Material(shader);
                unity3dObject = material;
            }
        }
コード例 #2
0
        override public void Dispose()
        {
            Material material = unity3dObject as Material;

            ResourceObjectInterface.actDelShader(material.shader);

            // 删除资源物体
            base.Dispose();

            lstTextureParams.Clear();
            lstTextureParams = null;
        }
コード例 #3
0
        override public void OnDependencesFinished()
        {
            Material material = unity3dObject as Material;

            for (int i = 0; i < lstTextureParams.Count; i++)
            {
                ResourceRef res = ResourceObjectInterface.funcGetResource(lstTextureParams [i].path);
                if (res != null)
                {
                    material.SetTexture(lstTextureParams [i].propertyName, res.resourceObject.Unity3dObject as Texture);
                }
            }
        }