public static void AddShootStrategy(string shootName, IStrategyShootType shootStrategy) { if (!_shootStrategies.ContainsKey(shootName)) { _shootStrategies[shootName] = shootStrategy; } }
protected override void Start() { base.Start(); shootType = GameObject.FindGameObjectWithTag(K.TAG_MANAGERS).GetComponent <GameManager>().StartShootType; _shootTypeStrategy = Factory.GetShootStrategy(shootType); }
private void ShootTypeSelection() { if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Keypad1)) { _shootTypeStrategy = null; shootType = K.SHOOT_TYPE_AUTOMATIC; _shootTypeStrategy = Factory.GetShootStrategy(shootType); } if (Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Keypad2)) { /* * _shootTypeStrategy = null; * shootType = Config.SHOOT_TYPE_LASER; * _shootTypeStrategy = Factory.GetShootStrategy(shootType); */ } if (Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Keypad3)) { _shootTypeStrategy = null; shootType = K.SHOOT_TYPE_BOMB; _shootTypeStrategy = Factory.GetShootStrategy(shootType); } }
void Start() { shootType = K.SHOOT_TYPE_AUTOMATIC; _shootTypeStrategy = new ShootTypeAutomatic(K.SHOOT_RATE_AUTOMATIC); }
public void PowerupGrab(string name) { shootType = name; print("Powerup type: " + shootType); _shootTypeStrategy = Factory.GetShootStrategy(shootType); }