Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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();
    }