Exemplo n.º 1
0
    public void LaunchHit(Vector3 newplayerpos, float newplayerlaunchangle)
    {
        player.gameObject.SetActive(true);
        if (firstlaunch)
        {
            player.Init();
            firstlaunch = false;
        }

        //terrainscroll.enabled = true;
        player.transform.position = newplayerpos;

        float   angleInRadians = newplayerlaunchangle * Mathf.Deg2Rad;
        Vector2 newstartforce  = new Vector2((float)Mathf.Cos(angleInRadians), (float)Mathf.Sin(angleInRadians));

        newstartforce    *= initialstartforcemagnitude;
        player.startForce = newstartforce;

        StartNewLaunch();
    }