public void Increment()
 {
     if (_upgradeable == null)
     {
         return;
     }
     _upgradeable.Upgrade();
     RefreshShownValues();
 }
예제 #2
0
 ///
 /// Upgrade the ship and the specified upgradeble.
 ///
 public void Upgrade(IUpgradeable upgradeable)
 {
     // full health recovery
     this.health = this.maxHealth;
     if (upgradeable.CanUpgrade())
     {
         upgradeable.Upgrade();
     }
     Game.Instance.ShowMessage(UItext.MessageType.RankUp, Game.Instance.ExplorationCount.ToString());
 }
예제 #3
0
    void TryToUpgrade(IUpgradeable upgradeable)
    {
        // If we have enough money
        if (upgradeable.CanUpgrade() && PlayerData.Instance.CanAfford(upgradeable.GetUpgradeCost()))
        {
            //Spend the money
            PlayerData.Instance.Spend(upgradeable.GetUpgradeCost());

            //Upgrade
            upgradeable.Upgrade();

            var cost = upgradeable.GetUpgradeCost();
            var text = cost >= 0 ? cost.ToString() : "-";
            UpgradeButton.transform.GetChild(0).Find("Price").GetComponent <TMPro.TextMeshProUGUI>().text = text;
        }
    }
예제 #4
0
        /// <summary>
        /// Called from Controller, if target available proceed.
        /// </summary>
        internal void PickUp()
        {
            if (m_target == null || m_upgradeableTarget == null)
            {
                return;
            }

            if (Upgrade)
            {
                m_upgradeableTarget?.Upgrade();
            }
            else
            {
                m_target?.PickUp(m_weapon);
            }

            m_target            = null;
            m_upgradeableTarget = null;

            m_photonView.RPC("ChangeStateRPC", RpcTarget.All, false);
            PickedWeapon?.Invoke();
        }
예제 #5
0
파일: Upgrade.cs 프로젝트: Scaelz/Covfefe
 public void UpgradeInstance(IUpgradeable instance)
 {
     instance.Upgrade(upgradeType, Level, maxLevel);
 }