Beispiel #1
0
        protected override void OnUpdate(float timeStep)
        {
            Input input = Input;

            base.OnUpdate(timeStep);
            SimpleMoveCamera3D(timeStep);

            if (input.GetKeyPress(Key.F5))
            {
                if (!FileSystem.DirExists(FileSystem.UserDocumentsDir + "HotReloadDemo/Scenes"))
                {
                    FileSystem.CreateDir(FileSystem.UserDocumentsDir + "HotReloadDemo/Scenes");
                }
                scene.SaveXml(FileSystem.UserDocumentsDir + "HotReloadDemo/Scenes/HotReloadDemo.xml");
            }


            if (input.GetKeyPress(Key.F7))
            {
                if (FileSystem.FileExists(FileSystem.UserDocumentsDir + "HotReloadDemo/Scenes/HotReloadDemo.xml"))
                {
                    scene.LoadXml(FileSystem.UserDocumentsDir + "HotReloadDemo/Scenes/HotReloadDemo.xml");
                    dynamicComponentManager.SetScene(scene);

                    CameraNode = scene.GetChild("camera");
                    camera     = CameraNode.GetComponent <Camera>();
                    SetupViewport();
                }
            }
        }
Beispiel #2
0
        protected override void Start()
        {
            base.Start();

            var cache = ResourceCache;

            cache.AutoReloadResources = true;

            scene = new Scene();

            dynamicComponentManager           = new DynamicComponentManager();
            dynamicComponentManager.Temporary = true;
            dynamicComponentManager.SetScene(scene);

            CreateScene();
            SimpleCreateInstructionsWithWasd();
            SetupViewport();
        }