void OnMouseUpAsButton() { NodeFunctions n = GetComponentInParent <NodeFunctions> (); n.activeNode = this; n.recieveClick(); }
void OnMouseExit() { NodeFunctions n = GetComponentInParent <NodeFunctions> (); testBrain b = n.player.GetComponent("testBrain") as testBrain; SpriteRenderer rend = gameObject.GetComponent("SpriteRenderer") as SpriteRenderer; if (!b.done) { rend.sprite = null; renderer.material.color = Color.white; } }
void OnMouseOver() { NodeFunctions n = GetComponentInParent <NodeFunctions> (); testBrain b = n.player.GetComponent("testBrain") as testBrain; SpriteRenderer rend = gameObject.GetComponent("SpriteRenderer") as SpriteRenderer; if (n.firstClick && !b.done) { rend.sprite = n.sprite; renderer.material.color = Color.yellow; } else if (!n.firstClick && !n.secondClick) { rend.sprite = n.sprite; renderer.material.color = Color.red; } }
void finish() { GameObject t = (GameObject)path [0]; nod = t.GetComponentInParent <NodeFunctions>(); Sprite sprite = nod.sprite; for (int i = 0; i < path.Count; i++) { t = (GameObject)path[i]; rend = t.GetComponent <SpriteRenderer>(); rend.sprite = sprite; t.renderer.material.color = Color.green; } done = true; }
public void Initiate() { start = true; stop = false; prevPos = startNode.transform.position; data = startNode.GetComponent("NodeData") as NodeData; //targetPos = data.down.transform.position; data.debugLines(data.name); count = 1; seek(startNode, "Floater"); GameObject t = (GameObject)path [count]; targetPos = t.transform.position; nod = startNode.GetComponentInParent <NodeFunctions>(); }