Ejemplo n.º 1
0
 public void UpdateView(TeamChangeCell cell)
 {
     heroInfo.SetActive(true);
     Desc.text = Localization.instance.Get("UI_TeamChangeDlg_Select");
     Desc.transform.localPosition = new Vector3(-500,-60,-50);
     Desc.transform.localScale = new Vector3(30,30,1);
     Desc.lineWidth = 500;
     heroIcon.spriteName = "" + cell.heroData.type;
     heroLv.text = "Lv:" + cell.heroData.lv;
     heroName.text = "" + cell.heroData.type;
     switch(cell.heroData.state){
         case HeroData.State.LOCKED:
             locked.SetActive(true);
             rightObj.SetActive(false);
             break;
         case HeroData.State.UNLOCKED_NOT_RECRUITED:
             stateBtn.transform.localPosition = new Vector3(80,-85,-50);
             locked.SetActive(false);
             rightObj.SetActive(true);
             btnLabel.text = Localization.instance.Get("UI_Button_RECRUIT");//"RECRUITED";
             clock.SetActive(false);
             box.SetActive(true);
             price.enabled = true;
             if(cell.heroData.hireCp > 0){
                 price.text = "[Command Points] " + cell.heroData.hireCp;
             }else if(cell.heroData.hireSilver > 0){
                 price.text = "[Silver] " + cell.heroData.hireSilver;
             }
             break;
         case HeroData.State.RECRUITED_NOT_SELECTED:
             stateBtn.transform.localPosition = new Vector3(80,-55,-50);
             clock.SetActive(false);
             box.SetActive(false);
             price.enabled = false;
             locked.SetActive(false);
             rightObj.SetActive(true);
             btnLabel.text = Localization.instance.Get("UI_Button_ADD");//"ADD";
             break;
         case HeroData.State.SELECTED:
             locked.SetActive(false);
             rightObj.SetActive(true);
             if(lastHighLightCell.isSkillLearning){
     //					stateBtn.transform.localPosition = new Vector3(80,-85,-50);
     //					btnLabel.text = "FINISH";
     //					clock.SetActive(true);
     //					box.SetActive(true);
     //					price.enabled = true;
     //					price.text = "[Command Points] 1";
             }else{
                 stateBtn.transform.localPosition = new Vector3(80,-55,-50);
                 btnLabel.text = Localization.instance.Get("UI_Button_REMOVE");//"REMOVE";
                 clock.SetActive(false);
                 box.SetActive(false);
                 price.enabled = false;
             }
             break;
     }
 }
Ejemplo n.º 2
0
    //    public void OnBattleBtnClick()
    //    {
    //        BattleBg.Instance.heroOutBattle(false);
    //        BattleBg.Instance.heroInBattle();
    //        BattleBg.Instance.heroMoveToBattleStartPos();
    //        Destroy(gameObject);
    //    }
    //    public void setTeamMiniBarIsfullStr(bool isPress){
    //        teamMiniBarIsfullStr.gameObject.SetActive(isPress);
    //    }
    public void OnCellClick(TeamChangeCell cell)
    {
        if(lastHighLightCell != null && lastHighLightCell != cell){
            lastHighLightCell.Border.enabled = false;
        }
        lastHighLightCell = cell;

        UpdateView(cell);
    }