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 () { _rocket = GameObject.FindObjectOfType<A_Rocket>(); _rocketRB = _rocket.GetComponentInChildren<Rigidbody2D>(); _gravityBounds = GetComponentInChildren<Renderer>().bounds.size.x * 0.8f * _mass * _boundsMod; }
private const float _twoOverFive = 0.4f; // This is probably completely unnecessary but yolo void Awake () { _rocket = GameObject.FindObjectOfType<A_Rocket>(); }
public void WarpOut (Vector2 trajectory, A_Rocket rocket) { rocket.transform.position = this.transform.position; rocket.GetComponent<Rigidbody2D>().velocity = trajectory; WormIn.Reset(); }
void Awake () { _mover = GameObject.FindObjectOfType<MoveScene>(); _rocket = GameObject.FindObjectOfType<A_Rocket>(); }