2 using System.Collections.Generic;
3 using System.Diagnostics;
7 using System.Threading.Tasks;
9 using SiliconStudio.Paradox;
10 using SiliconStudio.Paradox.DataModel;
11 using SiliconStudio.Paradox.Engine;
12 using SiliconStudio.Paradox.EntityModel;
13 using SiliconStudio.Paradox.Games.IO;
14 using SiliconStudio.Paradox.Games.MicroThreading;
15 using SiliconStudio.Paradox.Games.Serialization.Assets;
16 using SiliconStudio.Paradox.Games.Serialization.Contents;
31 VirtualFileSystem.MountFileSystem(
"/sync",
gitFolder);
38 VirtualFileSystem.MountFileSystem(
"/sync",
gitFolder);
47 Process.Start(
new ProcessStartInfo(
"git",
"add package_scene.hotei") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
48 Process.Start(
new ProcessStartInfo(
"git",
"commit -m Message") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
49 Process.Start(
new ProcessStartInfo(
"git",
"fetch --all") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
50 Process.Start(
new ProcessStartInfo(
"git",
"rebase origin/master") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
51 Process.Start(
new ProcessStartInfo(
"git",
"push origin master") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
63 Process.Start(
new ProcessStartInfo(
"git",
"add package_scene.hotei") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
64 Process.Start(
new ProcessStartInfo(
"git",
"commit -m Message") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
65 Process.Start(
new ProcessStartInfo(
"git",
"fetch --all") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
66 Process.Start(
new ProcessStartInfo(
"git",
"merge origin/master") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
67 Process.Start(
new ProcessStartInfo(
"git",
"push origin master") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
76 Process.Start(
new ProcessStartInfo(
"git",
"fetch --all") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
77 Process.Start(
new ProcessStartInfo(
"git",
"pull") { WorkingDirectory =
gitFolder, CreateNoWindow =
true, UseShellExecute =
false }).WaitForExit();
86 var assetManager =
new AssetManager(
new AssetSerializerContextGenerator(engineContext.PackageManager));
89 var meshComponent = entity.GetOrCreate(ModelComponent.Key);
90 meshComponent.SubMeshes.Add(
new EffectMeshData { MeshData =
new SubMeshData { DrawCount = 321 } });
91 var entities =
new[] { entity };
93 throw new NotImplementedException();
108 var oldState = engineContext.EntityManager.State;
109 engineContext.EntityManager.State = GameState.Saving;
110 await Scheduler.Current.NextFrame();
111 await Scheduler.Current.NextFrame();
112 await Scheduler.Current.NextFrame();
116 var entities = engineContext.EntityManager.Entities.ToArray();
117 var sceneData =
new EntityGroup { Entities = entities.ToList() };
118 contentManager.Url.Set(sceneData,
"/sync/package_scene.hotei#");
119 contentManager.Save(sceneData);
121 engineContext.EntityManager.State = GameState.Running;
131 public static async
void LoadScene(EngineContext engineContext)
134 var contentManager = engineContext.AssetManager;
138 var sceneData = contentManager.Load<
EntityGroup>(
"/sync/package_scene.hotei#");
140 foreach (var entity
in sceneData.Entities)
142 engineContext.EntityManager.AddEntity(entity);
145 var entityCopy = entity;
154 VirtualFileSystem.MountFileSystem(
"/global_data",
"..\\..\\deps\\data\\");
155 VirtualFileSystem.MountFileSystem(
"/global_data2",
"..\\..\\data\\");
156 ParameterContainerExtensions.Merge(engineContext.PackageManager,
"/data/package_scene_base.hotei",
"/data/package_scene1.hotei",
"/data/package_scene2.hotei",
"/data/package_scene_copy.hotei");
Game entity. It usually aggregates multiple EntityComponent
static async Task AnimateFBXModel(EngineContext engineContext, Entity characterEntity, float endAnimTime=0.0f, float loopTime=0.0f)
static void SetupFolder1(EngineContext engineContext)
This processor will take care of adding/removing children of every Entity added/removed in the Entity...
Add animation capabilities to an Entity. It will usually apply to ModelComponent.ModelViewHierarchy ...
static async void LoadScene(EngineContext engineContext)
static async Task SyncSceneLoad(EngineContext engineContext)
A group of Entity that can refers to each others. They can be loaded together as a chunk...
static async Task MergeSceneTest(EngineContext engineContext)
static void SetupFolder2(EngineContext engineContext)
static async Task SaveScene(EngineContext engineContext)
static async Task SyncSceneRebase(EngineContext engineContext)
static PropertyKey< AnimationComponent > Key
static void ClearScene(EngineContext engineContext)
static SerializerSelector DefaultSceneSerializerSelector
static async Task SyncSceneMerge(EngineContext engineContext)
static async Task SaveScene2(EngineContext engineContext)