void SwitchGuns(GunTypeEnum gunTypeEnum) { currentGunType = gunTypeEnum; if (gunTypeEnum == GunTypeEnum.Rifle) { gunType = new Rifle(); } else { gunType = new Shotgun(); } gunType.Initialize(gameObject); mySpriteRenderer.sprite = gunType.GetSprite(); shotFrequency = gunType.GetShotFrequency(); shotTimer = 0.0f; }
public GunStats(GunStats gunStat) { if (gunStat == null) { return; } this.id = gunStat.id; this.gunName = gunStat.gunName; this.AmmoStats.AmmoSize = gunStat.AmmoStats.AmmoSize; this.AmmoStats.CurrentAmmo = gunStat.AmmoStats.CurrentAmmo; this.AmmoStats.DeltaAmmo = gunStat.AmmoStats.DeltaAmmo; this.attackRate = gunStat.attackRate; this.minAngle = gunStat.minAngle; this.maxAngle = gunStat.maxAngle; this.powerfull = gunStat.powerfull; this.gunType = gunStat.gunType; this.maxAmmoSize = gunStat.maxAmmoSize; this.maxPowerFull = gunStat.maxPowerFull; this.maxAttackRate = gunStat.maxAttackRate; this.levelToOpen = gunStat.levelToOpen; }