public void SwitchScene()
 {
     if (FadeScript.Fading)
     {
         return;
     }
     StartCoroutine(FadeScript.FadeOut(GameObject.Find("transition").GetComponent <Image>(), "Credits"));
 }
 public void SwitchToMM()
 {
     if (FadeScript.Fading)
     {
         return;
     }
     StartCoroutine(FadeScript.FadeOut(GameObject.Find("transition").GetComponent <Image>(), "MainMenu"));
 }
Пример #3
0
 void Death()
 {
     if (life <= 0)
     {
         isDead = true;
         Debug.Log("死んだ");
         // 死亡アニメーション(あれば)
         // 暗転
         fade.FadeOut();
     }
 }
 private void FixedUpdate()
 {
     if (moveText == true)
     {
         textLocation.position = new Vector2(textLocation.position.x - 120 * Time.deltaTime, textLocation.position.y);
         if (textLocation.position.x <= -100)
         {
             moveText = false;
             fadeScript.FadeOut();
         }
     }
 }
Пример #5
0
 public void AnimationEvent_NewDirection()
 {
     if (left != null && right != null)
     {
         MainController.SwitchToNext();
     }
     else
     {
         mFade.FadeOut();
         print("reached end point, you found nr." + synapze.GetComponent <EndPointBehavior>().index);
         synapze.transform.parent.GetComponent <XMLSerializationExample>().SaveNewInteger(synapze.GetComponent <EndPointBehavior>().index);
     }
 }
Пример #6
0
    // Update is called once per frame
    void Update()
    {
        if (timer.gameOver)
        {
            // ここに効果音

            // フェードアウト
            fade.FadeOut();
        }
        if (timer.gameOver && fade.alfa == 1)
        {
            SceneManager.LoadScene("Result");
        }
    }
Пример #7
0
    void LateUpdate()
    {
        remainingEnemy = GameObject.FindGameObjectsWithTag("Enemy");

        if (remainingEnemy.Length < 1)
        {
            fade.FadeOut();

            if (fade.alfa == 1)
            {
                // シーン移動
                SceneManager.LoadScene("BossStage");
            }
        }
    }
Пример #8
0
    // Update is called once per frame
    void Update()
    {
        // フェードアウトが終わったらカウントダウン開始
        if (fade.FadeOut(5.0f))
        {
            if (enable == false)
            {
                countDownObj.SetActive(true);
                countDownAnim.SetTrigger("start");

                // timeManagerをアクティブ
                timeManager.SetActive(true);

                enable = true;
            }
        }
    }
Пример #9
0
    // Update is called once per frame
    void Update()
    {
        if (Input.anyKeyDown)
        {
            isInput = true;
            // ここに効果音
            source.PlayOneShot(audio);
        }

        if (isInput)
        {
            // フェードアウト
            fade.FadeOut();
        }
        if (isInput && fade.alfa == 1)
        {
            SceneManager.LoadScene("Main");
        }
    }
