Inheritance: MonoBehaviour
Exemplo n.º 1
0
 void Start()
 {
     body   = GetComponent <Transform>();
     hash   = GameObject.FindGameObjectWithTag(tags.gameController).GetComponent <HashIDs>();
     player = GetComponent <PlayerMovement>();
     anim   = GetComponent <Animator>();
 }
Exemplo n.º 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;
    }
Exemplo n.º 3
0
 void Awake()
 {
     anim = GetComponent<Animator>();
     hash = GameObject.FindGameObjectWithTag(ScriptTags.gameController).GetComponent<HashIDs>();
     player = GameObject.FindGameObjectWithTag(ScriptTags.player);
     playerInventory = player.GetComponent<PlayerInventory>();
 }
Exemplo n.º 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>();
    }
Exemplo n.º 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;

        //
    }
Exemplo n.º 7
0
    void Awake()
    {
        volAdjust = StaticVariables.defaultVolume / 3;

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

    void Awake()
    {
        animator = GetComponent <Animator> ();
        hash     = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs> ();
        //设置Shouting动画层的权重为1
        animator.SetLayerWeight(1, 1f);
    }
Exemplo n.º 9
0
 void Awake()
 {
     //Henter komponentene
     anim = gameObject.GetComponent <Animator> ();
     hash = GameObject.Find("gameController").GetComponent <HashIDs> ();
     fase = GameObject.Find("gameController").GetComponent <FasebytteGraphics> ();
 }
Exemplo n.º 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");
    }
Exemplo n.º 11
0
 private void Awake()
 {
     rigidbody = GetComponent <Rigidbody>();
     anim      = GetComponent <Animator>();
     audio     = GetComponent <AudioSource>();
     hash      = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
 }
Exemplo n.º 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;
    }
Exemplo n.º 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);
                }

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

        anim.SetLayerWeight(1, 1f);
    }
Exemplo n.º 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> ();
 }
Exemplo n.º 16
0
 private void Awake()
 {
     anim            = GetComponent <Animator>();
     hash            = GameObject.FindWithTag(Tags.GameController).GetComponent <HashIDs>();
     player          = GameObject.FindWithTag(Tags.Player);
     playerInventory = player.GetComponent <PlayerInventory>();
 }
Exemplo n.º 17
0
 void Awake()
 {
     controller         = GameObject.FindGameObjectWithTag("GameController");
     hash               = controller.GetComponent <HashIDs>();
     animator           = GetComponent <Animator>();
     particleContainer  = transform.FindChild("ParticleSystem").gameObject;
     particleContainer2 = transform.FindChild("ParticleSystem2").gameObject;
 }
Exemplo n.º 18
0
 void Awake()
 {
     rigidbody = GetComponent<Rigidbody> ();
     audio = GetComponent<AudioSource> ();
     anim = GetComponent<Animator> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> ();
     anim.SetLayerWeight (1, 1f);
 }
Exemplo n.º 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>();
    }
Exemplo n.º 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>();
    }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 23
0
 void Awake()
 {
     anim = GetComponent<Animator> ();
     hash = GameObject.FindWithTag (Tags.GameController).GetComponent<HashIDs> ();
     player = GameObject.Find ("player");
     playerInventory = player.GetComponent<PlayerInventory> ();
     open = false;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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> ();
 }
Exemplo n.º 27
0
 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> ();
 }
Exemplo n.º 28
0
 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>();
 }
Exemplo n.º 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>();
 }
Exemplo n.º 30
0
 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>();
 }
Exemplo n.º 31
0
	void Awake()
    {
        anim = GetComponent<Animator>();
        animHashes = GetComponent<HashIDs>();
        playerStatistics = GetComponent<PlayerStatistics>();
        combatController = GameObject.Find("GameManager").GetComponent<CombatController>();
        anim.speed = animSpeed;
    }
Exemplo n.º 32
0
    protected override void Awake()
    {
        base.Awake();
        animator = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        attackDuration = 0.5f;
    }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
 }
Exemplo n.º 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;
    }
Exemplo n.º 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);
    }
Exemplo n.º 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>();
 }
Exemplo n.º 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);
    }
Exemplo n.º 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>();
 }
Exemplo n.º 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>();
 }
Exemplo n.º 42
0
 //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> ();
 }
Exemplo n.º 43
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);
    }
    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>();
    }
Exemplo n.º 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> ();
    }
Exemplo n.º 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);
    }
Exemplo n.º 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>();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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>();
 }
Exemplo n.º 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>();
 }
Exemplo n.º 51
0
    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;
    }
Exemplo n.º 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> ();
 }
Exemplo n.º 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);
    }
Exemplo n.º 54
0
 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;
 }
Exemplo n.º 55
0
    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;
    }
Exemplo n.º 56
0
	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;
	}
Exemplo n.º 57
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;
    }
Exemplo n.º 58
0
    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;
    }
Exemplo n.º 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;
    }
Exemplo n.º 60
0
    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;
    }