I want to make a class which will edit a material on runtime.
I started by making a class called EditMaterial. In that class I created a subclass called Textures. I posted the whole script here:
using UnityEngine;
using System.Collections;
public class EditMaterial : MonoBehaviour {
public Color color;
public Shader shader;
[SerializeField]
public class Textures{
[SerializeField] public Texture mainTexture;
[SerializeField] public Texture bumpMap;
[SerializeField] public Texture cube;
}
// Use this for initialization
void Awake () {
renderer.material.color = color;
renderer.material.shader = shader;
}
}
Here you can see my screenshot of unity.
[28703-unity+screenshot.jpg|28703]
The color and the shader are just fine. But the class Textures won’t appear!