public void RefreshMyServerId(int id) { if (myPlayer != null) { Log.Sys("RefreshMyServerId: " + id); myPlayer.ID = id; var startPos = NetworkUtil.GetStartPos(); GetMyPlayer().transform.position = startPos; } }
/// <summary> /// 进入游戏更新自己的ServerID /// </summary> /// <param name="id"></param> public void RefreshMyServerId(int id) { Log.Sys("RefreshMyServerId: " + id); myPlayerServerId = id; if (myPlayerGameObj != null) { myPlayerGameObj.GetComponent <KBEngine.KBNetworkView>().SetServerID(myPlayerServerId); var startPos = NetworkUtil.GetStartPos(); GetMyPlayer().transform.position = startPos; } }
public void Revive() { ChangeHP(HP_Max); ChangeMP(MP_Max); NetworkRevive(); var pos = NetworkUtil.GetStartPos(); transform.position = pos; if (this.IsMine()) { NetDateInterface.Revive(); } }
void SetStartPointPosition(GameObject player) { if (NetworkUtil.IsNet()) { var pos = NetworkUtil.GetStartPos(); player.transform.position = pos; } else { var startPoint = GameObject.Find("PlayerStart"); player.transform.position = startPoint.transform.position; player.transform.forward = startPoint.transform.forward; } }
/// <summary> /// 自己复活 /// </summary> /// <returns></returns> public IEnumerator Revive() { GetComponent <BuffComponent>().RemoveAllBuff(); ChangeHP(HP_Max); ChangeMP(MP_Max); this.SetNetSpeed(0); SetJob(Job.WARRIOR); var pos = NetworkUtil.GetStartPos(); //transform.position = pos; //this.rigidbody.MovePosition(pos); Util.ForceResetPos(this.GetComponent <Rigidbody>(), pos); //StartCoroutine(SetRebornShader()); ReviveAI(); NetDateInterface.Revive(); yield return(null); }