public void Init(CommonTitleType leftType, CommonTitleType rightType) { m_leftType = leftType; m_rightType = rightType; LeftAddBtn.SetCallBackFuntion(OnLeftPropertyBtnClick, leftType); RightAddBtn.SetCallBackFuntion(OnRightPropertyBtnClick, rightType); VigourAddBtn.SetCallBackFuntion(OnVigroupPropertyBtnClick); if (leftType == CommonTitleType.Power) { LeftAddBtn.gameObject.SetActive(false); VigourAddBtn.gameObject.SetActive(true); ShowEnemgryLeftTimeBar(null); //LeftIconSprite.ChangeSprite((int)leftType); } else if (leftType == CommonTitleType.Practice) { LeftAddBtn.gameObject.SetActive(true); if (LeftAddBtn.BackgroundSwithList.Length > 0) { LeftAddBtn.BackgroundSwithList[0].gameObject.SetActive(false); } VigourAddBtn.gameObject.SetActive(false); LeftIconSprite.ChangeSprite((int)leftType); } else { LeftAddBtn.gameObject.SetActive(true); VigourAddBtn.gameObject.SetActive(false); LeftIconSprite.ChangeSprite((int)leftType); } RightIconSprite.ChangeSprite((int)rightType); }
private string GetPropertyAmount(CommonTitleType commonTitleType) { var m_HeroDataModel = PlayerManager.Instance.FindHeroDataModel(); string amount = "0"; switch (commonTitleType) { case CommonTitleType.GoldIngot: amount = m_HeroDataModel.PlayerValues.PLAYER_FIELD_BINDPAY.ToString(); break; case CommonTitleType.Money: int money = m_HeroDataModel.PlayerValues.PLAYER_FIELD_HOLDMONEY; int moneyAbridge = CommonDefineManager.Instance.CommonDefine.GameMoneyAbridge; amount = money > moneyAbridge?(money / 10000) + "W":money.ToString(); break; case CommonTitleType.Power: amount = string.Format("{0}/{1}", m_HeroDataModel.PlayerValues.PLAYER_FIELD_CURRENCY_ACTIVELIFE, m_HeroDataModel.PlayerValues.PLAYER_FIELD_MAX_ACTIVELIFE); break; case CommonTitleType.Practice: amount = m_HeroDataModel.PlayerValues.PLAYER_FIELD_PRACTICE_NUM.ToString(); break; case CommonTitleType.Diamond: amount = DiamondNum.ToString(); JHPlatformConnManager.Instance.TencentBalance((info) => { if (info != null && info.ret == 0) { DiamondNum = info.balance; } RightAddBtn.SetButtonText(DiamondNum.ToString()); }); break; } return(amount); }