public void Initialize(Rigidbody2D self, Weapon weapon) { this.self = self; this.weapon = weapon; patternInstance = Instantiate(pattern); if(patternInstance is ShootingPattern_CalculatedSpread calculatedSpread) { calculatedSpread.Initialize(timeBtwShots); } if (patternInstance is ShootingPattern_RandomSpread randomSpread) { randomSpread.Initialize(timeBtwShots); } chargedPattern = patternInstance as IChargable; }
public IShootingPattern GetShootingPattern(ShootingPattern pattern) { return(shootingPatterns[(int)pattern]); }