Inheritance: MonoBehaviour
Exemple #1
0
 void Start()
 {
     body   = GetComponent <Transform>();
     hash   = GameObject.FindGameObjectWithTag(tags.gameController).GetComponent <HashIDs>();
     player = GetComponent <PlayerMovement>();
     anim   = GetComponent <Animator>();
 }
Exemple #2
0
    void Awake()
    {
        // Setting up the references.
        charging = GetComponent <ChargingBehaviour>();
        social   = GetComponent <SocialBehaviour>();
        movement = GetComponent <MovementBehaviour>();

        player             = GameObject.FindGameObjectWithTag(GameTags.player);
        baseStation        = GameObject.FindGameObjectWithTag(GameTags.gameController).GetComponent <KonpanionNest>();
        col                = GetComponent <SphereCollider>();
        anim               = GetComponent <Animator>();
        playerAnim         = player.GetComponent <Animator>();
        hash               = GameObject.FindGameObjectWithTag(GameTags.gameController).GetComponent <HashIDs>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(GameTags.gameController).GetComponent <LastPlayerSighting>();

        checkReachTime = Time.time;
        objectsInReach = new Dictionary <int, Collider>();



        // Set the personal sighting and the previous sighting to the reset position.
        previousSightingTime = -10;
        navDestination       = Vector3.one;
        tickTimer            = 0;
    }
 void Awake()
 {
     anim = GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(ScriptTags.gameController).GetComponent<HashIDs>();
     player = GameObject.FindGameObjectWithTag(ScriptTags.player);
     playerInventory = player.GetComponent<PlayerInventory>();
 }
Exemple #4
0
 void Awake()
 {
     // Setting up the references.
     anim   = GetComponent <Animator>();
     hash   = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
     health = HEALTH;
 }
	void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        playerStatistics = player.gameObject.GetComponent<PlayerStatistics>();
        playerAnimator = player.gameObject.GetComponent<PlayerAnimator>();
        animHashes = player.GetComponent<HashIDs>();
    }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        // Cursor.visible = false;
        anim  = GetComponent <Animator>();
        hashs = GetComponent <HashIDs>();

        horseCollider  = GetComponent <BoxCollider>();
        horseRigidBody = GetComponent <Rigidbody>();

        ColliderCenter = horseCollider.center;

        pivots = GetComponentsInChildren <Pivots>(); //Pivots are Strategically Transform objects use to cast rays used by the horse

        scaleFactor = transform.localScale.y;        //TOTALLY SCALABE HORSE


        heightHorse = pivots[0].transform.localPosition.y * scaleFactor; // Height from Chest to ground

        anim.SetInteger("HorseType", (int)horseType);                    //Adjust the layer for the curret horse Type

        horseRigidBody.drag        = 0;
        horseRigidBody.angularDrag = 25f;
        sleepCount = 0;

        //
    }
Exemple #7
0
    void Awake()
    {
        volAdjust = StaticVariables.defaultVolume / 3;

        anim = GetComponent <Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.dataController).GetComponent <HashIDs>();
    }
Exemple #8
0
    private HashIDs hash;               //HashIDs脚本组件

    void Awake()
    {
        animator = GetComponent <Animator> ();
        hash     = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs> ();
        //设置Shouting动画层的权重为1
        animator.SetLayerWeight(1, 1f);
    }
Exemple #9
0
 void Awake()
 {
     //Henter komponentene
     anim = gameObject.GetComponent <Animator> ();
     hash = GameObject.Find("gameController").GetComponent <HashIDs> ();
     fase = GameObject.Find("gameController").GetComponent <FasebytteGraphics> ();
 }
Exemple #10
0
    // Initialize all variables
    private void Awake()
    {
        instance = this;

        dyingState        = Animator.StringToHash("Base Layer.Dying");
        deadBool          = Animator.StringToHash("Dead");
        jumpBool          = Animator.StringToHash("Jump");
        jumpDownState     = Animator.StringToHash("Base Layer.Jump Down");
        jumpState         = Animator.StringToHash("Base Layer.Jump");
        isGroundedBool    = Animator.StringToHash("IsGrounded");
        locomotionState   = Animator.StringToHash("Base Layer.Locomotion");
        speedFloat        = Animator.StringToHash("Speed");
        playerInSightBool = Animator.StringToHash("PlayerInSight");
        shotFloat         = Animator.StringToHash("Shot");
        aimWeightFloat    = Animator.StringToHash("AimWeight");
        angularSpeedFloat = Animator.StringToHash("AngularSpeed");
        openBool          = Animator.StringToHash("Open");
        throwBool         = Animator.StringToHash("Throw Attack");
        meleeBool         = Animator.StringToHash("Melee Attack");
        shootBool         = Animator.StringToHash("Shoot");
        hitBool           = Animator.StringToHash("Hit");
        pickUpBool        = Animator.StringToHash("PickUp");
        pickUpState       = Animator.StringToHash("Actions Layer.Picking Up");
        hitState          = Animator.StringToHash("Actions Layer.Hit Reaction");
        specialAttackBool = Animator.StringToHash("Special Attack");
    }
