public void Destroy () { if (_r == null) _r = GameObject.FindObjectOfType<A_Rocket>(); if (_sm == null) _sm = GameObject.FindObjectOfType<SpawnManager>(); if ((Vector2.Distance (this.transform.position, _r.transform.position)) > _sm.ScreenWidthInWorldUnits * 2.1) { Destroy(gameObject); } }
void Start () { _spawnManager = GameObject.FindObjectOfType<SpawnManager>(); }
public AreaLoader (SpawnManager spawnManager, float offset) { _spawnManager = spawnManager; _offset = offset; }