Browse Source

Fixing renderable picking
Fixed C# GUIToggleGroup

Marko Pintera 11 years ago
parent
commit
d86ea39e25

+ 5 - 0
BansheeEngine/Include/BsRenderable.h

@@ -77,6 +77,11 @@ namespace BansheeEngine
 
 
 		Renderable(const HSceneObject& parent);
 		Renderable(const HSceneObject& parent);
 
 
+		/**
+		 * @copydoc	Component::onInitialized
+		 */
+		void onInitialized();
+
 		/**
 		/**
 		 * @copydoc	Component::onDestroyed
 		 * @copydoc	Component::onDestroyed
 		 */
 		 */

+ 5 - 2
BansheeEngine/Source/BsRenderable.cpp

@@ -14,9 +14,12 @@ namespace BansheeEngine
 		:Component(parent), mLastUpdateHash(0)
 		:Component(parent), mLastUpdateHash(0)
 	{
 	{
 		setName("Renderable");
 		setName("Renderable");
-
 		mInternal = RenderableHandler::create();
 		mInternal = RenderableHandler::create();
-		gSceneManager()._registerRenderable(mInternal, parent);
+	}
+
+	void Renderable::onInitialized()
+	{
+		gSceneManager()._registerRenderable(mInternal, sceneObject());
 	}
 	}
 
 
 	Bounds Renderable::getBounds() const
 	Bounds Renderable::getBounds() const

+ 1 - 1
BansheeEngine/Source/BsRenderableHandler.cpp

@@ -21,7 +21,7 @@ namespace BansheeEngine
 	template<bool Core>
 	template<bool Core>
 	TRenderableHandler<Core>::~TRenderableHandler()
 	TRenderableHandler<Core>::~TRenderableHandler()
 	{
 	{
-		int a = 5;
+
 	}
 	}
 
 
 	template<bool Core>
 	template<bool Core>

+ 19 - 0
MBansheeEditor/Scene/SceneWindow.cs

@@ -16,6 +16,11 @@ namespace BansheeEditor
         private GUIRenderTexture renderTextureGUI;
         private GUIRenderTexture renderTextureGUI;
         private SceneViewHandler sceneViewHandler;
         private SceneViewHandler sceneViewHandler;
 
 
+        private GUIToggle viewButton;
+        private GUIToggle moveButton;
+        private GUIToggle rotateButton;
+        private GUIToggle scaleButton;
+
         public Camera GetCamera()
         public Camera GetCamera()
         {
         {
             return camera;
             return camera;
@@ -26,6 +31,20 @@ namespace BansheeEditor
 
 
         private void OnInitialize()
         private void OnInitialize()
         {
         {
+            //GUIToggleGroup handlesTG = new GUIToggleGroup();
+
+            //viewButton = new GUIToggle("V", handlesTG);
+            //moveButton = new GUIToggle("M", handlesTG);
+            //rotateButton = new GUIToggle("R", handlesTG);
+            //scaleButton = new GUIToggle("S", handlesTG);
+
+            //GUILayout handlesLayout = GUI.layout.AddLayoutX();
+            //handlesLayout.AddElement(viewButton);
+            //handlesLayout.AddElement(moveButton);
+            //handlesLayout.AddElement(rotateButton);
+            //handlesLayout.AddElement(scaleButton);
+            //handlesLayout.AddFlexibleSpace();
+
             UpdateRenderTexture(Width, Height);
             UpdateRenderTexture(Width, Height);
         }
         }
 
 

+ 1 - 1
SBansheeEngine/Source/BsScriptGUIToggle.cpp

@@ -55,7 +55,7 @@ namespace BansheeEngine
 			options.addOption(mono_array_get(guiOptions, GUIOption, i));
 			options.addOption(mono_array_get(guiOptions, GUIOption, i));
 
 
 		ScriptGUIToggleGroup* scriptToggleGroup = nullptr;
 		ScriptGUIToggleGroup* scriptToggleGroup = nullptr;
-		if(scriptToggleGroup != nullptr)
+		if (toggleGroup != nullptr)
 			scriptToggleGroup = ScriptGUIToggleGroup::toNative(toggleGroup);
 			scriptToggleGroup = ScriptGUIToggleGroup::toNative(toggleGroup);
 
 
 		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
 		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));

+ 0 - 3
TODO.txt

@@ -5,9 +5,6 @@
 When serializing Camera I cannot save the reference to RenderTexture. Make it a Resource?
 When serializing Camera I cannot save the reference to RenderTexture. Make it a Resource?
 Possibly set up automatic refresh in debug mode after initialization? As an ad-hoc unit test
 Possibly set up automatic refresh in debug mode after initialization? As an ad-hoc unit test
 
 
-<<<<<Menu bar issues>>>>>
-Double-clicking the title bar should cause the window to maximize
-
 <<<<Multi-resource saving>>>>:
 <<<<Multi-resource saving>>>>:
  - Modify Font so it doesn't contain a texture, but instead keeps a handle to it
  - Modify Font so it doesn't contain a texture, but instead keeps a handle to it
  - Register it in its meta file
  - Register it in its meta file