Ejemplo n.º 1
0
        private void ReplaceMaterial(MeshRenderer renderer, string materialName)
        {
            //Log.Normal("Material replaceder called");
            Material foundMaterial = KKGraphics.GetMaterial(materialName);

            if (foundMaterial != null)
            {
                Log.Normal("Material replaced: " + foundMaterial.name);
                renderer.material = Instantiate(foundMaterial);
            }
        }
Ejemplo n.º 2
0
        private void ReplaceShader(MeshRenderer renderer, string newShaderName)
        {
            if (!KKGraphics.HasShader(newShaderName))
            {
                Log.UserError("No Shader like this found: " + newShaderName);
                return;
            }

            Shader newShader = KKGraphics.GetShader(newShaderName);

            renderer.material.shader = newShader;
            //Log.Normal("Applied Shader: " + newShader.name);
        }
Ejemplo n.º 3
0
 private void SetTexture(MeshRenderer renderer, string texturename, string targetname, bool isNormal = false)
 {
     if (!String.IsNullOrEmpty(texturename))
     {
         Texture2D newTexture = KKGraphics.GetTexture(texturename, isNormal, textureIndex);
         if (newTexture != null)
         {
             //Log.Normal("setting Texture: " + texturename +  " on: " + targetname ) ;
             renderer.material.SetTexture(targetname, newTexture);
         }
         else
         {
             Log.UserWarning("cannot set Texture: " + texturename + " as " + targetname + " on: " + part.name);
         }
     }
 }