예제 #1
0
    public static ForestRenderer newInstance(ForestGeneratorBehaviour behaviour)
    {
        ForestRenderer renderer = ScriptableObject.CreateInstance <ForestRenderer>();

        renderer.setBehaviour(behaviour);
        return(renderer);
    }
예제 #2
0
 void OnRenderObject()
 {
     if (mat == null)
     {
         UnityEngine.Debug.Log("Making shader");
         Shader shader = Shader.Find("Hidden/Internal-Colored");
         mat = new Material(shader);
     }
     ForestRenderer.DrawForest(mat, renderTransform.localToWorldMatrix, forest);
 }
 void Awake()
 {
     _generator = new CaveGenerator();
     _renderer  = ForestRenderer.newInstance(this);
 }