void Update() { if (interaction==null) { interaction = GameObject.Find("Player").transform.FindChild("Main Camera").GetComponent<Core>().interaction; if (interaction != null) { interaction.addInteractionObject(this.gameObject, delegate() { OnMouseDown(); }, delegate() { gameObject.renderer.material = iluminated; }, delegate() { gameObject.renderer.material = normal; }); } } play = Mathf.PingPong(Time.time, 3); if (play > 2.9) { particle.emit = true ; } else { particle.emit = false; } }
void Update() { if (interaction == null) { interaction = GameObject.Find("Player").transform.FindChild("Main Camera").GetComponent<Core>().interaction; if (interaction != null) { interaction.addInteractionObject(leftButton, delegate() { targetNode = targetNode.Links[1]; }); interaction.addInteractionObject(rightButton, delegate() { targetNode = targetNode.Links[0]; }); interaction.addInteractionObject(backButton, delegate() { endPoint = startPoint; target = prevNode.ThisObject; currentState = MOVE; }); interaction.addInteractionObject(playButton, delegate() { print("Playing the game"); }); interaction.addInteractionObject(interactButton, delegate() { print("Interact"); }); } } StateManagement(); Debug.Log(currentState); }