public static MyVec3 Parse(string s) { var t = s.IndexOf('>'); Debug.Log("SubStringIs: " + s); var v = s.Substring(t + 1).Split(','); var xx = Convert.ToInt32(v[0]); var yy = Convert.ToInt32(v[1]); var zz = Convert.ToInt32(v[2]); var vc = new MyVec3() { x = xx, y = yy, z = zz, }; return(vc); }
/// <summary> /// 添加Buff限制状态 /// Skill 状态维持 /// </summary> /// <returns></returns> private void MoveBack() { //从当前位置计算 合理的击退位置 var cmd = runner.stateMachine.cmd; var pos = new MyVec3(cmd.SkillAction.X, cmd.SkillAction.Y, cmd.SkillAction.Z); var fpos = pos.ToFloat(); var dir = cmd.SkillAction.Dir; var mapGrid = GridManager.Instance; var moveTotal = moveStep * moveTime; var endPos = fpos + Quaternion.Euler(0, dir, 0) * Vector3.forward * moveTotal; //得到击退的位置 var newPos = mapGrid.RaycastNearestPoint(fpos, endPos); //逻辑上可以直接一段时间设置位置 表现上可能需要做平移 //移动到位置 var att = runner.stateMachine.attacker; var phy = att.GetComponent <IPhysicCom>(); phy.MoveToIgnorePhysic(newPos); }
public static bool IsServerMove(MyVec3 speed) { return(speed.x != 0 || speed.z != 0); }