Exemple #11
0
 private void Awake()
 {
     rigidbody = GetComponent <Rigidbody>();
     anim      = GetComponent <Animator>();
     audio     = GetComponent <AudioSource>();
     hash      = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
 }
Exemple #12
0
    private AnimatorSetup animSetup;            // An instance of the AnimatorSetup helper class.


    void Awake()
    {
        // Setting up the references.
        //Congiguracion de las referencias.
        player     = GameObject.FindGameObjectWithTag(Tags.player).transform;
        enemySight = GetComponent <EnemySight>();
        nav        = GetComponent <NavMeshAgent>();
        anim       = GetComponent <Animator>();
        hash       = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();

        // Making sure the rotation is controlled by Mecanim.
        //Cerciorarse de que la rotacion es controlada por Mecanin y no por el navmeshagent.
        nav.updateRotation = false;

        // Creating an instance of the AnimatorSetup class and calling it's constructor.
        // Creando una instancia de la Clase AnimatorSetup y llamamos el constructor.
        animSetup = new AnimatorSetup(anim, hash);

        // Set the weights for the shooting and gun layers to 1.
        // Establecemos el peso de las capas Shooting y gun a 1.
        anim.SetLayerWeight(1, 1f);
        anim.SetLayerWeight(2, 1f);

        // We need to convert the angle for the deadzone from degrees to radians.
        // Necesitamos convertir el angulo de deadzone de grados a radianes, ya que el motor lo opera asi mas facil.
        deadZone *= Mathf.Deg2Rad;
    }
Exemple #13
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    //アニメーション開始 / 動作開始
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
        hash = GameObject.FindGameObjectWithTag(Tags.player).GetComponent<HashIDs>();
        animator.SetFloat(hash.speedFloat, 0f);

        if (stateInfo.fullPathHash!=hash.EmptyState)
        {

            if(stateInfo.fullPathHash==hash.NormalAttack1State||
                stateInfo.fullPathHash == hash.NormalAttack2State|| 
                stateInfo.fullPathHash == hash.NormalAttack3State)
            {
                PlayerAttack._instance.UseEnergy(SkillType.basic,PosType.basic);
            }
            else
            {
                if (stateInfo.fullPathHash == hash.Skill1State)
                {
                    PlayerAttack._instance.UseEnergy(SkillType.skill, PosType.one);
                }
                else if (stateInfo.fullPathHash == hash.Skill2State)
                {
                    PlayerAttack._instance.UseEnergy(SkillType.skill, PosType.two);
                }
                else if (stateInfo.fullPathHash == hash.Skill3State)
                {
                    PlayerAttack._instance.UseEnergy(SkillType.skill, PosType.three);
                }

            }
        }
    }
    private void Awake()
    {
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<HashIDs>();

        anim.SetLayerWeight(1, 1f);
    }
Exemple #15
0
 void Awake()
 {
     anim            = this.gameObject.GetComponent <Animator> ();
     hash            = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs> ();
     player          = GameObject.FindGameObjectWithTag(Tags.player);
     playerInventory = player.GetComponent <PlayerInventory> ();
 }
Exemple #16
0
 private void Awake()
 {
     anim            = GetComponent <Animator>();
     hash            = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs>();
     player          = GameObject.FindWithTag(Tags.Player);
     playerInventory = player.GetComponent <PlayerInventory>();
 }
 void Awake()
 {
     controller         = GameObject.FindGameObjectWithTag("GameController");
     hash               = controller.GetComponent <HashIDs>();
     animator           = GetComponent <Animator>();
     particleContainer  = transform.FindChild("ParticleSystem").gameObject;
     particleContainer2 = transform.FindChild("ParticleSystem2").gameObject;
 }
Exemple #18
0
 void Awake()
 {
     rigidbody = GetComponent<Rigidbody> ();
     audio = GetComponent<AudioSource> ();
     anim = GetComponent<Animator> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> ();
     anim.SetLayerWeight (1, 1f);
 }
