Пример #1
0
    private void CheckCollisions()
    {
        for (int i = 0; i < map.smallDots.Count; i++)
        {
            if (map.smallDots[i].gameObject.activeSelf && map.smallDots[i].CheckIsPickUped(player.transform))
            {
                points += map.smallDots[i].pointsValue;
                canvasManager.UpdateScore(points);
                CheckUpdateHighScore();
                map.smallDots[i].gameObject.SetActive(false);
                dotCount++;
                CheckSpawnCherry();
                CheckGhostLeaving();
                break;
            }
        }

        for (int i = 0; i < map.bigDots.Count; i++)
        {
            if (map.bigDots[i].gameObject.activeSelf && map.bigDots[i].CheckIsPickUped(player.transform))
            {
                points += map.bigDots[i].pointsValue;
                canvasManager.UpdateScore(points);
                CheckUpdateHighScore();
                map.bigDots[i].gameObject.SetActive(false);
                dotCount++;
                CheckSpawnCherry();
                SetPoweredPaxMan();
                CheckGhostLeaving();
                break;
            }
        }

        if (map.cherrys.gameObject.activeSelf && map.cherrys.CheckIsPickUped(player.transform))
        {
            points += map.cherrys.pointsValue;
            canvasManager.UpdateScore(points);
            CheckUpdateHighScore();
            canvasManager.ShowOneMoreCherry();
            map.DisableCherry();
        }
    }
Пример #2
0
 void Start()
 {
     Application.targetFrameRate = 60;
     map           = Map.instance;
     canvasManager = UI_CanvasManager.instance;
     SerializeSystem.LoadGame(scoreData);
     points = (uint)scoreData.currentScore;
     canvasManager.UpdateScore(points);
     canvasManager.UpdateHighScore((uint)scoreData.highScore);
     player     = FindObjectOfType <PaxMan>();
     blinky     = FindObjectOfType <Blinky>();
     ghosts     = FindObjectsOfType <Ghost>();
     gameOver   = false;
     initedGame = false;
     InitGame();
 }