public override void update(ChargedWeapon weapon) { currentCooldown += Time.deltaTime; if (currentCooldown >= weapon.cooldown) { weapon.currentState = new ChargedWeaponStateIdle(); } }
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 override void handleInput(ChargedWeapon weapon) { if (Input.GetButton("Fire1")) { currentChargeTime += Time.deltaTime; if (currentChargeTime >= weapon.chargeTime) { weapon.currentState = new ChargedWeaponStateFiring(); } } else { currentChargeTime -= Time.deltaTime; if (currentChargeTime <= 0) { weapon.currentState = new ChargedWeaponStateIdle(); } } Debug.Log("Charged For: " + currentChargeTime + " / " + weapon.chargeTime); }
public virtual void update(ChargedWeapon weapon) {}
public virtual void handleInput(ChargedWeapon weapon) {}
public override void handleInput(ChargedWeapon weapon) { if (Input.GetButton("Fire1")) { weapon.currentState = new ChargedWeaponStateCharging(); } }
public override void update(ChargedWeapon weapon) { GameObject.Instantiate(weapon.projectile, weapon.transform.position, weapon.transform.parent.rotation); weapon.currentState = new ChargedWeaponStateCooldown(); }
public void Failed(ChargedWeapon weapon) { ActiveEffects[weapon].Failed(); }
public void StopCharging(ChargedWeapon weapon) { ActiveEffects[weapon].StopCharging(); }