// Start is called before the first frame update void Start() { UpdateHighScoresAndTimes(); highScore = PlayerPrefs.GetInt("HighScore"); highSurvivalTime = PlayerPrefs.GetInt("HighSurvivalTime"); uIManager = FindObjectOfType <UIManager>(); soundManager = FindObjectOfType <SoundManager>(); uIManager.UpdateLives(lives); uIManager.UpdateLevel(Level); uIManager.UpdateHighScoresAndTimes(); pacmanMove = FindObjectOfType <PacmanMove>(); AssignGhosts(); pellets.AddRange(GameObject.FindGameObjectsWithTag("Pellets")); initialpellets = pellets.Count; EveryoneStop(); StartCoroutine(ResetEveryone(2)); //StartCoroutine(StartGameCoroutine()); }
private void Awake() { astar = GetComponent <AStarAlgorithm>(); pacmanController = GameObject.FindGameObjectWithTag("Pacman").GetComponent <PacmanMove>(); pacmanTransform = GameObject.FindGameObjectWithTag("Pacman").transform; gameManager = FindObjectOfType <GameManager>(); movementMode = MovementMode.Waiting; blinkyTransform = GameObject.Find("Blinky").transform; animator = GetComponent <Animator>(); }
// Use this for initialization void Start() { _ghosts = ghosts; _playAgainButton = playAgainButton; _pacman = GameObject.Find("pacman").GetComponent<PacmanMove>(); _playAgainButton.gameObject.SetActive(false); _playAgainButton.onClick.AddListener(delegate { restartGame(); }); }
// Use this for initialization void Awake() { pacman = FindObjectOfType <PacmanMove>(); speed = pacman.speed; if (type == GhostType.Chaser) //store this so blue ghost can access it { chaseGhost = this; } start = transform.position; dest = start; atStart = true; Wait(delayAtStart); } //Awake
void Start() { currentLives = lifes; pacmanMove = GetComponent <PacmanMove>(); if (liveUI == null) { Debug.LogError("No LiveUi assigned" + name); Destroy(this); } else { liveUI.SetLives(lifes); } }
void Awake() { pacmanMover = FindObjectOfType <PacmanMove>(); } //Awake
void Start() { pacmanController = FindObjectOfType <PacmanMove>(); }