コード例 #1
0
 public void SetUtilityWeapon(RobotWeapon weapon)
 {
     if (unlockedWeapons.Contains(weapon))
     {
         utilityWeapon = weapon;
     }
 }
コード例 #2
0
 public void SetMainWeapon(RobotWeapon weapon)
 {
     if (unlockedWeapons.Contains(weapon))
     {
         mainWeapon = weapon;
     }
 }
コード例 #3
0
 protected virtual void Start()
 {
     robotController = GetComponent <RobotController>();
     robotCharacter  = GetComponent <RobotCharacter>();
     robotWeapon     = GetComponent <RobotWeapon>();
     robotMovement   = GetComponent <RobotMovement>();
 }
コード例 #4
0
    private void EquipWeapons()
    {
        if (frontWeaponObject != null)
        {
            frontWeaponObject.gameObject.SetActive(false);
        }
        if (backWeaponObject != null)
        {
            backWeaponObject.gameObject.SetActive(false);
        }

        RobotWeaponsManager weaponsManager = RobotWeaponsManager.Instance;
        RobotWeapon         frontWeapon    = weaponsManager.FrontWeapon;

        if (frontWeapon != null)
        {
            frontWeaponObject = Instantiate(weaponsManager.FrontWeapon.prefab, configuration.FrontWeaponPosition.position, Quaternion.identity, transform);
            frontWeaponObject.EquipToPlayer(gameObject);
        }
        else
        {
            Debug.Log("no front weapon equipped, not instantiating");
        }
        RobotWeapon backWeapon = weaponsManager.BackWeapon;

        if (backWeapon != null)
        {
            backWeaponObject = Instantiate(weaponsManager.BackWeapon.prefab, configuration.BackWeaponPosition.position, Quaternion.identity, transform);
            backWeaponObject.EquipToPlayer(gameObject);
        }
        else
        {
            Debug.Log("no back weapon equipped, not instantiating");
        }
    }
コード例 #5
0
 public void UnlockWeapon(RobotWeapon weapon)
 {
     unlockedWeapons.Add(weapon);
 }
コード例 #6
0
 public WeaponPickerElement(RobotWeapon weapon, GameObject instance)
 {
     this.instance = instance;
     this.weapon   = weapon;
 }