void Awake() { anim = GetComponent <Animator>(); playerMovement = GetComponent <PlayerMovement>(); hash = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs>(); sceneFadeInOut = GameObject.FindWithTag(Tags.Fader).GetComponent <SceneFadeInOut>(); lastPlayerSighting = GameObject.FindWithTag(Tags.GameController).GetComponent <LastPlayerSighting>(); }
void Awake() { menu = GameObject.FindGameObjectWithTag(Tags.menu).GetComponent <MenuHandeler> (); anim = GetComponent <Animator> (); sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut> (); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting> (); }
private LastPlayerSighting lastPlayerSighting; // Reference to the global last sighting of the player.//Referencia el ultimo avistamiento global del jugador. void Awake() { // Setting up the references. //Configura las referencias player = GameObject.FindGameObjectWithTag(Tags.player); //obtiene la referencia del script LastPlayerSighting de gamecontroller a traves del script tags. lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
void Awake() { enemySight = GetComponent <EnemySight>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player).transform; playerHealth = player.GetComponent <PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
void Awake() { anim = GetComponent<Animator>(); playerMovement = GetComponent<PlayerMovement>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIds>(); fade = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent<ScreenFadeInOut>(); lastSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); }
private void Awake() { enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player).transform; playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<LastPlayerSighting>(); }
void Awake() { anim = GetComponent<Animator> (); playerMovement = GetComponent<PlayerMovement> (); hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> (); sceneFadeInOut = GameObject.FindGameObjectWithTag (Tags.canvas).GetComponent<SceneFadeInOut> (); lastPlayerSighting = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<LastPlayerSighting> (); }
void Awake() { // Setting up the references. anim = GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent<SceneFadeInOut>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); }
void Awake() { rendererComponent = GetComponent <Renderer>(); // Setting up references. player = GameObject.FindGameObjectWithTag(Tags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); playerHealth = GameObject.FindGameObjectWithTag(Tags.player).GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); }
private int wayPointIndex; // A counter for the way point array. void Awake() { // Setting up the references. enemySight = GetComponent <EnemySight>(); nav = GetComponent <NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player).transform; playerHealth = player.GetComponent <PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
private void Awake() { audio = GetComponent <AudioSource>(); anim = GetComponent <Animator>(); playerMoveMent = GetComponent <PlayerMovement>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>(); screenFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <ScreenFadeInOut>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
void Awake () { lastPlayerSighting = GameObject.FindGameObjectWithTag("gameController").GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); dirtPos = transform.GetChild (0); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Start() { lastPlayerSinhting = GameObject.FindWithTag("GameController"). GetComponent <LastPlayerSighting> (); playerHeath = 100f; personalAlarmPosition = lastPlayerSinhting.normalPosition; previousAlarmPosition = lastPlayerSinhting.normalPosition; distanceOfView = sph.radius; }
private bool playerDead; // A bool to show if the player is dead or not. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); playerMovement = GetComponent <PlayerMovement>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
// Use this for initialization void Awake () { nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); globalLastPlayerSighting = GameObject.FindGameObjectWithTag("GM").GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); personalLastSighting = globalLastPlayerSighting.resetPosition; globalPrevSighting = globalLastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); positionReset = this.transform.position; }
private LastPlayerSighting lPC; //used to get last player's sighting and reset valuable void Start () { lPC = GameObject.FindGameObjectWithTag ("gameController").GetComponent<LastPlayerSighting> (); //prepares patrol state currentT = lPC.position; startPos = lPC.resetPosition; //look towards target on start //transform.LookAt(currentT);//start off looking at the first point rigBod = GetComponent<Rigidbody>();//init rigitbody }
void Awake() { nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); player = GameObject.FindGameObjectWithTag("Player"); audio = GetComponent<AudioSource>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Start() { lastPlayerSighting = GameObject.FindWithTag(Tags.GameController).GetComponent <LastPlayerSighting>(); playerHealth = GameObject.FindWithTag(Tags.Player).GetComponent <PlayerHealth>(); //小机器人的私有警报位置 personalAlarmPosition = lastPlayerSighting.normalPosition; PreviousAlarmPosition = lastPlayerSighting.normalPosition; //得到视线距离,即为球形触发器的半径 distanceOfView = sph.radius; }
private int wayPointIndex; // A counter for the way point array. #endregion Fields #region Methods void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); enemyAnimation = GetComponent<EnemyAnimation>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.Find("N40").transform; playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.Find("gameController").GetComponent<LastPlayerSighting>(); }
private int wayPointIndex; // A counter for the way point array. #endregion Fields #region Methods void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); navMeshAgent = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player).transform; playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); bulletShooting = GameObject.FindGameObjectsWithTag("EnemyBullet"); }
void Awake() { // Setting up the references. enemySight = GetComponent <EnemySight>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); playerHealth = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); //patrolBeam.GetComponent<Light>().color = Color.green; patrolLight.GetComponent <MeshRenderer>().material.SetColor("_EmissionColor", Color.green); }
void Awake() { enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent<PlayerHealth>(); playerMovement = player.GetComponent<Char_Movement>(); anim = animObj.GetComponent<Animator>(); audio = GetComponent<AudioSource>(); enemAttack = transform.Find("SmackZone").gameObject.GetComponent<EnemyAttack>(); }
public void Awake() { // Setting up the references. enemySight = GetComponent <EnemySight>(); nav = GetComponent <NavMeshAgent>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>(); enemyDead = false; aiManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <AIManager>(); }
void Awake() { enemySight = GetComponent <EnemySight>(); // nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <HP>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <LastPlayerSighting>(); patrolWayPoints = GameObject.FindGameObjectsWithTag("PatrolWaypoint"); ak = ak47.GetComponent <Ak47Controller>(); anim = enemy.GetComponent <Animator>(); }
private void Awake() { // Setting up the references. _player = GameObject.FindGameObjectWithTag("Player").transform; _playerScore = _player.GetComponent<PlayerScore>(); _animator = GetComponent<Animator>(); _playerHealth = _player.GetComponent<PlayerHealth>(); enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); }
private LastPlayerSighting lPC; //used to get last player's sighting and reset valuable void Start() { lPC = GameObject.FindGameObjectWithTag("gameController").GetComponent <LastPlayerSighting> (); //prepares patrol state currentT = lPC.position; startPos = lPC.resetPosition; //look towards target on start //transform.LookAt(currentT);//start off looking at the first point rigBod = GetComponent <Rigidbody>(); //init rigitbody }
private void Awake() { // Setting up the references. _player = GameObject.FindGameObjectWithTag("Player").transform; _playerScore = _player.GetComponent <PlayerScore>(); _animator = GetComponent <Animator>(); _playerHealth = _player.GetComponent <PlayerHealth>(); enemySight = GetComponent <EnemySight>(); nav = GetComponent <NavMeshAgent>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); }
void Awake() { // Setting up the references. player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent<PlayerHealth>(); enemyHealth = GetComponent<EnemyHealth>(); anim = GetComponent<Animator>(); enemySight = GetComponent<EnemySight>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); playerInRange = false; }
void Awake() { nav = GetComponent <NavMeshAgent>(); col = GetComponent <SphereCollider>(); player = GameObject.FindGameObjectWithTag("Player"); audio = GetComponent <AudioSource>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <LastPlayerSighting>(); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
private int wayPointIndex; // A counter for the way point array. #endregion Fields #region Methods void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent<PlayerHealth>(); enemyHealth = GetComponent<EnemyHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); wayPointIndex = 0; onHpRegen = false; }
void Awake () { //col = GetComponent<SphereCollider>(); if(!col) col = gameObject.transform.Find("eyesight collider").gameObject.GetComponent<SphereCollider>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("gameController").GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { navMeshAgent = GetComponent<NavMeshAgent>(); sphereCollider = GetComponent<SphereCollider>(); animator = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(Tags.player); playerAnim = player.GetComponent<Animator>(); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. settings = GameObject.Find("System"); player = settings.GetComponent<SystemDB>().player; playerObject = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerObject>(); playerMovement = GetComponent<PlayerMovement>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>(); health=player.maxHP; player.HP = health; }
private int wayPointIndex; // A counter for the way point array. #endregion Fields #region Methods void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); nav = GetComponent<NavMeshAgent>(); player = player.transform; playerHealth = player.GetComponent<TankLife>(); lastPlayerSighting = GetComponent<LastPlayerSighting> (); enemyHealth = GetComponent<TankLife> (); //canonDirection = GetComponent<rotateEnemyCanon> (); //lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); //? }
void Awake() { base.Init(); col = GetComponent <SphereCollider> (); core = GetComponent <RobotInterfaceUnity> (); lastPlayerSighting = GameObject.FindGameObjectWithTag(GameTags.gameController).GetComponent <LastPlayerSighting>(); if (core != null) { patrolWayPoints = core.patrolWayPoints; } }
void Awake() { enemySight = GetComponent <EnemySight>(); nav = GetComponent <NavMeshAgent>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PlayerHealth>(); playerMovement = player.GetComponent <Char_Movement>(); anim = animObj.GetComponent <Animator>(); audio = GetComponent <AudioSource>(); enemAttack = transform.Find("SmackZone").gameObject.GetComponent <EnemyAttack>(); }
// Use this for initialization void Awake() { anim = GetComponent<Animator>(); alerted = false; health = 10; wayPoint = 0; patrolTimer = 0; EnemySight = GetComponent<enemySight> (); navAgent = GetComponent<NavMeshAgent> (); player = GameObject.FindGameObjectWithTag ("Player").transform; lastPlayerSighting = GameObject.FindGameObjectWithTag ("GameController").GetComponent<LastPlayerSighting> (); }
void Awake() { enemySight = GetComponent <EnemySight> (); nav = GetComponent <NavMeshAgent> (); Player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = Player.GetComponent <PlayerHealth> (); GameObject controller = GameObject.FindGameObjectWithTag("GameController"); LastPlayerSighting sighting = controller.GetComponent <LastPlayerSighting> (); lastPlayerSighting = sighting; }
void Start() { lastCheckpoint = new Vector3(0, 0, 0); player = GameObject.FindGameObjectWithTag("Player"); playerScript = player.GetComponent<Player>(); aiManager = GetComponent<LastPlayerSighting>(); timeOfDeath = 0; fadeState = FADE_STATE.FADE_IN; fadeScreen = fadeGameObject.GetComponent<Image>(); fadeScreen.color = new Color(fadeScreen.color.r, fadeScreen.color.g, fadeScreen.color.b, 1.0f); fadeOutTime = waitTimeAfterDeath; }
void Awake() { //col = GetComponent<SphereCollider>(); if (!col) { col = gameObject.transform.Find("eyesight collider").gameObject.GetComponent <SphereCollider>(); } lastPlayerSighting = GameObject.FindGameObjectWithTag("gameController").GetComponent <LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
private Vector3 previousSighting; // Where the player was sighted last frame. #endregion Fields #region Methods void Awake() { // Setting up the references. anim = GetComponent<Animator>(); enemyAnimation = GetComponent<EnemyAnimation>(); lastPlayerSighting = GameObject.Find("gameController").GetComponent<LastPlayerSighting>(); player = GameObject.Find("N40"); playerHealth = player.GetComponent<PlayerHealth>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. enemySight = GetComponent<EnemySight>(); //enemy = GameObject.FindGameObjectWithTag("enemy"); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag("Player").transform; //playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); myAnimator = GetComponent<Animator>(); Detected = false; running = false; }
private Vector3 previousSighting; //上一帧player对象被观察到的位置 private void Awake() { nav = GetComponent <NavMeshAgent> (); col = GetComponent <SphereCollider> (); anim = GetComponent <Animator> (); lastPlayerSighting = GameObject.FindWithTag(Tags.GameController).GetComponent <LastPlayerSighting> (); player = GameObject.FindWithTag(Tags.Player); playerAnim = player.GetComponent <Animator> (); playerHealth = player.GetComponent <PlayerHealth> (); hash = GameObject.FindWithTag(Tags.GameController).GetComponent <HashID> (); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
private LastPlayerSighting lastPlayerSighting; //reference to the LastPlayerSighting script void Awake() { nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); anim = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("gameController").GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); playerAnim = player.GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag("gameController").GetComponent<HashIDs>(); personalLastSighting = lastPlayerSighting.resetPosition; //reset positions, so that the enems does not start with chasing the player previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. anim = GetComponent<Animator>(); playerMovement = GetComponent<PlayerMovement>(); flash = GameObject.Find ("Main Camera").GetComponent<GlowEffect> (); GameObject tmp = GameObject.Find ("EndLevel"); if (tmp != null) endLevel = tmp.GetComponent<EndLevel>(); GameObject gameController = GameObject.Find ("gameController"); if (gameController != null) lastPlayerSighting = gameController.GetComponent<LastPlayerSighting>(); }
void Awake() { nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); anim = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(Tags.player); playerAnim = player.GetComponent<Animator>(); playerHealth = player.GetComponent<PlayerHealth>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIds>(); personalLastSighting = pastSighting = lastPlayerSighting.resetPosition; }
void Awake() { nav = GetComponent <NavMeshAgent> (); col = GetComponent <SphereCollider> (); anim = GetComponent <Animator> (); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting> (); player = GameObject.FindGameObjectWithTag(Tags.player); playerAnim = player.GetComponent <Animator> (); playerHealth = player.GetComponent <PlayerHealth> (); thirdPersonCharacter = player.GetComponent <ThirdPersonCharacter> (); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Start() { // Setting up the references. player = GameObject.FindGameObjectWithTag(Tags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); joint = transform.parent.parent; initialRotation = joint.rotation; // Play the gun shot clip at the position of the muzzle flare. AudioManager.instance.PlaySound(joint.GetComponent<AudioSource>(), servoSound, 0.1f, 50f, true); InvokeRepeating("CheckSoundOcclusion", 1f, 1f); }
void Start() { // Setting up the references. player = GameObject.FindGameObjectWithTag(Tags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); joint = transform.parent.parent; initialRotation = joint.rotation; // Play the gun shot clip at the position of the muzzle flare. AudioManager.instance.PlaySound(joint.GetComponent <AudioSource>(), servoSound, 0.1f, 50f, true); InvokeRepeating("CheckSoundOcclusion", 1f, 1f); }
void Awake() { nav = GetComponent <NavMeshAgent> (); col = GetComponentInChildren <SphereCollider> (); GameObject controller = GameObject.FindGameObjectWithTag("GameController"); LastPlayerSighting sighting = controller.GetComponent <LastPlayerSighting> (); lastPlayerSighting = sighting; player = GameObject.FindGameObjectWithTag("Player"); personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); anim = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(Tags.player); playerHealth = player.GetComponent<PlayerHealth>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>(); // Set the personal sighting and the previous sighting to the reset position. lastPlayerPosition = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); col = GetComponent <SphereCollider>(); anim = GetComponent <Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(Tags.player); playerHealth = player.GetComponent <PlayerHealth>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>(); // Set the personal sighting and the previous sighting to the reset position. lastPlayerPosition = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. nav = GetComponent <NavMeshAgent>(); col = GetComponent <SphereCollider>(); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <LastPlayerSighting>(); player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <HP>(); anim = enemy.GetComponent <Animator>(); //hash = GameObject.FindGameObjectWithTag("GameController").GetComponent<HashIDs>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
void Awake() { // Setting up the references. enemySight = Nozzle.TraverseHierarchy(transform, "Head").GetComponent <EnemySight>(); enemyGrab = GetComponent <EnemyGrab>(); nav = GetComponent <NavMeshAgent>(); if (GameObject.FindWithTag(Tags.player) != null) { player = GameObject.FindWithTag(Tags.player).transform; } //playerHealth = player.GetComponent<PlayerHealth>(); lastPlayerSighting = GameObject.FindWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); initialRotation = transform.rotation; }
private Vector3 previousSighting; // Where the player was sighted last frame. #endregion Fields #region Methods void Awake() { // Setting up the references. nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); lastPlayerSighting = GetComponent<LastPlayerSighting>(); playerHealth = player.GetComponent<TankLife>(); enemyHealth = GetComponent<TankLife> (); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; doubleRadius = col.radius * 2f; }
void Start() { debug = overrideDebugValue; setDiffStats(); eco = GameObject.Find(ecosystem); lPC = GameObject.FindGameObjectWithTag("gameController").GetComponent <LastPlayerSighting> (); //look towards target on start //transform.LookAt(currentTarget);//start off looking at the first point rigBod = GetComponent <Rigidbody>(); //init rigitbody eco.GetComponent <EcoPoints>().Add(gameObject); if (debug) { state = "debug"; } blood.Emit(25); }
void Awake() { levelGeneration = this.GetComponent <LevelGeneration>(); // meshSurface = this.GetComponent<NavMeshSurface>(); // Setting up the references. anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); // Set the weight of the shouting layer to 1. anim.SetLayerWeight(1, 1f); doorExit = GameObject.Find("door_exit_outer"); // pathObject.GetComponent <meshBuilder>().enabled = true; }
void Awake() { // Setting up the references. nav = GetComponent <NavMeshAgent>(); col = GetComponent <SphereCollider>(); //anim = GetComponent<Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <LastPlayerSighting>(); if (GameObject.FindWithTag(Tags.player) != null) { player = GameObject.FindWithTag(Tags.player); } //playerAnim = player.GetComponent<Animator>(); //playerHealth = player.GetComponent<PlayerHealth>(); //hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }