Exemplo n.º 1
0
 public void RefreshMyServerId(int id)
 {
     if (myPlayer != null)
     {
         Log.Sys("RefreshMyServerId: " + id);
         myPlayer.ID = id;
         var startPos = NetworkUtil.GetStartPos();
         GetMyPlayer().transform.position = startPos;
     }
 }
Exemplo n.º 2
0
 /// <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;
     }
 }
Exemplo n.º 3
0
        public void Revive()
        {
            ChangeHP(HP_Max);
            ChangeMP(MP_Max);
            NetworkRevive();

            var pos = NetworkUtil.GetStartPos();

            transform.position = pos;
            if (this.IsMine())
            {
                NetDateInterface.Revive();
            }
        }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
        /// <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);
        }