Ejemplo n.º 1
0
    void Awake()
    {
        Application.targetFrameRate = 150;

        redCoinStarCount = 0;

        raceStarted = false;

        // There can be only one!
        if (GameObject.FindObjectsOfType <GameMaster>().Length > 1)
        {
            Debug.LogError("Multiple GameMaster components detected in the scene. Limit 1 GameMaster per scene");
        }

        coinTextHandler = GetComponent <CoinTextHandler>();

        coinTextHandler.UpdateValue(currentCoins);

        inputManager = GameObject.FindObjectOfType <InputManager>();

        if (inputManager == null)
        {
            inputManager = ((GameObject)Instantiate(DefaultInputs, Vector3.zero, Quaternion.identity)).GetComponent <InputManager>();
        }

        MarioIn.input = inputManager;
        Handler.input = inputManager;

        PauseMenu.SetActive(false);
        PauseCamera.SetActive(false);

        mainCamera = Camera.main;

        WhiteMatte.FadeIn(FadeInTime);

        if (!DebugGUI)
        {
            FramerateText.gameObject.SetActive(false);
        }

        MusicSource.timeSamples = (int)(1 * MusicSource.clip.frequency);
    }
Ejemplo n.º 2
0
    void Awake()
    {
        starAction = false;
        redPlay    = 0;
        if (Application.isEditor)
        {
            path = Application.persistentDataPath + "/save.sm64hdrsave";
            Debug.Log(path);
        }
        else
        {
            path = Application.streamingAssetsPath + "/save.sm64hdrsave";
        }


        /*if (PlayerPrefs.HasKey("savedStars"))
         * {
         *  savedStars = PlayerPrefs.GetInt("savedStars");
         *  currentStars = savedStars;
         * }*/
        AppearRed.SetActive(false);

        starAsk.SetActive(false);

        if (File.Exists(path))
        {
            Load();
            currentStars = stats.Stars;
        }

        wf       = false;
        pausable = true;
        Application.targetFrameRate = 150;

        redCoinStarCount = 0;
        ringStar         = 0;
        enterPlay        = 0;
        overed           = 0;

        raceStarted = false;
        enterCastle = false;
        exitCastle  = false;
        bobOmbEnter = false;
        whompsEnter = false;

        // There can be only one!
        if (GameObject.FindObjectsOfType <GameMaster>().Length > 1)
        {
            Debug.LogError("Multiple GameMaster components detected in the scene. Limit 1 GameMaster per scene");
        }

        coinTextHandler = GetComponent <CoinTextHandler>();

        coinTextHandler.UpdateValue(currentCoins);

        starTextHandler = GetComponent <StarTextHandler>();

        starTextHandler.UpdateValue(currentStars);

        livesTextHandler = GetComponent <LivesTextHandler>();

        livesTextHandler.UpdateValue(currentLives);

        inputManager = GameObject.FindObjectOfType <InputManager>();

        if (inputManager == null)
        {
            inputManager = ((GameObject)Instantiate(DefaultInputs, Vector3.zero, Quaternion.identity)).GetComponent <InputManager>();
        }

        MarioIn.input = inputManager;
        Handler.input = inputManager;

        PauseMenu.SetActive(false);
        PauseCamera.SetActive(false);

        mainCamera = Camera.main;

        WhiteMatte.FadeIn(FadeInTime);

        if (!DebugGUI)
        {
            FramerateText.gameObject.SetActive(false);
        }

        MusicSource.timeSamples = (int)(1 * MusicSource.clip.frequency);

        starTextHandler.UpdateValue(savedStars);

        skybox.Awakeit();

        GameObject.FindObjectOfType <DiscordController>().onSetClock();
        GameObject.FindObjectOfType <DiscordController>().currentLives = currentLives;
        GameObject.FindObjectOfType <DiscordController>().currentStars = currentStars;
        GameObject.FindObjectOfType <DiscordController>().OnClick();
    }