Charged Weapons & Hitscan Weapons
Implemented two new weapon types and created the Railgun (which is both) and accompanying VFX
This commit is contained in:
parent
4c0038830b
commit
2a0fe34611
36 changed files with 49495 additions and 25 deletions
38
Assets/Scripts/Gameplay/Weapons/ChargeEffectManager.cs
Normal file
38
Assets/Scripts/Gameplay/Weapons/ChargeEffectManager.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ChargeEffectManager : MonoBehaviour
|
||||
{
|
||||
public Prototype EffectPrototype;
|
||||
|
||||
private Dictionary<ChargedWeapon, WeaponChargeEffect> ActiveEffects = new Dictionary<ChargedWeapon, WeaponChargeEffect>();
|
||||
|
||||
public void StartCharging(ChargedWeapon weapon, EquippedItem item, EntityInstance source)
|
||||
{
|
||||
var effect = EffectPrototype.Instantiate<WeaponChargeEffect>();
|
||||
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
||||
var barrel = source.GetBarrel(hp);
|
||||
var t = effect.transform;
|
||||
t.SetParent(barrel);
|
||||
t.forward = barrel.forward;
|
||||
t.position = barrel.position;
|
||||
effect.Weapon = weapon;
|
||||
ActiveEffects[weapon] = effect;
|
||||
}
|
||||
|
||||
public void StopCharging(ChargedWeapon weapon)
|
||||
{
|
||||
ActiveEffects[weapon].StopCharging();
|
||||
}
|
||||
|
||||
public void Charged(ChargedWeapon weapon)
|
||||
{
|
||||
ActiveEffects[weapon].Charged();
|
||||
}
|
||||
|
||||
public void Failed(ChargedWeapon weapon)
|
||||
{
|
||||
ActiveEffects[weapon].Failed();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue