コード例 #1
0
        public static NodeMap Load(string fileName)
        {
            string FullFilePath = Application.dataPath + "/" + fileName + ".bin";

            Debug.Log("Loading NodeMap from " + FullFilePath);
            if (File.Exists(FullFilePath))
            {
                BinaryFormatter Formatter  = new BinaryFormatter();
                FileStream      fileStream = new FileStream(FullFilePath, FileMode.Open);
                NodeMap         map        = (NodeMap)Formatter.Deserialize(fileStream);
                fileStream.Close();
                Debug.Log("Load success");
                return(map);
            }
            Debug.LogWarning("Load failed at " + FullFilePath);
            return(null);
        }
コード例 #2
0
ファイル: Path.cs プロジェクト: JonathanQ-Maker/Unity-AStar
 public Path(NodeMap map, Node[] waypoints)
 {
     this.waypoints = waypoints;
     this.map       = map;
 }