Пример #1
0
    public bool ProcessCombo(int id, Globals.HazardColors color, CenterLeafScript cls)
    {
        //Debug.Log("id: " + id);

        bool result = false;
        if(cls != null){
            if (id == comboCount + 1 )
            {
                comboCount = id;
                result = true;
                cls.MakeSpecialEffect();
            }
            else {comboCount = -1;}

            if( comboCount == bugs.Length ){
                CreateReward(color);
                comboCount = -1;

                if(color == Globals.HazardColors.WHITE){
                    CreateReward(color);
                    CreateReward(color);
                }
            }
        }

        if(result){Globals.stateManager.audioSource.PlayOneShot(comboSound); return true;}
        else{Globals.stateManager.audioSource.PlayOneShot(notComboSound); return false;}
    }
Пример #2
0
    public bool ProcessCombo(int id, int total, Globals.HazardColors color, CenterLeafScript cls)
    {
        //Debug.Log("id: " + id);

        bool result = false;
        if(cls != null){
            if( (id == comboCount + 1 && totalComboCount == total) || id == 1)
            {
                comboCount = id;
                result = true;
                cls.MakeSpecialEffect();
                flashyTextTimer = 0.3f;
            }
            else {comboCount = 0;}
            totalComboCount = total;

            if( comboCount == total ){
                CreateReward(color);
                comboCount = 0;
            }
        }

        if(result){Globals.stateManager.audioSource.PlayOneShot(comboSound); return true;}
        else{Globals.stateManager.audioSource.PlayOneShot(notComboSound); return false;}
    }
Пример #3
0
    public bool ProcessCombo(int id, Globals.HazardColors color, CenterLeafScript cls)
    {
        //Debug.Log("id: " + id);

        bool result = false;

        if (cls != null)
        {
            if (id == comboCount + 1)
            {
                comboCount = id;
                result     = true;
                cls.MakeSpecialEffect();
            }
            else
            {
                comboCount = -1;
            }

            if (comboCount == bugs.Length)
            {
                CreateReward(color);
                comboCount = -1;

                if (color == Globals.HazardColors.WHITE)
                {
                    CreateReward(color);
                    CreateReward(color);
                }
            }
        }

        if (result)
        {
            Globals.stateManager.audioSource.PlayOneShot(comboSound); return(true);
        }
        else
        {
            Globals.stateManager.audioSource.PlayOneShot(notComboSound); return(false);
        }
    }
Пример #4
0
    public bool ProcessCombo(int id, int total, Globals.HazardColors color, CenterLeafScript cls)
    {
        //Debug.Log("id: " + id);

        bool result = false;

        if (cls != null)
        {
            if ((id == comboCount + 1 && totalComboCount == total) || id == 1)
            {
                comboCount = id;
                result     = true;
                cls.MakeSpecialEffect();
                flashyTextTimer = 0.3f;
            }
            else
            {
                comboCount = 0;
            }
            totalComboCount = total;

            if (comboCount == total)
            {
                CreateReward(color);
                comboCount = 0;
            }
        }

        if (result)
        {
            Globals.stateManager.audioSource.PlayOneShot(comboSound); return(true);
        }
        else
        {
            Globals.stateManager.audioSource.PlayOneShot(notComboSound); return(false);
        }
    }