Ejemplo n.º 1
0
    //---------------------------------------
    void Start()
    {
        currentWaypoint = 0;
        currentLap      = -1; // make sure currentLap is initialized with -1 !
                              // trackmanager:
        RM = RaceManagerSingleton.Singleton;
        if (!RM)
        {
            Debug.LogError("no RaceManager found!");
        }
        AIPath = (PathManager)WPManager.GetComponent <PathManager>();
        if (!AIPath)
        {
            Debug.LogError("no path found... :(");
        }
        VS = (Vehicle)GetComponent <Vehicle>();
        if (!VS)
        {
            Debug.LogError("no vs-script found?");
        }

        player = GetComponent <Player>();


        if (AIPath)
        {
            lastWaypoint = AIPath.GetLastPoint();
            nextWayPoint = AIPath.GetPoint(0);
        }
    }
Ejemplo n.º 2
0
    //---------------------------------------
    // Use this for initialization
    void Start()
    {
        GM = GameManagerSingleton.Singleton;
        RM = RaceManagerSingleton.Singleton;


        PauseMenu.SetActive(false);
        RaceFinishedUI.SetActive(false);
        GameUI.SetActive(false);
        SettingsUI.SetActive(false);
        Compass.SetActive(true);
        PreStartUI.SetActive(true);

        // create list of available resolutions:
        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();

        List <string> options = new List <string>();
        int           currentResolutionIndex = 0;


        for (int i = 0; i < resolutions.Length; i++)
        {
            string option = resolutions[i].width + "x" + resolutions[i].height;
            options.Add(option);
            if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
            {
                currentResolutionIndex = i;
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }