56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PlayerAttack : MonoBehaviour{
|
|
|
|
[SerializeField] Animator attack = default;
|
|
[SerializeField] Animator[] enemyAnim = default;
|
|
[SerializeField] Animator flash = default;
|
|
|
|
[SerializeField] EnemyController[] enemy = default;
|
|
[SerializeField] HandManager hand = default;
|
|
|
|
[Space]
|
|
public bool open1;
|
|
public bool open2;
|
|
public bool open3;
|
|
public bool open4;
|
|
public bool open5;
|
|
|
|
public void Attack(){
|
|
hand.open1 = false;
|
|
hand.open2 = false;
|
|
hand.open3 = false;
|
|
hand.open4 = false;
|
|
hand.open5 = false;
|
|
|
|
attack.SetTrigger("Attack");
|
|
foreach(Animator anim in enemyAnim){
|
|
anim.SetTrigger("Attack");
|
|
}
|
|
foreach(EnemyController e in enemy){
|
|
e.Shake();
|
|
}
|
|
}
|
|
|
|
public void CountdownSound(){
|
|
AudioManager.instance.PlayOneShot("cuentaAtras");
|
|
}
|
|
|
|
public void ShowArms(){
|
|
hand.open1 = open1;
|
|
hand.open2 = open2;
|
|
hand.open3 = open3;
|
|
hand.open4 = open4;
|
|
hand.open5 = open5;
|
|
|
|
GetComponent<HandManager>().enabled = true;
|
|
flash.SetTrigger("Flash");
|
|
AudioManager.instance.Play("lanzar");
|
|
|
|
foreach (EnemyController e in enemy){
|
|
e.ShowArm();
|
|
}
|
|
}
|
|
}
|