示例#1
0
 private void Start()
 {
     if (explosionObjectPool == null)
     {
         explosionObjectPool = FindObjectOfType <ExplosionObjectPool>();
     }
 }
示例#2
0
 private static void AssignSingletons()
 {
     if (!scoreboard)
     {
         scoreboard = FindObjectOfType <Scoreboard>();
     }
     if (!explosionPool)
     {
         explosionPool = FindObjectOfType <ExplosionObjectPool>();
     }
 }
    // Use this for initialization
    void Start()
    {
        var collisionHandler = GetComponent <PlayerCollisonHandler>();

        audioSource   = GetComponent <AudioSource>();
        explosionPool = FindObjectOfType <ExplosionObjectPool>();
        renderers     = GetComponentsInChildren <MeshRenderer>();
        bulletSystems = bulletsObject.GetComponentsInChildren <ParticleSystem>();

        collisionHandler.PlayerCollisionObservers += StartDeathSequence;

        originalBulletVolume = audioSource.volume;
    }