public void DisplayPossibleInput()
    {
        //Get the current active slot to later check for possible inputs
        Scr_SlotBehavior activeSlot = partition.activeSlot.GetComponent <Scr_SlotBehavior>();

        HideAllPossibleInput();

        //Run through every possible inputs and change the sprite of the corresponding input to ON
        for (int i = 0; i < activeSlot.possibleInput.Length; i++)
        {
            if (activeSlot.possibleInput[i] == 0)
            {
                aInputImage.sprite = aInputImage.GetComponent <Scr_SpriteSwap>().spriteA;
            }
            else if (activeSlot.possibleInput[i] == 1)
            {
                bInputImage.sprite = bInputImage.GetComponent <Scr_SpriteSwap>().spriteA;
            }
            else if (activeSlot.possibleInput[i] == 2)
            {
                xInputImage.sprite = xInputImage.GetComponent <Scr_SpriteSwap>().spriteA;
            }
            else if (activeSlot.possibleInput[i] == 3)
            {
                yInputImage.sprite = yInputImage.GetComponent <Scr_SpriteSwap>().spriteA;
            }
        }
    }
Exemple #2
0
    private void InputEvent()
    {
        if (!conductor.isBreak)
        {
            if (aInput || bInput || xInput || yInput)
            {
                if (isLookingForInputs)
                {
                    asHitNoteInBeat    = true;
                    isLookingForInputs = false;

                    melodySpriteManager.StartAttackAnim();

                    Scr_SlotBehavior activeSlot = partition.activeSlot.GetComponent <Scr_SlotBehavior>();

                    if (activeSlot.possibleInput.Length > 0)
                    {
                        for (int i = 0; i < activeSlot.possibleInput.Length; i++)
                        {
                            if (inputIndex == activeSlot.possibleInput[i])
                            {
                                propsOnBeat.StartZoomToBeat(zoomToBeatZoomScale);
                                Scr_TempoUI.instance.StartSuccessInput();

                                partition.activeSlot = activeSlot.linkedSlot[i];

                                chain.Add(partition.activeSlot.GetComponent <Scr_SlotBehavior>().inputIndex);
                                UpdateChainInputUI();

                                possibleInputUI.DisplayPossibleInput();

                                dummyHealthManager.TakeDamage(activeDmg + (activeDmg * (dmgScaling * chain.Count - 1)));
                                break;
                            }
                            else if (inputIndex != activeSlot.possibleInput[i] && i == activeSlot.possibleInput.Length - 1)
                            {
                                EndPhase();
                            }
                        }
                    }
                    else
                    {
                        EndPhase();
                    }
                }
                else
                {
                    EndPhase();
                }
            }
        }
    }