void Start() { // we only need to do this if there's a rigidbody in the first place if (GetComponent <Rigidbody2D>()) { rb = GetComponent <Rigidbody2D>(); pauseVel = rb.velocity; ugm = GameObject.Find("GameManager").GetComponent <UtilityGameManager>(); } Invoke("Dest", timeToDestroy); }
private void Start() { refPlayerMovement = GetComponent <PlayerMovementNew>(); refPlayerCollision = GetComponent <PlayerCollisionNew>(); refPlayerAudio = GetComponent <PlayerAudioNew>(); refPlayerVisuals = GetComponent <PlayerVisualsNew>(); rb = GetComponent <Rigidbody2D>(); refGameManager = FindObjectOfType <UtilityGameManager>(); }