Beispiel #1
0
 public void SaveMapAs()
 {
     if (m_cellArray == null)
     {
         return;
     }
     m_filePath = EditorUtility.SaveFilePanel("Save map file", Application.dataPath, "", "txt");
     if (string.IsNullOrEmpty(m_filePath))
     {
         return;
     }
     AStarMapStream.Write(ToMap(), m_filePath);
     Debug.Log("Save success.");
 }
Beispiel #2
0
    public void AutoAStarMap()
    {
        if (cells == null)
        {
            return;
        }
        string filePath;

        filePath = EditorUtility.SaveFilePanel("Save map file", Application.dataPath, "", "txt");

        if (string.IsNullOrEmpty(filePath))
        {
            return;
        }
        AStarMap map = SpriteMap2AStarMap.SpriteMapToAStarMap(ToMapData());

        AStarMapStream.Write(map, filePath);
        Debug.Log("AutoAStarMap success.");
    }
Beispiel #3
0
 void MapCatch()
 {
     AStarMapStream.Write(ToMap(), Application.dataPath + "/MapCatch");
 }