// Use this for initialization void Start() { Image img = this.GetComponent <Image>(); var temp = img.color; temp.a = 1.0f; img.color = temp; StartCoroutine(FadeScript.FadeIn(img)); }
// Update is called once per frame void Update() { // Aボタンが入力されたら if (mInput.GetEnter() == true) { nextScene = true; audioSource.PlayOneShot(audioSource.clip); } // 次シーンへの遷移フラグが立ったら if (nextScene == true) { if (mFade.FadeIn(1.0f)) { SceneManager.LoadScene("in-GameSample 1"); } } }
void Update() { if (Input.GetButton("Jump") && pDamage.isDead) { RespawnPlayer(); } if (isDeth) { fade.FadeIn(); if (fade.alfa < 0.7 && isDeth) { pDamage.isDead = false; } if (fade.alfa == 0) { isDeth = false; } } }
// Use this for initialization void Start() { fade = GameObject.Find("Fade").GetComponent <FadeScript>(); fade.FadeIn(); descriptionCloseButton = GameObject.Find("DescriptionCloseButton"); difficultyLabel = GameObject.Find("DifficultyLabel").GetComponent <exSpriteFont>(); difficultyLabel.text = NotesData.DIFFICULTY_LEVEL; musicSrc = (AudioSource)this.gameObject.GetComponent <AudioSource>(); musicSrc.Play(); for (int i = 0; i < ModeLauncherScript.modesDone.Length; i++) { string name = string.Format("Checkbox_{0}", i + 1); exSprite sprite = GameObject.Find(name).GetComponent <exSprite>(); sprite.renderer.enabled = ModeLauncherScript.modesDone[i]; } if (ModeLauncherScript.descriptionViewed) { CloseDescription(); } }
// 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; } } }
// Fade in void SetupFade() { fade = GameObject.Find("Fade").GetComponent <FadeScript>(); fade.FadeIn(); feedback = GameObject.Find("Feedback").GetComponent <FeedbackScript>(); }
// 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"); } }
// Use this for initialization void Start() { fade = GameObject.Find("Fade").GetComponent<FadeScript>(); fade.FadeIn(); descriptionCloseButton = GameObject.Find("DescriptionCloseButton"); difficultyLabel = GameObject.Find("DifficultyLabel").GetComponent<exSpriteFont>(); difficultyLabel.text = NotesData.DIFFICULTY_LEVEL; musicSrc = (AudioSource)this.gameObject.GetComponent<AudioSource>(); musicSrc.Play(); for (int i = 0; i < ModeLauncherScript.modesDone.Length; i++) { string name = string.Format("Checkbox_{0}", i + 1); exSprite sprite = GameObject.Find(name).GetComponent<exSprite>(); sprite.renderer.enabled = ModeLauncherScript.modesDone[i]; } if (ModeLauncherScript.descriptionViewed) { CloseDescription(); } }