void Start() { source = GetComponent <AudioSource>(); startPosition = transform.position; pacman = GameObject.Find("Pacman3D").GetComponent <Pacman3DScript>(); agent = GetComponent <NavMeshAgent>(); directions[0] = Vector3.forward; directions[1] = Vector3.right; directions[2] = Vector3.back; directions[3] = Vector3.left; material = GetComponent <Renderer>().material; original = material.color; StartCoroutine(StartCam()); }
void Start() { PlayerPrefs.SetInt("points", 0); pacman = GameObject.Find("Pacman3D").GetComponent <Pacman3DScript>(); ghosts[0] = GameObject.Find("GreenGhost").GetComponent <NavMeshGhost3DScript>(); ghosts[1] = GameObject.Find("PinkGhost").GetComponent <NavMeshGhost3DScript>(); ghosts[2] = GameObject.Find("RedGhost").GetComponent <NavMeshGhost3DScript>(); ghosts[3] = GameObject.Find("YellowGhost").GetComponent <NavMeshGhost3DScript>(); food = GameObject.Find("Food3D"); audioSource = GetComponent <AudioSource>(); volumeOn.gameObject.SetActive(true); volumeOff.gameObject.SetActive(false); volumeOn.enabled = true; volumeOff.enabled = false; StartCoroutine(StartCam()); audioSource.volume = 0.3f; }