Exemple #19
0
    private int count;                                  // The number of colliders present that should open the doors.


    void Awake()
    {
        // Setting up the references.
        anim            = GetComponent <Animator>();
        hash            = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
        player          = GameObject.FindGameObjectWithTag(Tags.player);
        playerInventory = player.GetComponent <PlayerInventory>();
    }
Exemple #20
0
    private PlayerInventory playerInventory; // Reference to the PlayerInventory script.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
        player = GameObject.FindGameObjectWithTag(Tags.player);
        playerInventory = player.GetComponent<PlayerInventory>();
    }
Exemple #21
0
 void Awake()
 {
     anim           = GetComponent <Animator>();
     playerMovement = GetComponent <playerControl>();
     hash           = GameObject.FindGameObjectWithTag("MainControl").GetComponent <HashIDs>();
     //sceneFadeOut = GameObject.FindGameObjectWithTag("fader").GetComponent<SceneFadeInOut>();
     lastPlayerSighting = GameObject.FindGameObjectWithTag("MainControl").GetComponent <EnemySight>().lastPlayerSighting;
 }
Exemple #22
0
 void Awake()
 {
     anim   = gameObject.GetComponent <Animator> ();
     hash   = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs> ();
     rd     = gameObject.GetComponent <Rigidbody> ();
     audioS = gameObject.GetComponent <AudioSource> ();
     anim.SetLayerWeight(1, 1f);
 }
 void Awake()
 {
     anim = GetComponent<Animator> ();
     hash = GameObject.FindWithTag (Tags.GameController).GetComponent<HashIDs> ();
     player = GameObject.Find ("player");
     playerInventory = player.GetComponent<PlayerInventory> ();
     open = false;
 }
Exemple #24
0
 // Use this for initialization
 void Awake()
 {
     player          = GameObject.FindGameObjectWithTag(Tags.player);
     anim            = GetComponent <Animator>();
     hash            = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
     maxIdleMoveTime = Random.Range(setMinIdleMoveTime, setMaxIdleMoveTime);
     myGravity       = -0.1f;
 }
 void Awake()
 {
     animator = GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
     oriPos = transform.position;
     isWalking = false;
     isRunning = false;
 }
Exemple #26
0
 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()
 {
     deathanim = GetComponent<Animator> ();
     playerMovement = GetComponent<PlayerMovement> ();;
     hash = GameObject.FindWithTag (Tags.GameController).GetComponent<HashIDs> ();
     screenFadeInOut = GameObject.FindWithTag (Tags.Fader).GetComponent<ScreenFadeInOut> ();
     lastPlayerSighting = GameObject.FindWithTag (Tags.GameController).GetComponent<LastPlayerSight> ();
 }
 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>();
 }
Exemple #29
0
 void Awake()
 {
     gameData = GameObject.FindGameObjectWithTag("GameController");
     agent = GetComponent<NavMeshAgent>();
     data = gameData.GetComponent<GameData>();
     hash = gameData.GetComponent<HashIDs>();
     lightLevels = GameObject.FindGameObjectWithTag("LightLevels").GetComponent<LightLevels>();
 }
 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()
    {
        anim = GetComponent<Animator>();
        animHashes = GetComponent<HashIDs>();
        playerStatistics = GetComponent<PlayerStatistics>();
        combatController = GameObject.Find("GameManager").GetComponent<CombatController>();
        anim.speed = animSpeed;
    }
    protected override void Awake()
    {
        base.Awake();
        animator = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        attackDuration = 0.5f;
    }
Exemple #33
0
 void Start ()
 {
     playerAnimator = GetComponent<Animator> ();
     controller = (CharacterController)GetComponent (typeof(CharacterController));
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> ();
     stats = this.gameObject.GetComponent<PlayerStats> ();
     mainCamera = Camera.main;
 }
Exemple #34
0
        internal UnityEngine.AI.NavMeshAgent nav;                 // Reference to the nav mesh agent.

        // Use this for initialization
        protected void Init()
        {
            // default activation for the ramp
            Ergo = new RampActivation(0, 10, 0, 0.1f, 1.1f, 1);
            anim = GetComponent <Animator> ();
            hash = GameObject.FindGameObjectWithTag(GameTags.gameController).GetComponent <HashIDs> ();
            nav  = GetComponent <UnityEngine.AI.NavMeshAgent>();
            tick = 0;
        }
