public ResourceObjectMaterial(string shaderName) { Shader shader = ResourceObjectInterface.funcAddShader(shaderName); if (shader != null) { UnityEngine.Material material = new UnityEngine.Material(shader); unity3dObject = material; } }
override public void Dispose() { Material material = unity3dObject as Material; ResourceObjectInterface.actDelShader(material.shader); // 删除资源物体 base.Dispose(); lstTextureParams.Clear(); lstTextureParams = null; }
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); } } }