Spawn() 공개 메소드

public Spawn ( ) : void
리턴 void
예제 #1
0
    private IEnumerator Destroy()
    {
        destroyed = true;

        var trail = GetComponentInChildren <TrailRenderer>();

        trail.transform.parent = null;

        var rigidbodies = GetComponentsInChildren <Rigidbody>();

        foreach (var rigidbody in rigidbodies)
        {
            Destroy(rigidbody);
        }

        yield return(new WaitForSeconds(1));

        spawnScript.Spawn();

        catapultController.cameraPause       = false;
        catapultController.waitingForArrival = false;


        GameObject.Destroy(gameObject.transform.parent.gameObject);

        yield return(new WaitForSeconds(5));

        Destroy(this.gameObject.transform.parent.gameObject);
    }
예제 #2
0
 private void Update()
 {
     timer += Time.deltaTime;
     if (timer >= currSpawnTime)
     {
         currSpawnTime = URand.Range(minSpawnTime, maxSpawnTime);
         timer         = 0;
         spawnScript.Spawn();
     }
 }
예제 #3
0
 public void Fire()
 {
     if (canFire)
     {
         canFire = false;
         bulletSpawnScript.Spawn();
         animControll.SetTrigger(fireTriggerHash);
         if (audioSource.enabled)
         {
             audioSource.PlayOneShot(audioSource.clip);
         }
     }
 }