Exemple #35
0
 void Awake()
 {
     animator = GetComponent<Animator> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent < HashIDs> ();
     bulletShooting = GameObject.FindGameObjectsWithTag("PlayerBullet");
     countdownController = GameObject.FindGameObjectWithTag (Tags.gameController);
     rigidbody = GetComponent<Rigidbody> ();
     animator.SetLayerWeight (1, 1f);
 }
Exemple #36
0
    void Awake()
    {
        anim = GetComponent<Animator>();
        player = GameObject.FindGameObjectWithTag("Player").transform;
        //playerHealth = player.gameObject.GetComponent<PlayerStatsV2>();
        hash = GameObject.FindGameObjectWithTag("GameController").GetComponent<HashIDs>();

        scaleDamage = maxDamage - minDamage;
    }
Exemple #37
0
    private HashIDs hash;                   // Reference to the HashIDs.//Referencia para el HashIDs.


    void Awake()
    {
        // Setting up the references.//Creacion de referencias
        anim = GetComponent <Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();

        // Set the weight of the shouting layer to 1.//Establece el peso de la capa Shouting(gritantdo) a 1 (recuerda que el primer 1 refiere al indice de capa).
        anim.SetLayerWeight(1, 1f);
    }
Exemple #38
0
 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>();
 }
Exemple #39
0
//	public float tolerance = .05f;
    void Start()
    {
//		if (target == null)
//			return;
        Animator animator = GetComponent <Animator> ();
        HashIDs  hash     = GameObject.FindGameObjectWithTag("GameController").GetComponent <HashIDs>();

        animator.SetFloat(hash.speedFloat, 1f);
    }
Exemple #40
0
 void Awake()
 {
     moving         = false;
     mainController = GameObject.FindGameObjectWithTag(Tags.mainController).GetComponent <MainController>();
     bombsOnMap     = 0;
     bombsLimit     = 1;
     animator       = bombermanBoy.GetComponent <Animator>();
     hashIds        = GameObject.FindGameObjectWithTag(Tags.mainController).GetComponent <HashIDs>();
 }
Exemple #41
0
 void Awake()
 {
     player            = GameObject.FindGameObjectWithTag(Tags.player);
     playerAnim        = player.GetComponent <Animator>();
     hash              = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
     camMovement       = Camera.main.gameObject.GetComponent <CameraMovement>();
     sceneFadeInOut    = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <SceneFadeInOut>();
     liftDoorsTracking = GetComponent <LiftDoorsTracking>();
 }
 //Fyller referanse variablene med inn hold ved oppstart
 void Awake()
 {
     //HEnter komponetntet anmator i objektet skriptet er koblet til
     anim = GetComponent <Animator> ();
     //Finner spillobjektet gameCotroller og dens komponent HashIDs hvor HashID skriptet befinner seg
     hash = GameObject.Find("gameController").GetComponent <HashIDs> ();
     //Finner spillobjektet gameController for skripetet FasebytteGraphics er koblet til
     fasebytteGraphics = GameObject.Find("gameController").GetComponent <FasebytteGraphics> ();
 }
    void Awake()
    {
        // Setting up the references.
        anim = GetComponent <Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();

        // Set the weight of the shouting layer to 1.
        anim.SetLayerWeight(1, 1f);
    }
    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>();
    }
Exemple #45
0
    //public LastPlayerSighting lastPlayerSighting;


    void Awake()
    {
        anim = GetComponent <Animator> ();
        //enemyMovement = GameObject.FindGameObjectWithTag (Tags.enemyParent).GetComponent <EnemyAI> ();
        //enemySight = GameObject.FindGameObjectWithTag (Tags.enemyParent).GetComponent <EnemySight> ();
        //enemyShooting = GameObject.FindGameObjectWithTag (Tags.enemyParent).GetComponent <EnemyShooting> ();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs> ();
        //lastPlayerSighting = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<LastPlayerSighting> ();
    }
Exemple #46
0
    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        // Set the weight of the shouting layer to 1.
        anim.SetLayerWeight(1, 1f);
    }
Exemple #47
0
 void Awake()
 {
     lifeTracker     = GameObject.FindGameObjectWithTag(Tags.guiController).GetComponent <LifeTracker>();
     respawnPosition = GameObject.FindGameObjectWithTag(Tags.player).transform.position;
     respawnRotation = GameObject.FindGameObjectWithTag(Tags.player).transform.rotation;
     hash            = GameObject.FindGameObjectWithTag(Tags.dataController).GetComponent <HashIDs>();
     gameOver        = GameObject.FindGameObjectWithTag(Tags.guiController).GetComponent <GameOverGUI>();
     spawner         = GameObject.FindGameObjectWithTag(Tags.dataController).GetComponent <AsteroidSpawner>();
 }
