public void LeaveCopy() { advanceNode = new FibPlantNode(this, go.transform.position, global); advanceNode.active = false; advanceNode.age = age; advanceNode.UpdateName(); }
public FibPlantNode(FibPlantNode fromNode0, Vector3 position, FibPlantGlobal global0) { fromNode = fromNode0; global = global0; global.nodes.Add(this); index = global.nodes.Count - 1; go = GameObject.CreatePrimitive(PrimitiveType.Cube); go.transform.position = position; UpdateName(); }
public void Advance() { //LeaveCopy(); go.transform.position += Vector3.up * global.levelHeight; UpdateLink(); if (age >= 2) { childNode = new FibPlantNode(this, new Vector3(1, 0, 0), global); } age++; UpdateName(); }
void Start() { global = new FibPlantGlobal(); FibPlantNode node = new FibPlantNode(null, Vector3.zero, global); }