Ejemplo n.º 1
0
    public void updateBtnState(CommonDefine.TalentSlotState btnState)
    {
        _btnState = btnState;

        switch (btnState)
        {
        case CommonDefine.TalentSlotState.TALENT_LOCK:
            _talentLockBtn.gameObject.SetActive(true);
            _talentCanInstallBtn.gameObject.SetActive(false);
            _talentHasInstalledBtn.gameObject.SetActive(false);
            _talentLockBtn.image.sprite = CommonUtil.Util.getSprite(CommonDefine.ResPath.TALENT_LOCK_BTN);
            break;

        case CommonDefine.TalentSlotState.TALENT_CAN_INSTALL:
            _talentLockBtn.gameObject.SetActive(false);
            _talentCanInstallBtn.gameObject.SetActive(true);
            _talentHasInstalledBtn.gameObject.SetActive(false);
            _talentCanInstallBtn.image.sprite = CommonUtil.Util.getSprite(CommonDefine.ResPath.TALENT_CANINSTALL_BTN);
            break;

        case CommonDefine.TalentSlotState.TALENT_INSTALLED:
            _talentLockBtn.gameObject.SetActive(false);
            _talentCanInstallBtn.gameObject.SetActive(false);
            _talentHasInstalledBtn.gameObject.SetActive(true);

            //更新为对应的天赋图标

            _talentHasInstalledBtn.image.sprite = CommonUtil.Util.getSprite(CommonDefine.ResPath.TALENT_ICON_BTN + (int)_talent);

            break;
        }
    }
Ejemplo n.º 2
0
    public void updateTalentItem(TalentPanel talentPanel, CommonDefine.eTalentType type, int id, string name, string des, CommonDefine.TalentSlotState btnState)
    {
        _talent = type;
        _id     = id;
        _name   = name;
        _des    = des;

        _talentPanel = talentPanel;

        updateBtnState(btnState);
    }
Ejemplo n.º 3
0
    public TalentItem createTalentItem(CommonDefine.eTalentType type, int id, string name, string des, CommonDefine.TalentSlotState btnState)
    {
        TalentItem talentItem = Instantiate(_talentPrefab, new Vector3(0, 0, 0), Quaternion.identity);

        talentItem.transform.SetParent(_talentItemRoot.transform);

        talentItem.transform.localPosition = new Vector3(0, -id * _talentInteral, 0);

        talentItem.updateTalentItem(this, type, id, name, des, btnState);

        talentItem.transform.localScale = talentItem.transform.localScale * CommonUtil.Util.getScreenScale();

        return(talentItem);
    }