コード例 #1
0
 // Use this for initialization
 void Awake()
 {
     playerTarget = GameObject.Find ("PlayerTarget");
     playerHealth = (PlayerHealth) playerTarget.GetComponent(typeof(PlayerHealth));
     playerScore = (PlayerScore) playerTarget.GetComponent (typeof (PlayerScore));
     spawnSphere = GameObject.Find ("Spawner Sphere");
     spawner = (SpawnParticles) spawnSphere.GetComponent(typeof(SpawnParticles));
 }
コード例 #2
0
ファイル: MenuScript.cs プロジェクト: nicolechung/the_tunnel
 void ResumeGameMechanic()
 {
     handleCollision.enabled = true;
     startMenu.enabled = false;
     particles = GameObject.FindGameObjectsWithTag("Respawn");
     foreach(GameObject particle in particles) {
         particle.GetComponent<ParticleScript>().TurnOn ();
     }
     spawner = GameObject.Find ("Spawner Sphere");
     spawnerScript = (SpawnParticles) spawner.GetComponent(typeof(SpawnParticles));
     spawnerScript.Pause ();
     GameObject playerTarget = GameObject.Find ("PlayerTarget");
     PlayerHealth playerHealth = (PlayerHealth) playerTarget.GetComponent (typeof (PlayerHealth));
     playerHealth.RestartGame();
 }