PlayWarning









How do I use Play Warning
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: WarningText.cs Copy
23  public void PlayWarning(){
24   if (GameController.instance != null && MusicController.instance != null) {
25    if(GameController.instance.isMusicOn){
26     if (audioSource.clip != null) {
27      audioSource.loop = true;
28      audioSource.Play ();
29     }
30    }
31   }
32  }
File name: GameplayController.cs Copy
159  IEnumerator SpawnBossTime(){
160   warningText.gameObject.SetActive (true);
161   warningText.transform.GetComponent ().PlayWarning ();
162   yield return new WaitForSeconds (5f);
163   warningText.gameObject.SetActive (false);
164   warningText.transform.GetComponent ().StopWarning ();
165   GameObject.FindGameObjectWithTag ("Spawner").transform.GetComponent ().SpawnBoss ();
166  }

PlayWarning 108 lượt xem

Gõ tìm kiếm nhanh...