private void Awake() { _input = GetComponent <InputReader>(); _mover = new PlayerRBMover(this); _playerRotator = new PlayerRotator(this); _animationController = new PlayerAnimationController(this); _startPos = transform.position; _playerAgent = GetComponent <NavMeshAgent>(); }
// Use this for initialization void Start() { PlayerRBMover playa = Component.FindObjectOfType <PlayerRBMover>(); thoughts = playa.transform.Find("Main Camera").Find("thoughts").GetComponent <AudioSource>(); music = playa.transform.Find("Main Camera").Find("music").GetComponent <AudioSource>(); feet = playa.transform.Find("Main Camera").Find("feet").GetComponent <AudioSource>(); //keep me DontDestroyOnLoad(transform.gameObject); }
// Use this for initialization void Start() { Debug.Log("initializing"); PlayerRBMover playa = Component.FindObjectOfType <PlayerRBMover>(); playa.transform.position = GameObject.FindGameObjectWithTag("spawn").transform.position; playa.SetTerrain(); GameObject[] cleanup = GameObject.FindGameObjectsWithTag("cleanMe"); foreach (GameObject g in cleanup) { Destroy(g); } if (playMusic) { //GameObject.FindObjectOfType<AudioManager>().AdvanceTrack(false); } }
void Start() { am = GameObject.FindObjectOfType <AudioManager>(); rb = transform.parent.GetComponent <Rigidbody>(); player = GameObject.FindObjectOfType <PlayerRBMover>(); }
void Start() { am = GameObject.FindObjectOfType <AudioManager>(); player = GameObject.FindObjectOfType <PlayerRBMover>(); }