private void DisposeOfCurrentPlanet() { currentPlanet.gameObject.GetComponent <Collider2D>().enabled = false; var randomDirection = new Vector2(Random.Range(0f, 360f), Random.Range(0f, 360f)); currentPlanet.GetComponent <Rigidbody2D>().AddForce(randomDirection * 15f, ForceMode2D.Force); }
public void ColonizePlanet(GameObject planet) { currentPlanet = planet.AddComponent <PlayerPlanet>(); currentPlanet.tag = Tags.PLAYER_PLANET; currentPlanet.GetComponent <Rigidbody2D>().velocity = Vector3.zero; currentPlanet.gameController = this; // currentPlanet.transform.position = gunGameObject.transform.position; // shipControls.gameObject.transform.position = currentPlanet.transform.position; PlanetStageEvent(); }