Пример #10
0
    // Use this for initialization
    private IEnumerator Start()
    {
        m_DialogueOptionsMenu.SetActive(false);

        var onInitialCustomer = true;

        foreach (var customerObject in m_CustomerObjects)
        {
            m_BackgroundImage.sprite = customerObject.backgroundSprite;

            if (m_CharacterAnimator != null)
            {
                Destroy(m_CharacterAnimator.gameObject);
            }

            var characterGameObject = Instantiate(customerObject.characterPrefab);
            characterGameObject.transform.SetParent(transform, false);
            characterGameObject.transform.SetSiblingIndex(m_CharacterTransformIndex);

            m_CharacterAnimator = characterGameObject.GetComponent <Animator>();

            m_DesireToBuy = 0;

            EnableTextBox();

            m_CharacterAnimator.gameObject.SetActive(false);

            if (!onInitialCustomer && m_FadeScript)
            {
                m_DoorOpenSource.Play();

                var fadeIn = m_FadeScript.FadeIn();
                while (fadeIn.MoveNext())
                {
                    yield return(null);
                }
            }

            m_CharacterNameText.text = "You";
            m_TextBox.text           = customerObject.dialogue.openingStatement;

            onInitialCustomer = false;

            yield return(WaitForUser());

            m_CharacterAnimator.gameObject.SetActive(true);

            var earlySale = false;
            foreach (var statement in customerObject.dialogue.statements)
            {
                m_CharacterNameText.text = customerObject.name;
                m_TextBox.text           = statement.text;

                m_CharacterAnimator.CrossFade("Neutral", m_CrossfadeTime);

                EnableDialogueOptions();

                m_Option1.GetComponentInChildren <Text>().text = statement.options[0].text;
                m_Option2.GetComponentInChildren <Text>().text = statement.options[1].text;
                m_Option3.GetComponentInChildren <Text>().text = statement.options[2].text;

                m_SellButton.gameObject.SetActive(!customerObject.hideSellButton);

                m_SelectedOption = SelectedOption.None;
                while (m_SelectedOption == SelectedOption.None)
                {
                    yield return(null);
                }

                yield return(null);

                EnableTextBox();

                switch (m_SelectedOption)
                {
                case SelectedOption.Option1:
                    m_TextBox.text = statement.options[0].response;
                    m_CharacterAnimator.CrossFade(statement.options[0].mood, m_CrossfadeTime);

                    m_DesireToBuy += statement.options[0].value;
                    break;

                case SelectedOption.Option2:
                    m_TextBox.text = statement.options[1].response;
                    m_CharacterAnimator.CrossFade(statement.options[1].mood, m_CrossfadeTime);

                    m_DesireToBuy += statement.options[1].value;
                    break;

                case SelectedOption.Option3:
                    m_TextBox.text = statement.options[2].response;
                    m_CharacterAnimator.CrossFade(statement.options[2].mood, m_CrossfadeTime);

                    m_DesireToBuy += statement.options[2].value;
                    break;

                case SelectedOption.Sell:
                    earlySale = true;
                    yield return(AttemptToSell(customerObject));

                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                if (earlySale)
                {
                    break;
                }

                yield return(WaitForUser());
            }
            if (!earlySale)
            {
                yield return(AttemptToSell(customerObject));
            }

            if (m_FadeScript)
            {
                var fadeOut = m_FadeScript.FadeOut();
                while (fadeOut.MoveNext())
                {
                    yield return(null);
                }

                m_TextBox.text           = string.Empty;
                m_CharacterNameText.text = string.Empty;
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (regulated != _regulated)
        {
            _regulated = regulated;
            initializeAudioClips();
        }
        if (state == States.Beginning)
        {
            state = States.Advisor1FirstClip;
            advisor2Animator.currentlyPlaying = AdvisorAnimationEnum.Idle;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.isTalking;
            source1.Stop();
            source1.clip = a1;
            source1.Play();
        }
        if (state == States.Advisor1FirstClip && !source1.isPlaying)
        {
            state = States.Advisor2FirstClip;

            advisor2Animator.currentlyPlaying = AdvisorAnimationEnum.isTalking2;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.Idle;
            source2.Stop();
            source2.clip = b1;
            source2.Play();
        }

        if (state == States.Advisor2FirstClip && !source2.isPlaying)
        {
            state = States.Advisor1SecondClip;

            advisor2Animator.currentlyPlaying = AdvisorAnimationEnum.Idle;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.isTalking;
            source1.Stop();
            source1.clip = a2;
            source1.Play();
        }


        if (state == States.Advisor1SecondClip && !source1.isPlaying)
        {
            state = States.Advisor2SecondClip;

            advisor2Animator.currentlyPlaying = AdvisorAnimationEnum.isTalking2;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.Idle;
            source2.Stop();
            source2.clip = b2;
            source2.Play();
        }



        if (state == States.Advisor2SecondClip && !source2.isPlaying)
        {
            state = States.AwaitingPlayerResponse;
            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.isShakingHands;
            advisor2Animator.currentlyPlaying = AdvisorAnimationEnum.isShakingHands;
        }

        if (state == States.ChooseTaxi)
        {
            state = States.TransitionTime;
            StaticDecisionsMade.chooseToTakeTaxi = true;
            advisor2Animator.currentlyPlaying    = AdvisorAnimationEnum.isDisappointed;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.isShakingHandsEnd;
            source1.Stop();
            source1.clip = aGotChosen;
            source1.Play();
        }

        if (state == States.ChooseUber)
        {
            state = States.TransitionTime;
            StaticDecisionsMade.chooseToTakeTaxi = false;
            advisor2Animator.currentlyPlaying    = AdvisorAnimationEnum.isShakingHandsEnd;

            advisor1Animator.currentlyPlaying = AdvisorAnimationEnum.isDisappointed;
            source2.Stop();
            source2.clip = bGotChosen;
            source2.Play();
        }

        if (state == States.TransitionTime && !source1.isPlaying && !source2.isPlaying)
        {
            //Transition scene!
            //Might want to delay this a bit more.
            if (!FadedOut)
            {
                FadedOut = true;
                fader.FadeOut();
            }
            else
            {
                if (!fader.isTransitioning() && !FadedIn)
                {
                    FadedIn = true;
                    //Do all the movements, this is when screen is dark.
                    player.transform.position = new Vector3(.85f, -13.9f, 14.97f);
                    //change sounds
                    city.GetComponent <AudioSource>().enabled = true;
                    colombianRestaurant.GetComponent <AudioSource>().enabled = false;

                    //Enable one of the cars
                    if (StaticDecisionsMade.chooseToTakeTaxi)
                    {
                        taxiCar.SetActive(true);
                    }
                    else
                    {
                        uberCar.SetActive(true);
                    }

                    //Fade in
                    fader.FadeIn();
                }
                else if (!fader.isTransitioning() && !FadedInFadedOut)
                {
                    FadedInFadedOut = true;
                    //Do anything AFTER fade in, screen is done, transition is done
                    Debug.Log("I happen after the player moves and can see again!");
                    state = States.PlayingFinalRadioStuff;
                }
            }
        }
        if (state == States.PlayingFinalRadioStuff)
        {
            state = States.Done;
            radioAudioSource.Stop();
            radioAudioSource.clip = radioClip;
            radioAudioSource.Play();
            //Start playing the final radio stuff
        }
        if (state == States.Done && !radioAudioSource.isPlaying)
        {
            ///Transition to scene 3
            SceneManager.LoadScene("Second Accelorated Future");
        }
    }