private void AdventRemainTimeCountDown() { PWoodsPlayer me = GetPlayer(MeVo.instance.Id); if (null != me && me.remainTime > 0) { vp_Timer.CancelAll("AdventCountDownCallback"); vp_Timer.In(me.remainTime, AdventCountDownCallback, 1, 0); } }
public void SetPlayerRobbedTimes(uint playerId, byte robTimes) { PWoodsPlayer palyer = GetPlayer(playerId); if (null != palyer) { palyer.robTimes = robTimes; DataUpdate(UPDATE_PLAYER_ROB_TIMES); } }
private bool AdventInCD() { PWoodsPlayer me = GetPlayer(MeVo.instance.Id); if (null != me) { return(me.remainTime > 0); } return(false); }
public int GetPlayerIndex(PWoodsPlayer player) { if (null != playerList) { return(playerList.IndexOf(player)); } else { return(-1); } }
private void UpdatePlayerPos(int index) { PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.PlayerList[index]; SysForest shipInfo = BaseDataMgr.instance.GetSysForestVo((uint)player.grade); int shipSlot = GetShipSlot(player.id); int totalTime = shipInfo.time; Vector3 pos = btnShips[shipSlot].transform.localPosition; pos.x = startX + (((float)(totalTime - shipsRemainTime[player.id]) / totalTime) * (endX - startX)); btnShips[shipSlot].transform.localPosition = pos; AddTweenPositionComponentForShip(shipSlot); }
private void UpdatePlayersShow() { int curShipCnt = Singleton <GoldSilverIslandMode> .Instance.PlayerList.Count; int needShowCnt = (curShipCnt <= maxShips) ? curShipCnt : maxShips; for (int i = 0; i < needShowCnt; i++) { PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.PlayerList[i]; int shipSlot = GetShipSlot(player.id); btnShips[shipSlot].background.spriteName = GetShipSpriteName(player.grade); shipsRemainTime[player.id] = (int)player.remainTime; UpdatePlayerPos(i); btnShips[shipSlot].SetActive(true); } }
private void UpdatePlayerList() { foreach (Button item in btnShips) { item.SetActive(false); } me = Singleton <GoldSilverIslandMode> .Instance.GetPlayer(MeVo.instance.Id); if (null != me) { adventLeftTime = (int)me.remainTime; myShipSlot = GetShipSlot(me.id); targetPos = btnShips[myShipSlot].transform.localPosition; targetPos.x = endX; } SetLabelLeftTime(labAdventRemainTime, adventLeftTime); UpdatePlayersShow(); }
private void UpdatePlayerInfo() { PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.GetPlayer(playerId); if (null == player) { return; } labName.text = player.name; labRobRemain.text = player.robTimes.ToString() + "/" + GameConst.MaxRobTimes; labLevel.text = "Lv." + player.lvl.ToString(); labPower.text = player.fightPoint.ToString(); //玩家战斗力 sprHead.atlas = Singleton <AtlasManager> .Instance.GetAtlas(AtlasManager.Header); sprHead.spriteName = Singleton <RoleMode> .Instance.GetPlayerHeadSpriteName(player.job); if (string.Empty != player.assistName) { labAssistName.text = player.assistName; labAssistLvl.text = "Lv." + player.assistLvl.ToString(); labAssistPower.text = player.assistFightPoint.ToString(); //协助者战斗力 labAssistPowerDes.SetActive(true); labAssistNoMan.SetActive(false); } else { labAssistName.text = ""; labAssistLvl.text = ""; labAssistPower.text = ""; //协助者战斗力 labAssistPowerDes.SetActive(false); labAssistNoMan.SetActive(true); } sprAssistHead.atlas = Singleton <AtlasManager> .Instance.GetAtlas(AtlasManager.Header); sprAssistHead.spriteName = Singleton <RoleMode> .Instance.GetPlayerHeadSpriteName(player.assistJob); //协助者职业 }
private void AddTweenPositionComponentForShip(int shipSlot) { GameObject go = btnShips[shipSlot].gameObject; if (null != go) { float[] floatY = { 0f, 7f, 5f, 3f, 2f, 1f }; float[] floatTime = { 0f, 0.6f, 0.7f, 0.8f, 0.9f, 1f }; uint playerId = playerIds[shipSlot]; PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.GetPlayer(playerId); TweenPosition tweenPosition = NGUITools.AddMissingComponent <TweenPosition>(go); Vector3 fromPos = btnShips[shipSlot].transform.localPosition; fromPos.y = shipsPosition[shipSlot].y; tweenPosition.from = fromPos; tweenPosition.to = fromPos + new Vector3(0f, floatY[player.grade], 0f); tweenPosition.style = UITweener.Style.PingPong; tweenPosition.method = UITweener.Method.QuintEaseInOut; tweenPosition.duration = floatTime[player.grade]; } }
private void AutoUpdatePlayersPos() { int curShipCnt = Singleton <GoldSilverIslandMode> .Instance.PlayerList.Count; int needShowCnt = (curShipCnt <= maxShips) ? curShipCnt : maxShips; for (int i = 0; i < needShowCnt; i++) { PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.PlayerList[i]; int shipSlot = GetShipSlot(player.id); if (startBlast && (myShipSlot == shipSlot)) { continue; } shipsRemainTime[player.id]--; if (shipsRemainTime[player.id] < 0) { shipsRemainTime[player.id] = 0; } UpdatePlayerPos(i); } }
private void UpdatePlayerRobTimes() { PWoodsPlayer player = Singleton <GoldSilverIslandMode> .Instance.GetPlayer(playerId); labRobRemain.text = player.robTimes.ToString() + "/" + GameConst.MaxRobTimes; }
public void read(MemoryStream msdata) { PWoodsPlayer.readLoop(msdata, players); }