Ejemplo n.º 1
0
    public void Deorbit()
    {
        transform.parent = null;
        IsOrbiting       = false;
        Vector3 dir   = transform.position - orbit.position;
        float   angle = Mathf.Atan2(dir.y, dir.x);

        transform.rotation = Quaternion.Euler(0, 0, angle * Mathf.Rad2Deg - 90);
        mover.StartMoving();
    }