예제 #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
 public Path(NodeMap map, Node[] waypoints)
 {
     this.waypoints = waypoints;
     this.map       = map;
 }