public void Play() { _emissionModule.enabled = true; particle.Play(); startEmiting?.Invoke(); StartCoroutine(Corroutines.Wait(duration, null, () => endEmiting?.Invoke())); }
public void PowerUpSpeed(float speed, float time) { material.SetColor(outlineColorID, speedOutline); StartCoroutine(Corroutines.Wait(time, () => material.SetFloat(blendOutlineId, 1f), () => material.SetFloat(blendOutlineId, 0f))); StartCoroutine(Corroutines.Wait(time, () => speedModifier += speed, () => this.speedModifier -= speed)); speedPowerUpParticle.SetActive(true); }
public void PowerUpDamage(float damage, float time) { material.SetColor(outlineColorID, damageOutline); StartCoroutine(Corroutines.Wait(time, () => damageModifier += damage, () => damageModifier -= damage)); StartCoroutine(Corroutines.Wait(time, () => material.SetFloat(blendOutlineId, 1f), () => material.SetFloat(blendOutlineId, 0f))); powerUpParticle.SetActive(true); }
internal bool Disparar(Vector3 mirada, float damageModifier) { if (cooldown || !data) { return(false); } AnimarDisparar(); _audioSource.Play(); float damage = data.damage + damageModifier; data.Disparar(transform, mirada, damage); StartCoroutine(Corroutines.Wait(data.fireRate, () => cooldown = true, () => cooldown = false)); return(true); }
public void Dash() { void DashStart() { animator.SetBool(hashDash, true); material.SetFloat(hologramId, 1); material.SetFloat(blendOutlineId, 1); StartCoroutine(stateMachine.SetWaitTime(dashTime)); } void DashEnd() { material.SetFloat(hologramId, 0); material.SetFloat(blendOutlineId, 0); animator.SetBool(hashDash, false); } // dashSkill.Execute(this, DashStart, DashEnd); DashStart(); StartCoroutine(Corroutines.DashTransform(transform, joystick.mirada, dashTime, dashSpeed)); StartCoroutine(Corroutines.Wait(dashTime, () => dashEmission.enabled = true, () => dashEmission.enabled = false)); StartCoroutine(Corroutines.Wait(dashTime, DashStart, DashEnd)); }
public void SetInvulneravility(bool value, float time) { StartCoroutine(Corroutines.Wait(time, () => SetInvulneravility(value), () => SetInvulneravility(!value))); }