/// <summary> /// 设置开始位置 /// </summary> public void SetStart() { if (mPlayerInfo == null)//没有这个玩家 { mName.text = ""; mPoint.text = ""; mIcon.mainTexture = null; mPreObj.SetActive(false); } else { int index = MJGameModel.Inst.mSeatToIndex[mPlayerInfo.seatId] + 1; if (mPlayerInfo.seatId == MJGameModel.Inst.mMySeatId) { index = 0; } mState = eMJRoomStatus.STARTE; mPreObj.SetActive(false); mHeadRoot.transform.localPosition = mStartPos[index]; } }
private Vector3[] mStartPos = new Vector3[] { new Vector3(-787.2f, -284.68f, 0), new Vector3(164.5f, 49.48f, 0), new Vector3(479.6f, 25.9f, 0), new Vector3(-178.5f, 88.9f, 0) }; //开始过后的位置 /// <summary> /// 设置头像显示 /// </summary> /// <param name="info"></param> public void SetData(MJplayerInfo info, eMJRoomStatus state) { mState = state; mPlayerInfo = info; if (info == null)//没有这个玩家 { mName.text = ""; mPoint.text = ""; mIcon.mainTexture = null; mPreObj.SetActive(false); } else { mHeadRoot.SetActive(true); mName.text = info.nickName;//GameUtils.GetClampText(info.nickName, mName); mPoint.text = info.gold.ToString("#0.00"); Assets.LoadIcon(info.headUrl, (t) => { mIcon.mainTexture = t; }); int index = MJGameModel.Inst.mSeatToIndex[info.seatId] + 1; if (info.seatId == MJGameModel.Inst.mMySeatId) { index = 0; } if (state == eMJRoomStatus.READY) { mPreObj.SetActive(info.isReady); mHeadRoot.transform.localPosition = mReadyPos[index]; } else { mPreObj.SetActive(false); mHeadRoot.transform.localPosition = mStartPos[index]; } } }
/// <summary> /// 设置头像 /// </summary> /// <param name="info"></param> public void SetIcon(MJplayerInfo info, eMJRoomStatus state) { mHead.SetData(info, state); }