Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     _rigidbody = GetComponent <Rigidbody>();
     _scoreMenu = _scoreMenuUI.GetComponent <ScoreMenu>();
     _scoreMenu.Hide();
     _scoreMenu._score = 0;
 }
Пример #2
0
 void startScoreCount()
 {
     ScoreMenu.SetActive(true);
     iTween.ValueTo(gameObject, iTween.Hash("from", 0, "to", GamePlayController.Static.ingameScoreCount, "time", 1, "easetype", iTween.EaseType.easeInOutCubic,
                                            "onupdate", "changeScoreText", "oncomplete", "startDistanceCount"));
     SoundController.Static.PlaySlider();
 }
Пример #3
0
 //Intialise all menues on start
 void Start()
 {
     _scoreMenu = scoreMenu.GetComponent <ScoreMenu>();
     HUD.SetActive(false);
     scoreMenu.SetActive(false);
     startMenu.SetActive(true);
     tutorialMenu.SetActive(false);
 }
Пример #4
0
 private void initState()
 {
     states    = new GameState[Constant.STATES];
     states[0] = new PrincipalMenu();
     states[1] = GameManager.Instance;
     states[2] = new PauseMenu();
     states[3] = new ScoreMenu();
     states[4] = new GameRules();
     states[5] = new Win();
 }
Пример #5
0
 private void Awake()
 {
     if (instance != null)
     {
         if (instance != this)
         {
             Destroy(this);
             //instance = this;
             //DontDestroyOnLoad(_canvas.gameObject);
         }
     }
     else
     {
         instance = this;
         //DontDestroyOnLoad(_canvas.gameObject);
     }
 }
Пример #6
0
    private void ToggleScoreboard(bool InToggle)
    {
        if (InToggle)
        {
            m_ScoreBoard = GameObject.Instantiate(GameMode.m_GameMode.m_GameData.m_ScoreMenu);

            m_ScoreBoard.transform.SetParent(m_HUDCanvas.transform, false);

            ScoreMenu TempScoreMenu = m_ScoreBoard.GetComponentInChildren <ScoreMenu>();
            TempScoreMenu.SetupWindow(!m_Player.m_PlayerLogic.IsAlive() ? ScoreMenuType.SMT_Lose : ScoreMenuType.SMT_Win, m_Player.m_PlayerLogic.m_Score);

            DestroyGameObjects();
        }
        else if (m_ScoreBoard != null)
        {
            GameObject.Destroy(m_ScoreBoard);
        }
    }
Пример #7
0
    // Instantiate the character prefab at the spawn point
    public void SpawnCharacter()
    {
        _character = Instantiate(characterPrefab, spawnPoint, Quaternion.identity).gameObject;
        // Subscribe level reload to character die event
        _character.GetComponent <CharacterControl>().dieEvent.AddListener(GlobalGameManager.Pause);
        // Show game over menu when the character dies
        _character.GetComponent <CharacterControl>().dieEvent.AddListener(() => {
            ScoreMenu scoreMenu = FindObjectOfType <ScoreMenu>();
            if (scoreMenu != null)
            {
                scoreMenu.ShowMenu();
            }

            Achievements achievements = FindObjectOfType <Achievements>();
            if (achievements != null)
            {
                achievements.SaveAchievements();
            }
        });
    }
Пример #8
0
 void ScoreUpdate(float Total_Score)
 {
     ScoreMenu.Update_Score();
 }