public override void Start(RAIN.Core.AI ai) { //Change the FOV Color FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>(); FOV.status = FOV2DVisionCone.Status.Idle; base.Start(ai); }
// Use this for initialization void Start() { anim = GetComponentInChildren<Animator> (); _rigidBody = GetComponent<Rigidbody> (); eyes = GetComponentInChildren<FOV2DEyes>(); visionCone = GetComponentInChildren<FOV2DVisionCone>(); InvokeRepeating ("CheckVision", 0, 0.3f); //GameManager.getInstance().setPlayerPos(this.transform.position); soundManager = SoundManager.getInstance(); GameManager.getInstance ().SetPlayer (this.gameObject); }
public override void Start(RAIN.Core.AI ai) { //set the FOV to ALERTS FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>(); FOV.status = FOV2DVisionCone.Status.Alert; Vector3 playerPos = GameObject.FindGameObjectWithTag("Player").transform.position; ai.WorkingMemory.SetItem <Vector3>("destination", playerPos); base.Start(ai); }
// 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>(); }
public override void Start(RAIN.Core.AI ai) { Bang bang = GameObject.Instantiate(ai.WorkingMemory.GetItem("bang") as GameObject).GetComponent <Bang> (); float yOffset = ai.Body.GetComponent <CapsuleCollider>().bounds.size.y; yOffset += 1.2f; Vector3 copPosition = ai.Body.transform.position; bang.transform.position = new Vector3(copPosition.x, copPosition.y + yOffset, copPosition.z); bang.transform.SetParent(ai.Body.transform, true); //Change the FOV Color FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>(); FOV.status = FOV2DVisionCone.Status.Alert; base.Start(ai); }
void Start() { eyes = GetComponentInChildren<FOV2DEyes>(); visionCone = GetComponentInChildren<FOV2DVisionCone>(); }
void Start() { eyes = GetComponentInChildren <FOV2DEyes>(); visionCone = GetComponentInChildren <FOV2DVisionCone>(); }
void Start() { GameManager.getInstance ().addGuardListener (this); anim = GetComponent<Animator> (); agent = GetComponent<NavMeshAgent>(); eyes = GetComponentInChildren<FOV2DEyes>(); visionCone = GetComponentInChildren<FOV2DVisionCone>(); currentState = State.IDLE; // Disabling auto-braking allows for continuous movement // between points (ie, the agent doesn't slow down as it // approaches a destination point). agent.autoBraking = false; agent.Stop (); // Set the agent to go to the currently selected destination. agent.destination = point.position; InvokeRepeating ("CheckVision", 0, 0.3f); }