// 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;
    }
Exemple #3
0
 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;
                }
            }
        }
    }
Exemple #5
0
    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 ColouredEndInput(NodeColour rippleInputColour)
 {
     if (rippleInputColour != NodeColour.WHITE)
     {
         if (!colourActivations[(int)rippleInputColour]) // if it's not active
         {
             colourActivations[(int)rippleInputColour] = true;
             colourCooldowns[(int)rippleInputColour] = winCooldown;
         }
     }
 }