// Use this for initialization void Start() { // initially true sleeping = true; anim = GetComponent<Animator>(); personSight = GetComponent<PersonSight>(); }
// initialize variables with awake function void Awake() { touchObject = this.transform.FindChild("SenseTouch").gameObject; suspicion = GetComponent<Suspicion>(); personSight = GetComponent<PersonSight>(); woken = touchObject.GetComponent<Woken>(); nav = GetComponent<NavMeshAgent>(); InitialiseSantaTransform(); gameController = GetComponent<GameController>(); }
// Use this for initialization void Awake() { suspicion = GetComponent<Suspicion>(); personSight = GetComponent<PersonSight>(); nav = GetComponent<NavMeshAgent>(); santa = GameObject.FindGameObjectWithTag("Player").transform; startingPosition = transform.position; touchObject = this.transform.FindChild("SenseTouch").gameObject; woken = touchObject.GetComponent<Woken>(); }
// Use this for initialization void Awake() { // Setting up the reference sittingScript = GetComponent<SittingScript>(); personSight = GetComponent<PersonSight>(); suspicion = GetComponent<Suspicion>(); nav = GetComponent<NavMeshAgent>(); santa = GameObject.FindGameObjectWithTag("Player").transform; originalFOV = personSight.fieldOfViewAngle; touchObject = this.transform.FindChild("SenseTouch").gameObject; woken = touchObject.GetComponent<Woken>(); }
IEnumerator Start() { //InvokeRepeating("CastRays", 0, updateRate); personSight = GetComponent<PersonSight>(); collider = GetComponent<SphereCollider>(); yOffset = personSight.GetRayPos1(); // Collide with everything except layer 2 layerMask = 1 << 2; // invert layerMask = ~layerMask; yield return StartCoroutine("WaitAndPrint"); }
// Use this for initialization void Awake() { // Setting up the reference sleepingScript = GetComponent<SleepingScript>(); personSight = GetComponent<PersonSight>(); suspicion = GetComponent<Suspicion>(); nav = GetComponent<NavMeshAgent>(); santa = GameObject.FindGameObjectWithTag("Player").transform; fovEyesScript = GetComponent<FOV2DEyes>(); fovConeScript = GetComponent<FOV2DVisionCone>(); touchObject = this.transform.FindChild("SenseTouch").gameObject; woken = touchObject.GetComponent<Woken>(); }
void Awake() { InitialiseSantaTransform(); personSight = GetComponent<PersonSight>(); suspicion = GetComponent<Suspicion>(); nav = GetComponent<NavMeshAgent>(); anim = GetComponent<Animator>(); touchObject = this.transform.FindChild("SenseTouch").gameObject; woken = touchObject.GetComponent<Woken>(); // Must make sure rotation of person is by the animator and not by the nav mesh agent nav.updateRotation = false; animSetup = new AnimatorSetup(anim); // Convert deadZone variable from degrees to radians deadZone *= Mathf.Deg2Rad; }