예제 #1
0
    // Update game info panel
    // update time and total currency earn
    public void UpdateGameInfoUI()
    {
        timeCount += Time.deltaTime;

        TimeSpan timeSpan = TimeSpan.FromSeconds((int)timeCount);

        infoTxt.text = "Total Game Time: " + string.Format("{0:D2}:{1:D2}:{2:D2}:{3:D2}",
                                                           timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds) + "\n" +
                       "Total Currency Earn: " + Simplify.LargeNumConvert(totalCurrencyEarn);
    }
예제 #2
0
    // When pointer enter service upgrade button, tool tip will be appear
    public void ToolTipPointerEnter(int buttonInd)
    {
        if (upgradeCost[buttonInd] == -1 || upgradeCost[buttonInd] == -2)
        {
            return;
        }

        toolTip = (GameObject)GameManager.Instantiate(Resources.Load("ToolTip"),
                                                      GameObject.Find("Canvas").GetComponent <Canvas>().transform);
        toolTip.transform.position = new Vector3(upgradeBtn[buttonInd].transform.position.x,
                                                 upgradeBtn[buttonInd].transform.position.y + 20, 0);

        Text ToolTipTxt = toolTip.transform.Find("ToolTipTxt").gameObject.GetComponent <Text>();

        ToolTipTxt.text = title + " produce twice\n" + "Cost: " + Simplify.LargeNumConvert(upgradeCost[buttonInd]);
        toolTip.GetComponent <RectTransform>().sizeDelta = new Vector2(ToolTipTxt.preferredWidth, ToolTipTxt.preferredHeight);
    }
예제 #3
0
 // Running once every frame
 // Update progress info on the game
 void UpdateProgressInfoUI()
 {
     curCurrencyTxt.text = "Currency\n" + Simplify.LargeNumConvert(curCurrency);
     curCpSTxt.text      = "Currency Per Second\n" + Simplify.LargeNumConvert(curCpS);
 }
예제 #4
0
 // Update service UI on the game
 public void UpdateUI()
 {
     infoTxt.text = "Level: " + curLevel + "\n" + "Total CpS:" + Simplify.LargeNumConvert(totalCpS);
     btnTxt.text  = "Level Up + " + Simplify.LargeNumConvert(unitCpS) + " CpS\n" + Simplify.LargeNumConvert(curCost) + " Currency";
 }