Exemple #1
0
    void Start()
    {
        shipRB = GetComponent <Rigidbody>();
        shipGB = GetComponent <GravBody>();
        if (playerExit == null)
        {
            Debug.LogError("ShipController: No player exit; set in the inspector");
        }

        shipCamJib = GetComponentInChildren <ShipCam>();
        flightHelp = FindObjectOfType <FlightHelp>();

        if (!control)
        {
            Exit(false);
        }
        else
        {
            Enter();
        }

        moduleSlots = GameObject.FindGameObjectsWithTag("ModuleSlot");
        foreach (GameObject slot in moduleSlots)
        {
            slot.SetActive(false);
        }

        speedometer.enabled = false;

        RefreshModules();
    }
    IEnumerator DetachCam()
    {
        ShipCam shipCam = FindObjectOfType <ShipCam>();

        shipCam.Detach();

        shipController.enabled = false;

        yield return(new WaitForSeconds(5f));

        FindObjectOfType <MenuManager>().RestartLevel();
    }