Exemplo n.º 1
0
 public void TransitionToState(SO_State nextState)
 {
     if (nextState != defaultState)
     {
         currentState = nextState;
         OnExistState();
     }
 }
 public void TransitionToState(SO_State nextState)
 {
     if (nextState != remainState)
     {
         currentState = nextState;
         OnExitState();
     }
 }
Exemplo n.º 3
0
    public void PlayCurrentState(SO_State input)
    {
        //Debug.Log("[Sound Manager] : Şarkım Başladı");

        _audioSource.clip = input.stateSound;
        _audioSource.Play();
        canListen = true;
    }
Exemplo n.º 4
0
    private void InformFinished()
    {
        if (currentStateAnswer)
        {
            if (seconStatus == 0 || firstStatus == 0 || thirdStatus == 0)
            {
                currentState = firstState;
                firstStatus  = 5;
                seconStatus  = 5;
                thirdStatus  = 5;
                soundManager.PlayCurrentState(currentState);
            }
            else
            {
                currentState = currentState.positiveNextState;

                soundManager.PlayCurrentState(currentState);
            }
        }
        else
        {
            if (seconStatus == 0 || firstStatus == 0 || thirdStatus == 0)
            {
                currentState = firstState;
                firstStatus  = 5;
                seconStatus  = 5;
                thirdStatus  = 5;
                soundManager.PlayCurrentState(currentState);
                //Debug.Log("0 landı No dedim");
                //Debug.Log(firstStatus);
                //Debug.Log(seconStatus);
                //Debug.Log(thirdStatus);
            }
            else
            {
                //Debug.Log("No dedim");
                //Debug.Log(firstStatus);
                //Debug.Log(seconStatus);
                //Debug.Log(thirdStatus);
                currentState = currentState.negativeNextState;

                soundManager.PlayCurrentState(currentState);
            }
        }
    }
Exemplo n.º 5
0
    private void SoundFinished()
    {
        //Debug.Log("Game Manager : Sound Bitti");
        if (currentState.stateType == StateType.OnlySound)
        {
            //Debug.Log("[Game Manager] :[Only Sound] Yes Dedim");
            currentState = currentState.positiveNextState;
            soundManager.PlayCurrentState(currentState);
        }
        else if (currentState.stateType == StateType.AnswerSound)
        {
            //Debug.Log("[Game Manager] :[Answer] Input Açtım");

            StartInput();
        }
        if (currentState.checkPoint)
        {
            firstState.positiveNextState = currentState;
        }
    }
Exemplo n.º 6
0
    public void InformUser(SO_State input, bool isPositive)
    {
        indexAudio = 0;
        myAudioList.Clear();
        if (isPositive)
        {
            if (input.canInformGoldPos)
            {
                myAudioList.Add(goldPositive);
            }

            if (input.canInformGoldNeg)
            {
                myAudioList.Add(goldNegative);
            }

            if (input.canInformArmyPos)
            {
                myAudioList.Add(armyPositive);
            }

            if (input.canInformArmyNeg)
            {
                myAudioList.Add(armyNegative);
            }

            if (input.canInformPopulationPos)
            {
                myAudioList.Add(populationPositive);
            }
            if (input.canInformPopulationNeg)
            {
                myAudioList.Add(populationNegative);
            }
            //Debug.Log(myAudioList.Count);
            if (myAudioList.Count != 0)
            {
                PlayMyAudioList();
            }
            else
            {
                informFinished?.Invoke();
            }
        }
        else
        {
            if (input.canInformGoldPos1)
            {
                myAudioList.Add(goldPositive);
            }

            if (input.canInformGoldNeg1)
            {
                myAudioList.Add(goldNegative);
            }

            if (input.canInformArmyPos1)
            {
                myAudioList.Add(armyPositive);
            }

            if (input.canInformArmyNeg1)
            {
                myAudioList.Add(armyNegative);
            }

            if (input.canInformPopulationPos1)
            {
                myAudioList.Add(populationPositive);
            }
            if (input.canInformPopulationNeg1)
            {
                myAudioList.Add(populationNegative);
            }
            //Debug.Log(myAudioList.Count);
            if (myAudioList.Count != 0)
            {
                PlayMyAudioList();
            }
            else
            {
                informFinished?.Invoke();
            }
        }
    }