コード例 #1
0
    void Initialize()
    {
        if (ChS_Controller._finalSelection.ContainsKey("Soldier Icon"))
        {
            _player = ReInput.players.GetPlayer(ChS_Controller._finalSelection["Soldier Icon"]);
            MultipleTargetCamera.targets.Add(gameObject);

            _playerID   = _player.id;
            _controller = GetComponent <CharacterController>();
            if (UIEventCOntroller.players.Count == 0)
            {
                UIEventCOntroller.players.Add("Soldier", gameObject);
            }
            if (SceneManager.GetActiveScene().name == "Level1")
            {
                Tutotrial.players.Add(gameObject);
            }
            _baseFireRate = _fireRate;
            _abilities    = gameObject.GetComponent <SoldierAbilities>();
        }
        else
        {
            gameObject.SetActive(false);
        }
    }
コード例 #2
0
 public static void Use(Vector2 location, int level, int ability) {
 
   SoldierAbilities useAbility = new SoldierAbilities();
  
     useAbility.soldierLocation = location;
     useAbility.abilityLevel = level;
 
   switch (ability) {
   
     case hit:
       useAbility.Hit();
       break;
    
   }  
 }