void Start() { animatorBoss = GetComponent <Animator>(); myAudio = Conductor.GetComponent <AudioSource>(); soundVolume = myAudio.volume; QueueAttack = new Queue <AttackBoss>(ListAttack); nextAttack = QueueAttack.Peek(); QueueAttack.Dequeue(); }
void Update() { if (QueueAttack.Count > 0) { if (ConductorCustom.Instance.audioSource.time >= nextAttack.Time && BarManager.Instance.endGame == false) { Attack(nextAttack.Attack); nextAttack = QueueAttack.Peek(); QueueAttack.Dequeue(); } } if (goUltralaser) { ultralaserTimer += Time.deltaTime; if (StackDmg >= resistUltralaser) { Debug.Log("Ultralaser Cancel"); animatorBoss.SetBool("UltralaserLoop", false); animatorBoss.SetTrigger("UltralaserBreak"); SoundMgr.Instance.StopSound("AttqUltralaser"); SoundMgr.Instance.PlaySound("AttqUltralaserBreak"); //lancer animation de réduction de cast goUltralaser = false; StackDmg = 0; ultralaserTimer = 0; } else if (ultralaserTimer >= ultralaserTime) { Debug.Log("Ultralaser Success"); animatorBoss.SetBool("UltralaserLoop", false); animatorBoss.SetTrigger("UltralaserShoot"); StartCoroutine(UltralaserDamageTime()); //ShieldBar.Instance.TakeDamage(ultralaserDamage); //lancer animation de réduction de cast goUltralaser = false; StackDmg = 0; ultralaserTimer = 0; } } animatorBoss.SetFloat("BossLife", BossBar.Instance.GetValue()); if (!goUltrason) { if (myAudio.volume < soundVolume) { Timer += fadeOut * Time.deltaTime; myAudio.volume = Mathf.Lerp(volumeDownUltrason, soundVolume, Timer); } else { myAudio.volume = soundVolume; Timer = 0; } } }