示例#1
0
    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;
    }
示例#2
0
 public IShootingPattern GetShootingPattern(ShootingPattern pattern)
 {
     return(shootingPatterns[(int)pattern]);
 }