my HEAD hurts and the SFX is TOO LOUD
This commit is contained in:
parent
a3321d361c
commit
d4ebf0ca61
41 changed files with 1465 additions and 123 deletions
|
|
@ -15,10 +15,19 @@ public class Laser : PlayerAbility
|
|||
private BeamCollider beamObjectInstance;
|
||||
public float turnSpeed;
|
||||
public float offset;
|
||||
[SerializeField] private AudioClip beamSFX;
|
||||
[SerializeField] private float beamVolume = 1;
|
||||
|
||||
[Header("Weapon Properties")]
|
||||
[HideInInspector] public List<Entity> enemyList = new();
|
||||
public float damageDebounceTime;
|
||||
protected float currentDebounce;
|
||||
[Header("Charge")]
|
||||
public float chargeTime;
|
||||
protected float currentCharge;
|
||||
[Header("Effects")]
|
||||
[SerializeField] private CameraShake camShakeScript; //optional
|
||||
|
||||
private void Start()
|
||||
{
|
||||
CreateBeam();
|
||||
|
|
@ -30,13 +39,30 @@ public class Laser : PlayerAbility
|
|||
currentDuration = duration;
|
||||
currentCooldown = cooldown;
|
||||
currentDebounce = damageDebounceTime;
|
||||
beamObjectInstance.gameObject.SetActive(true);
|
||||
transform.Lookat2D(thisPlayer.mouseWorldPos);
|
||||
currentCharge = chargeTime;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (currentCharge >= 0 && currentDuration > 0)
|
||||
{
|
||||
currentCharge -= Time.deltaTime;
|
||||
if (currentCharge < 0)
|
||||
{
|
||||
AbilityManager.instance.player.thisPlayer.entityAS.PlayOneShot(beamSFX, beamVolume);
|
||||
beamObjectInstance.gameObject.SetActive(true);
|
||||
transform.Lookat2D(thisPlayer.mouseWorldPos);
|
||||
if (camShakeScript)
|
||||
{
|
||||
camShakeScript.ShakeCamera(currentDuration);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (currentDuration > 0)
|
||||
{
|
||||
Vector3 direction = (thisPlayer.mouseWorldPos - (Vector2)transform.position).normalized;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ public class PlayerAbility : MonoBehaviour
|
|||
public int baseProjectileCount;
|
||||
public int projectileCount;
|
||||
public Dictionary<AbilityUpgrade, int> attachedUpgrades = new();
|
||||
[Header("SFX")]
|
||||
[SerializeField] private AudioClip useAbilitySFX;
|
||||
[SerializeField] private float volume = 1;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
|
@ -34,6 +37,7 @@ public class PlayerAbility : MonoBehaviour
|
|||
if (currentCooldown <= 0 && canCooldown)
|
||||
{
|
||||
currentCooldown = cooldown;
|
||||
AbilityManager.instance.player.thisPlayer.entityAS.PlayOneShot(useAbilitySFX, volume);
|
||||
AbilityEffects();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue