private void Start() { if (explosionObjectPool == null) { explosionObjectPool = FindObjectOfType <ExplosionObjectPool>(); } }
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; }