public void SAVE()
    {
        StreamWriter streamWriter = new StreamWriter("RPTest.txt");
        string       value        = string.Empty;

        foreach (short current in this.m_RPList.Keys)
        {
            for (int i = 0; i < this.m_RPList[current].Count; i++)
            {
                GxRP   gxRP = this.m_RPList[current][i];
                string text = string.Empty;
                for (int j = 0; j < 4; j++)
                {
                    text = text + gxRP.GetLinkedRP(j).ToString() + "/";
                }
                value = string.Concat(new string[]
                {
                    gxRP.GetIndex().ToString(),
                    "/",
                    gxRP.GetMapIndex().ToString(),
                    "/",
                    gxRP.GetPos().x.ToString(),
                    "/",
                    gxRP.GetPos().y.ToString(),
                    "/",
                    gxRP.GetPos().z.ToString(),
                    "/",
                    text
                });
                streamWriter.WriteLine(value);
            }
        }
        streamWriter.WriteLine("<End>");
        streamWriter.Close();
    }
Example #2
0
 public void DirectionCheck(Vector3 vDest, ref LinkedList <GxRpAsNode> RPPath)
 {
     if (RPPath.Count > 1)
     {
         GxRpAsNode value = RPPath.First.Value;
         GxRP       rP    = this.m_cGxRoadPointMgr.GetRP(value.sMapIdx, (int)value.RPIdx);
         value = RPPath.First.Next.Value;
         GxRP    rP2      = this.m_cGxRoadPointMgr.GetRP(value.sMapIdx, (int)value.RPIdx);
         Vector3 position = this.m_pkUserObj.transform.position;
         Vector3 from     = rP2.GetPos() - rP.GetPos();
         from.y = 0f;
         Vector3 to = position - rP.GetPos();
         to.y = 0f;
         float value2 = Vector3.Angle(from, to);
         if (Math.Abs(value2) < 90f)
         {
             RPPath.RemoveFirst();
         }
     }
     if (RPPath.Count > 1)
     {
         GxRpAsNode value3 = RPPath.Last.Value;
         GxRP       rP3    = this.m_cGxRoadPointMgr.GetRP(value3.sMapIdx, (int)value3.RPIdx);
         value3 = RPPath.Last.Previous.Value;
         GxRP    rP4   = this.m_cGxRoadPointMgr.GetRP(value3.sMapIdx, (int)value3.RPIdx);
         Vector3 from2 = rP4.GetPos() - rP3.GetPos();
         from2.y = 0f;
         Vector3 to2 = vDest - rP3.GetPos();
         to2.y = 0f;
         float value4 = Vector3.Angle(from2, to2);
         if (Math.Abs(value4) < 90f)
         {
             RPPath.RemoveLast();
         }
     }
     if (RPPath.Count == 1)
     {
         GxRpAsNode value5    = RPPath.First.Value;
         GxRP       rP5       = this.m_cGxRoadPointMgr.GetRP(value5.sMapIdx, (int)value5.RPIdx);
         Vector3    position2 = this.m_pkUserObj.transform.position;
         Vector3    from3     = position2 - rP5.GetPos();
         from3.y = 0f;
         Vector3 to3 = vDest - rP5.GetPos();
         to3.y = 0f;
         float value6 = Vector3.Angle(from3, to3);
         if (Math.Abs(value6) < 90f)
         {
             RPPath.RemoveFirst();
         }
     }
 }
Example #3
0
 private void SetMovePath(Vector3 vDestPos)
 {
     this.DirectionCheck(vDestPos, ref this.m_RPPath);
     this.m_MovePath.Clear();
     foreach (GxRpAsNode current in this.m_RPPath)
     {
         GxRP    rP  = this.m_cGxRoadPointMgr.GetRP(current.sMapIdx, (int)current.RPIdx);
         Vector3 pos = rP.GetPos();
         this.m_MovePath.AddLast(new Vector3(pos.x, pos.y, pos.z));
     }
     this.m_Debugstring.Add("DEST POS : " + vDestPos);
     if (vDestPos != Vector3.zero)
     {
         if (vDestPos.y == 0f)
         {
             vDestPos.y = NrCharMove.CalcHeight(vDestPos);
         }
         this.m_MovePath.AddLast(new Vector3(vDestPos.x, vDestPos.y, vDestPos.z));
     }
     if (this.m_MovePath.Count > 0)
     {
         this.m_bAutoMove = true;
         this.SetFollowHeroCamera(true);
     }
 }