コード例 #1
0
 public void Crash()
 {
     audioPlayer.StopAll();
     audioPlayer.Play(crashSound);                 //silence all sources and play
     if (particles != null)
     {
         var go = Instantiate(particles.gameObject, transform.position, transform.rotation) as GameObject;
         particles = go.GetComponent <ParticleEffect>();
         particles.PlayOnce();
         planeMesh.SetActive(false);
     }
     sticker.DisconnectFromItem();
     collider.enabled = false;
 }
コード例 #2
0
 public void OnObjectiveComplete(LevelObjective lvlObj)
 {
     if (lvlObj == levelObjective)
     {
         if (particles != null)
         {
             particles.PlayOnce();
         }
         if (objectToSpawn != null)
         {
             GameObject go = Instantiate(objectToSpawn, transform.position, transform.rotation) as GameObject;
         }
         if (!shutUp)
         {
             audioPlayer.Play(completionSound);
         }
     }
 }