Jelajahi Sumber

Fixed an crash when attempting to unload a scene that was instantiated from a prefab

Marko Pintera 10 tahun lalu
induk
melakukan
ec041b0129
3 mengubah file dengan 29 tambahan dan 5 penghapusan
  1. 2 2
      BansheeCore/Source/BsSceneObject.cpp
  2. 1 0
      BansheeEngine/Source/BsSceneManager.cpp
  3. 26 3
      TODO.txt

+ 2 - 2
BansheeCore/Source/BsSceneObject.cpp

@@ -172,10 +172,10 @@ namespace BansheeEngine
 
 
 	void SceneObject::instantiate()
 	void SceneObject::instantiate()
 	{
 	{
-		mFlags &= ~SOF_DontInstantiate;
-
 		std::function<void(SceneObject*)> instantiateRecursive = [&](SceneObject* obj)
 		std::function<void(SceneObject*)> instantiateRecursive = [&](SceneObject* obj)
 		{
 		{
+			obj->mFlags &= ~SOF_DontInstantiate;
+
 			if (obj->mParent == nullptr)
 			if (obj->mParent == nullptr)
 				gCoreSceneManager().registerNewSO(obj->mThisHandle);
 				gCoreSceneManager().registerNewSO(obj->mThisHandle);
 
 

+ 1 - 0
BansheeEngine/Source/BsSceneManager.cpp

@@ -3,6 +3,7 @@
 #include "BsRenderableHandler.h"
 #include "BsRenderableHandler.h"
 #include "BsCameraHandler.h"
 #include "BsCameraHandler.h"
 #include "BsLightInternal.h"
 #include "BsLightInternal.h"
+#include "BsDebug.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {

+ 26 - 3
TODO.txt

@@ -52,9 +52,32 @@ Code quality improvements:
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Polish
 Polish
 
 
-Test:
- - Loaded scene test component has empty values
- - Loading a scene multiple times causes an exception when updating Renderables in scene manager
+Move data folder within current repo
+ - Store default layout asset in Data/Editor folder
+ - Store data generated by editor runtime at Data/Runtime
+
+Add Create Project & Open Project entries in main menu
+Rename ProjectWindow to LibraryWindow
+Store last open project location, should the last project be loaded by default, and a list of all known projects (listed by last opened date)
+(Store last open level too. WIll likely need ProjectSettings similar to EditorSettings)
+ProjectWindow
+ - Show this on start-up if last open project is empty or load last project is off
+  - Main editor window should show up but nothing should be loaded in it 
+    (see how to handle that best? - isProjectLoaded() and have ProjectLibrary and similar check for that)
+  - Contains an input box for project to open
+  - Below it is a scroll are with a list of most recent projects, selecting one changes the value in input box, double-clicking opens that project
+  - To the right is a Browse button that allows you to find an existing project
+    - When selected call a method CheckIfValidProject that confirms selected folder exists and has all the proper files, throw warning otherwise
+      - Do this when opening a project from the most recent list as well, if it fails remove it from most recent list
+    - Browsed to project is added to the most recent list and opened, if valid
+  - Below browse is Load button that loads the project currently in the input box (with the check above)
+  - On the bottom below Load is Create button that allows you to choose a folder in which to create a new project
+
+When creating a new project:
+ - Copy default layout from Data/Editor to the project folder
+ - Create Resources & Internal folders
+ - Unload the current project (clear scene, clear project library)
+ - Refresh project library so it points to new location
 
 
 Ribek use:
 Ribek use:
  - Hook up color picker to guicolor field
  - Hook up color picker to guicolor field