コード例 #1
0
 public static void AddShootStrategy(string shootName, IStrategyShootType shootStrategy)
 {
     if (!_shootStrategies.ContainsKey(shootName))
     {
         _shootStrategies[shootName] = shootStrategy;
     }
 }
コード例 #2
0
    protected override void Start()
    {
        base.Start();

        shootType          = GameObject.FindGameObjectWithTag(K.TAG_MANAGERS).GetComponent <GameManager>().StartShootType;
        _shootTypeStrategy = Factory.GetShootStrategy(shootType);
    }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 void Start()
 {
     shootType          = K.SHOOT_TYPE_AUTOMATIC;
     _shootTypeStrategy = new ShootTypeAutomatic(K.SHOOT_RATE_AUTOMATIC);
 }
コード例 #5
0
 public void PowerupGrab(string name)
 {
     shootType = name;
     print("Powerup type: " + shootType);
     _shootTypeStrategy = Factory.GetShootStrategy(shootType);
 }