コード例 #1
0
        public static RoomModel Load(string path)
        {
            var model = AGSProject.LoadJson <RoomModel>(path);

            model.Folder = getDirectoryName(Path.GetDirectoryName(path));
            return(model);
        }
コード例 #2
0
ファイル: RoomModel.cs プロジェクト: tzachshabtay/MonoAGS
        public static RoomModel Load(IEditorPlatform platform, IGame game, string path)
        {
            var model = AGSProject.LoadJson <RoomModel>(platform, game, path);

            model.Folder = getDirectoryName(Path.GetDirectoryName(path));
            return(model);
        }
コード例 #3
0
ファイル: StateModel.cs プロジェクト: tzachshabtay/MonoAGS
 private void loadGameSettings(IEditorPlatform platform, IGame game, string path)
 {
     if (!File.Exists(path))
     {
         return;
     }
     Settings = AGSProject.LoadJson <AGSGameSettings>(platform, game, path);
     game.Settings.LoadFrom(Settings);
 }
コード例 #4
0
 public static EntityModel Load(string path)
 {
     if (!path.EndsWith(".json", StringComparison.InvariantCultureIgnoreCase))
     {
         return(null);
     }
     try
     {
         var model = AGSProject.LoadJson <EntityModel>(path);
         model.Filename = Path.GetFileName(path);
         return(model);
     }
     catch (JsonReaderException e)
     {
         Debug.WriteLine($"Exception while trying to read json from {path}.{Environment.NewLine}Exception: {e.ToString()}");
         throw;
     }
 }