// Use this for initialization void Start() { startingScale = transform.localScale; actualRippleColour = parent.GetComponent <StartNodeScript>().GetNodeColor(); rippleColour = parent.GetComponent <StartNodeScript>().nodeColour; }
// Use this for initialization void Start() { startingScale = transform.localScale; actualRippleColour = parent.GetComponent<StartNodeScript>().GetNodeColor(); rippleColour = parent.GetComponent<StartNodeScript>().nodeColour; }
public void ColouredEndInput(NodeColour rippleInputColour) { if (rippleInputColour != NodeColour.WHITE) { if (!colourActivations[(int)rippleInputColour]) // if it's not active { colourActivations[(int)rippleInputColour] = true; colourCooldowns[(int)rippleInputColour] = winCooldown; } } }
public void ActivateRipple(NodeColour rippleInputColour) { // if you're not currently moving a node, then ripples will activate things if (!manager.GetComponent<GameManager>().IsMovingANode()) { if (isEndNode) { gameObject.GetComponent<AudioSource>().Play(); if (nodeColour == NodeColour.WHITE) { IncrementWinningRippleHits(); } else { ColouredEndInput(rippleInputColour); } } else if (/*currentCooldown < 0 && */ !disabled) { if (rippleInputColour == nodeColour || rippleInputColour == NodeColour.WHITE) { currentCooldown = RippleCooldown; RippleScript[] scripts = gameObject.GetComponentsInChildren<RippleScript>(); for (int i = 0; i < scripts.Length; i++) { if (!scripts[i].active) { //gameObject.GetComponent<AudioSource>().pitch += Random.Range(-0.02f, 0.02f); gameObject.GetComponent<AudioSource>().Play(); scripts[i].Activate(); activeRipples++; break; } } currentCooldown = RippleCooldown; } } } }
public void ActivateRipple(NodeColour rippleInputColour) { // if you're not currently moving a node, then ripples will activate things if (!manager.GetComponent <GameManager>().IsMovingANode()) { if (isEndNode) { gameObject.GetComponent <AudioSource>().Play(); if (nodeColour == NodeColour.WHITE) { IncrementWinningRippleHits(); } else { ColouredEndInput(rippleInputColour); } } else if (/*currentCooldown < 0 && */ !disabled) { if (rippleInputColour == nodeColour || rippleInputColour == NodeColour.WHITE) { currentCooldown = RippleCooldown; RippleScript[] scripts = gameObject.GetComponentsInChildren <RippleScript>(); for (int i = 0; i < scripts.Length; i++) { if (!scripts[i].active) { //gameObject.GetComponent<AudioSource>().pitch += Random.Range(-0.02f, 0.02f); gameObject.GetComponent <AudioSource>().Play(); scripts[i].Activate(); activeRipples++; break; } } currentCooldown = RippleCooldown; } } } }