Exemplo n.º 1
0
    private void NextMapMove(int StartMapIdx, int DestMapIndex)
    {
        this.m_MapPath.Clear();
        this.m_Debugstring.Add("MAP LINK ASTAR");
        this.m_cMapAstar.Generate(StartMapIdx, DestMapIndex, ref this.m_MapPath);
        if (this.m_MapPath.Count == 0)
        {
            return;
        }
        int value = this.m_MapPath.First.Next.Value;

        this.m_iCurNextIdx = value;
        this.m_RPPath.Clear();
        Vector2 pos = this.m_cGateMgr.GetPos(StartMapIdx, value);

        this.m_Debugstring.Add("GATE POS:" + pos);
        short nerestRP  = this.m_cGxRoadPointMgr.GetNerestRP(0, (short)this.m_pkUserObj.transform.position.x, (short)this.m_pkUserObj.transform.position.z, false, false);
        short nerestRP2 = this.m_cGxRoadPointMgr.GetNerestRP(0, (short)pos.x, (short)pos.y, false, false);

        this.GenerateMinLenPath(nerestRP, nerestRP2, ref this.m_RPPath);
        Vector3 vector = new Vector3(pos.x, 0f, pos.y);

        vector.y = NrCharMove.CalcHeight(vector);
        this.SetMovePath(vector);
    }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
0
    public Vector3 FindMovableDestination(Vector3 vDest, NrCharDefine.eMoveTargetReason movereason)
    {
        Vector3 zero = Vector3.zero;

        if (movereason == NrCharDefine.eMoveTargetReason.MTR_WIDECOLL)
        {
            Vector2 vector = this.FindMovableNearWideColl(vDest, true, 0f, 0f);
            if (vector.x == 0f && vector.y == 0f)
            {
                return(zero);
            }
            zero.x = vector.x;
            zero.z = vector.y;
        }
        zero.y = NrCharMove.CalcHeight(zero);
        return(zero);
    }