Exemplo n.º 1
0
    public void Reset()
    {
        //GameGlobals.Instance.playerController.SetActive(true);
        //playerAnimator.Play("lookAround", 0, 0);
        if (ShopWindow.Instance != null)
        {
            ShopWindowCharacterItem selectedCharacter = ShopWindow.Instance.getSelectedCharacter();
            if (selectedCharacter != null)
            {
                setCharacter(selectedCharacter.getPlayerClone());
            }
        }

        playerX = 0;
        playerZ = 0;

        currentPosition           = new Vector3(0, 0, 0);
        player.transform.position = new Vector3(0, 0, 0);

        startTime   = Time.time;
        timeEplased = 0;
        // currentLevelSpeed = this.Accelerate(Time.time - startTime);

        trackIndex         = 0;
        trackIndexTarget   = 0;
        trackIndexPosition = trackIndex;

        trackSpacing = 6f;
        isRolling    = false;
        isJumping    = false;
        isGameOver   = false;
    }
Exemplo n.º 2
0
    public void selectharacterDialogResult(DialogWindow.DialogResult result)
    {
        if (selectedCharacter == null)
        {
            return;
        }

        if (result == DialogWindow.DialogResult.Yes)
        {
            PlayerPrefs.SetInt("selected_character", selectedCharacter.characterID);

            selectedCharacter.playAnimation(selectedCharacter.storeSelectedAnimation);
            GameGlobals.Instance.audioController.playSound("UICharacterUnlock", false);
            refreshAllCharacterButtonStates();

            // Selecting Character In Game
            GameGlobals.Instance.controller.setCharacter(selectedCharacter.getPlayerClone());
        }
    }