Пример #1
0
        void Start()
        {
            //Set the basic stats. Also attach the appropriate scripts. These can be changed in the inspector for individual enemies
            patrol    = true;
            canAttack = true;

            joltAmount = 5f;

            PatrolScript = GetComponent <Enemy4DirectionPatrol>();
            ChaseScript  = GetComponent <EnemyChase>();
            Attack       = GetComponent <AttackScript>();

            currentDamage    = damage;
            currentHealth    = maxHealth;
            currentMoveSpeed = defaultMoveSpeed;

            CharRigidBody = GetComponent <Rigidbody2D>();

            enemyCollider = GetComponent <Collider2D>();

            canBeJolted = true;

            //Player stuff
            Player      = GameObject.Find("Player");
            PM          = Player.GetComponent <Player_Manager>();
            PlayerAudio = PM.PlayerExternalAudio;
        }
Пример #2
0
 void Start()
 {
     //Set the basic stats. Also attach the appropriate scripts. These can be changed in the inspector for individual enemies
     BossAudios       = GetComponents <AudioSource>();
     StepNoise        = BossAudios[0];
     StepNoise.clip   = StepSound;
     ChargeNoise      = BossAudios[1];
     ChargeNoise.clip = ChargingSound;
     AttackNoise      = BossAudios[2];
     AttackNoise.clip = AttackSound;
     HitNoise         = BossAudios[3];
     HitNoise.clip    = TakeDamageSound;
     canAttack        = true;
     Anim             = GetComponent <Animator>();
     ChaseScript      = GetComponent <EnemyChase>();
     AttackScript     = GetComponent <MinotaurAttackScript>();
     currentDamage    = damage;
     currentHealth    = maxHealth;
     currentMoveSpeed = defaultMoveSpeed;
     CharRigidBody    = GetComponent <Rigidbody2D>();
     //Player stuff
     Player      = GameObject.Find("Player");
     PlayerAudio = Player.GetComponent <Player_Manager>().PlayerInternalAudio;
 }