示例#1
0
    void Update()
    {
        if (!curUnit)
        {
            stats.gameObject.SetActive(false);
            avatar.gameObject.SetActive(false);
            health.gameObject.SetActive(false);
        }
        else
        {
            aliveUI.gameObject.SetActive(true);
            stats.gameObject.SetActive(true);

            int atkExp = (int)BigInteger.Log10(curUnit.top);
            int defExp = (int)BigInteger.Log10(curUnit.bot);
            stats.text  = "";
            stats.text += curUnit.GetTopAlias() + " " + BigIntegerUtilities.ToString(curUnit.top, 5, 8);
            stats.text += "\n";
            stats.text += curUnit.GetBotAlias() + " " + BigIntegerUtilities.ToString(curUnit.bot, 5, 8);

            avatar.gameObject.SetActive(true);
            avatar.sprite = curUnit.avatar;

            health.gameObject.SetActive(true);
            health.value     = curUnit.HPPercentage;
            healthFill.color = curUnit.GetClassColor();
        }
    }
    public void Update()
    {
        unitToSummon.name   = nameField.text;
        unitToSummon.avatar = image.sprite;

        unitToSummon.maxHp = player.newUnitPool * player.hpMultiplier;
        unitToSummon.top   = player.newUnitPool * ((int)atkSlider.value * 10 / (int)atkSlider.maxValue) / 10;
        unitToSummon.bot   = player.newUnitPool * ((int)defSlider.value * 10 / (int)defSlider.maxValue) / 10;

        atkNameplate.text = unitToSummon.GetTopAlias();
        defNameplate.text = unitToSummon.GetBotAlias();

        poolText.text = BigIntegerUtilities.ToString(player.newUnitPool, 5);
        hpText.text   = BigIntegerUtilities.ToString(unitToSummon.maxHp, 5);
        atkText.text  = BigIntegerUtilities.ToString(unitToSummon.top, 5);
        defText.text  = BigIntegerUtilities.ToString(unitToSummon.bot, 5);
    }
示例#3
0
    void Update()
    {
        if (!curUnit)
        {
            gameObject.SetActive(false);
        }
        else
        {
            nameText.text     = curUnit.name;
            nameText.color    = curUnit.GetClassColor();
            avatar.sprite     = curUnit.avatar;
            classText.text    = curUnit.GetClassName().ToUpper();
            classText.color   = curUnit.GetClassColor();
            atkNameplate.text = curUnit.GetTopAlias();
            defNameplate.text = curUnit.GetBotAlias();
            maxHpValue.text   = BigIntegerUtilities.ToString(curUnit.maxHp, 8);
            hpValue.text      = BigIntegerUtilities.ToString(curUnit.hp, 8);
            atkValue.text     = BigIntegerUtilities.ToString(curUnit.top, 8);
            defValue.text     = BigIntegerUtilities.ToString(curUnit.bot, 8);
            expValue.text     = BigIntegerUtilities.ToString(curUnit.exp, 8);

            if (curUnit.curWorld)
            {
                notDeployedUI.gameObject.SetActive(false);
                deployedUI.gameObject.SetActive(true);
                worldText.text    = curUnit.curWorld.displayName;
                worldImage.sprite = curUnit.curWorld.sprite;
                worldImage.gameObject.SetActive(true);
                floorText.text = "F" + BigIntegerUtilities.ToString(curUnit.curFloor, 8);
                floorText.gameObject.SetActive(true);
            }
            else
            {
                deployedUI.gameObject.SetActive(false);
                notDeployedUI.gameObject.SetActive(true);
                worldImage.gameObject.SetActive(false);
                floorText.gameObject.SetActive(false);
            }
        }
    }