Example #1
0
        /** Use this for initialization */
        public void Start () {
            seeker = GetComponent<Seeker>();
            controller = GetComponent<CharacterController>();
            navmeshController = GetComponent<NavmeshController>();
		
            tr = transform;
            Repath ();
        }
Example #2
0
        /** Initializes reference variables.
	 * If you override this function you should in most cases call base.Awake () at the start of it.
	  * */
        protected virtual void Awake () {
            seeker = GetComponent<Seeker>();

            //This is a simple optimization, cache the transform component lookup
            tr = transform;

            //Cache some other components (not all are necessarily there)
            controller = GetComponent<CharacterController>();
            navController = GetComponent<NavmeshController>();
            rvoController = GetComponent<RVOController>();
            if ( rvoController != null ) rvoController.enableRotation = false;
            rigid = GetComponent<Rigidbody>();
        }