public static void Reset() { BundleMesh.Reset(); BundleMaterial.Reset(); BundleTexture.Reset(); BundleShader.Reset(); BundleLightmap.Reset(); }
public static void PostProcess() { BundleTexture.PostProcess(); BundleShader.PostProcess(); BundleMaterial.PostProcess(); BundleLightmap.PostProcess(); BundleMesh.PostProcess(); }
public static new SceneResources GetObjectData() { var sceneData = new SceneResources(); sceneData.textures = BundleTexture.GenerateObjectList(); sceneData.lightmaps = BundleLightmap.GenerateObjectList(); sceneData.shaders = BundleShader.GenerateObjectList(); sceneData.materials = BundleMaterial.GenerateObjectList(); sceneData.meshes = BundleMesh.GenerateObjectList(); return(sceneData); }
private BundleMaterial(Material material) { this.unityMaterial = material; this.index = allMaterials.Count; this.name = material.name; allMaterials[material] = this; shader = BundleShader.RegisterShader(material.shader); for (int i = 0; i < ShaderUtil.GetPropertyCount(material.shader); ++i) { // Find and record all textures used by current shader if (ShaderUtil.GetPropertyType(material.shader, i) == ShaderUtil.ShaderPropertyType.TexEnv) { string propName = ShaderUtil.GetPropertyName(material.shader, i); Texture subtexture = material.GetTexture(propName); if (subtexture == null) { Debug.LogWarning("Material " + material.name + " can't load texture for " + propName); continue; } textures.Add(BundleTexture.RegisterTexture(subtexture, propName)); textureUnits.Add(BundleTexture.GetSuggestedUnit(propName)); textureScales.Add(material.GetTextureScale(propName)); textureOffsets.Add(material.GetTextureOffset(propName)); } } // If no shader textures used, try to record the main texture if (textures.Count == 0 && material.mainTexture != null) { textures.Add(BundleTexture.RegisterTexture(material.mainTexture, "_MainTex")); textureUnits.Add(BundleTexture.GetSuggestedUnit("_MainTex")); textureScales.Add(unityMaterial.mainTextureScale); textureOffsets.Add(unityMaterial.mainTextureOffset); } }