void Start () { touchMovement = GetComponent<TouchMovement> (); coinController = GetComponent<CoinController> (); stealth = GetComponent<StealthMode> (); playerEnabled = true; camFollow = GameObject.Find ("Player Camera").GetComponent<CameraFollow> (); }
// Use this for initialization, run in child class's Start method protected void Setup () { myCollider = GetComponent<Collider2D> (); player = GetComponent<PlayerController> (); visual = GetComponentInChildren<SpriteRenderer> (); touchMoveObject = GetComponent<TouchMoveObject> (); ring = visual.gameObject.transform.FindChild ("ring").GetComponent<SpriteRenderer>(); stealthMode = GetComponent<StealthMode> (); player.SetClass (className); touchMovement = GetComponent<TouchMovement> (); }
/// <summary> /// Gains access to external scripts. /// </summary> void Start () { player = this.gameObject; GameObject camObj = GameObject.Find ("Player Camera"); cam = camObj.GetComponent<Camera> (); //gain reference to scripts for assigning to. playerController = GetComponent<PlayerController> (); touchMovement = GetComponent<TouchMovement> (); stealthMode = GetComponent<StealthMode> (); }