public static ForestRenderer newInstance(ForestGeneratorBehaviour behaviour) { ForestRenderer renderer = ScriptableObject.CreateInstance <ForestRenderer>(); renderer.setBehaviour(behaviour); return(renderer); }
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); }