Exemple #48
0
 void Awake()
 {
     animator            = GetComponent <Animator> ();
     hash                = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs> ();
     bulletShooting      = GameObject.FindGameObjectsWithTag("PlayerBullet");
     countdownController = GameObject.FindGameObjectWithTag(Tags.gameController);
     rigidbody           = GetComponent <Rigidbody> ();
     animator.SetLayerWeight(1, 1f);
 }
Exemple #49
0
 void Awake()
 {
     player = GameObject.FindGameObjectWithTag(ScriptTags.player);
     playerAnim = player.GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(ScriptTags.gameController).GetComponent<HashIDs>();
     camMovement = Camera.main.gameObject.GetComponent<CameraMovement>();
     sceneFadeInOut = GameObject.FindGameObjectWithTag(ScriptTags.fader).GetComponent<SceneFadeInOut>();
     liftDoorsTracking = GetComponent<liftDoorsTracking>();
 }
Exemple #50
0
 // Use this for initialization
 void Awake()
 {
     gameData = GameObject.FindGameObjectWithTag("GameController");
     animator = GetComponent<Animator>();
     data = gameData.GetComponent<GameData>();
     hash = gameData.GetComponent<HashIDs>();
     inventory = gameData.GetComponent<Inventory>();
     music = GameObject.FindGameObjectWithTag("Music").GetComponent<MusicManager>();
 }
    protected override void Awake()
    {
        base.Awake();
        ai = GetComponent<MonsterAI>();
        animator = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        meshTransform = transform.Find("Armature");
        attackDuration = 0.2f + teleportDuration * 2;
    }
Exemple #52
0
 void Awake()
 {
     // Setting up the references.
     animator = GetComponent<Animator>();
     playerMovement = GetComponent<PlayerMovement>();
     hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
     enemy = GameObject.FindGameObjectWithTag (Tags.enemy);
     secondPlayerCamera = GameObject.FindGameObjectWithTag (Tags.secondPlayerCamera);
     enemySight = enemy.GetComponent<EnemySight> ();
 }
Exemple #53
0
    void Awake()
    {
        sheathSwordWaitTime = 0.5f;
        moveController = GetComponent<MoveController> ();
        anim = GetComponent<Animator> ();
        engagedIntoBattle = false;
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
        rb = GetComponent<Rigidbody2D> ();

        anim.SetBool (hash.sword, true);
    }
 void Awake()
 {
     combatController = GameObject.Find("GameManager").GetComponent<CombatController>();
     anim = GetComponent<Animator>();
     col = GetComponent<CapsuleCollider>();
     enemyInference = GetComponent<EnemyInference>();
     enemyStatistics = GetComponent<EnemyStatistics>();
     animHashes = GetComponent<HashIDs>();
     spawnPosition = transform.position;
     atSpawn = true;
 }
    void Awake()
    {
        nav = GetComponent<NavMeshAgent>();
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        nav.updateRotation = false;
        animSetup = new AnimatorSetup(anim, hash);
        anim.SetLayerWeight(1, 1f);
        anim.SetLayerWeight(2, 1f);
        deadZone *= Mathf.Deg2Rad;
    }
	void Awake () {
		anim = GetComponent<Animator>();

		hash = GameObject.FindWithTag (Tags.gameController).GetComponent<HashIDs>();

		player = GameObject.FindWithTag (Tags.player);

		playerInventory = player.GetComponent<PlayerInventory>();

		audioSource = GetComponent<AudioSource>();

		count = 0;
	}
    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()
    {
        player = GameObject.FindGameObjectWithTag(Tags.player).transform;
        enemySight = GetComponent<EnemySight>();
        navMeshAgent = GetComponent<NavMeshAgent>();
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        navMeshAgent.updateRotation =false;
        animSetup = new AnimatorSetup(anim, hash);

        deadZone *= Mathf.Deg2Rad;
    }
Exemple #59
0
    private void Awake()
    {
        nav = GetComponent<NavMeshAgent>();
        col = GetComponent<SphereCollider>();
        anim = GetComponent<Animator>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<LastPlayerSighting>();
        player = GameObject.FindGameObjectWithTag(Tags.player);
        playerAnim = player.GetComponent<Animator>();
        playerHealth = player.GetComponent<PlayerHealth>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<HashIDs>();

        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;
    }