Beispiel #1
0
        /// <summary>
        /// 其它玩家复活立即切换状态,重置HP
        /// 设置RebornShader
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        public IEnumerator NetworkRevive(GCPlayerCmd cmd)
        {
            var ainfo = cmd.AvatarInfo;

            Log.Sys("Revive");
            var np = NetworkUtil.FloatPos(ainfo.X, ainfo.Y, ainfo.Z);

            Util.ForceResetPos(this.GetComponent <Rigidbody>(), np);
            var nr = Quaternion.Euler(new Vector3(0, ainfo.Dir, 0));

            this.GetComponent <Rigidbody>().MoveRotation(nr);
            SetHPNet(HP_Max);
            ReviveAI();
            //StartCoroutine(SetRebornShader());
            yield return(null);
        }
Beispiel #2
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);
        }