Browse Source

Refactor: GUIContent and LocString types now use the script binding generator

BearishSun 7 years ago
parent
commit
2f3e87edcc
100 changed files with 909 additions and 986 deletions
  1. 5 5
      Source/EditorCore/Testing/BsEditorTestSuite.cpp
  2. 1 1
      Source/EditorCore/UndoRedo/BsCmdDeleteSO.cpp
  3. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIColorField.cs
  4. 2 2
      Source/Scripting/MBansheeEditor/GUI/GUIEnumField.cs
  5. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIFloatField.cs
  6. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIGameObjectField.cs
  7. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIIntField.cs
  8. 4 4
      Source/Scripting/MBansheeEditor/GUI/GUIListBoxField.cs
  9. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIResourceField.cs
  10. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUISliderField.cs
  11. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUITextField.cs
  12. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUITextureField.cs
  13. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIToggleField.cs
  14. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIVector2Field.cs
  15. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIVector3Field.cs
  16. 1 1
      Source/Scripting/MBansheeEditor/GUI/GUIVector4Field.cs
  17. 2 1
      Source/Scripting/MBansheeEditor/MBansheeEditor.csproj
  18. 6 4
      Source/Scripting/MBansheeEditor/Utility/EditorBuiltin.cs
  19. 5 5
      Source/Scripting/MBansheeEditor/Windows/AnimationWindow.cs
  20. 6 51
      Source/Scripting/MBansheeEditor/Windows/Scene/SceneWindow.cs
  21. 2 149
      Source/Scripting/MBansheeEngine/GUI/GUIContent.cs
  22. 3 56
      Source/Scripting/MBansheeEngine/GUI/LocString.cs
  23. 83 0
      Source/Scripting/MBansheeEngine/Generated/GUIContent.generated.cs
  24. 54 0
      Source/Scripting/MBansheeEngine/Generated/GUIContentImages.generated.cs
  25. 37 0
      Source/Scripting/MBansheeEngine/Generated/GUIElementState.generated.cs
  26. 86 0
      Source/Scripting/MBansheeEngine/Generated/HString.generated.cs
  27. 0 54
      Source/Scripting/MBansheeEngine/Interop/ProfilerOverlayInternal.cs
  28. 0 2
      Source/Scripting/MBansheeEngine/MBansheeEngine.csproj
  29. 0 62
      Source/Scripting/MBansheeEngine/Utility/ProfilerOverlay.cs
  30. 3 3
      Source/Scripting/SBansheeEditor/BsGUIGameObjectField.cpp
  31. 6 8
      Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.cpp
  32. 4 2
      Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.h
  33. 3 2
      Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorWindow.cpp
  34. 3 2
      Source/Scripting/SBansheeEditor/Wrappers/BsScriptModalWindow.cpp
  35. 4 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIColorField.cpp
  36. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIColorField.h
  37. 5 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIEnumField.cpp
  38. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIEnumField.h
  39. 4 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIFloatField.cpp
  40. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIFloatField.h
  41. 6 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIGameObjectField.cpp
  42. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIGameObjectField.h
  43. 5 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIIntField.cpp
  44. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIIntField.h
  45. 8 7
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.cpp
  46. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.h
  47. 5 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIResourceField.cpp
  48. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIResourceField.h
  49. 5 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUISliderField.cpp
  50. 4 2
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUISliderField.h
  51. 5 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextField.cpp
  52. 4 2
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextField.h
  53. 4 4
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextureField.cpp
  54. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextureField.h
  55. 5 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIToggleField.cpp
  56. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIToggleField.h
  57. 5 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector2Field.cpp
  58. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector2Field.h
  59. 4 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector3Field.cpp
  60. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector3Field.h
  61. 4 3
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector4Field.cpp
  62. 3 1
      Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector4Field.h
  63. 1 1
      Source/Scripting/SBansheeEngine/BsManagedComponent.cpp
  64. 1 1
      Source/Scripting/SBansheeEngine/BsScriptGameObjectManager.cpp
  65. 0 8
      Source/Scripting/SBansheeEngine/CMakeSources.cmake
  66. 0 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptBlend1DInfo.generated.cpp
  67. 1 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptBlend1DInfo.generated.h
  68. 1 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptCJoint.generated.cpp
  69. 1 2
      Source/Scripting/SBansheeEngine/Generated/BsScriptCollisionData.generated.cpp
  70. 1 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptCollisionData.generated.h
  71. 1 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptControllerColliderCollision.generated.cpp
  72. 1 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptControllerControllerCollision.generated.cpp
  73. 72 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContent.generated.cpp
  74. 33 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContent.generated.h
  75. 153 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContentImages.generated.cpp
  76. 35 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContentImages.generated.h
  77. 83 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptHString.generated.cpp
  78. 30 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptHString.generated.h
  79. 4 4
      Source/Scripting/SBansheeEngine/Generated/BsScriptPhysics.generated.cpp
  80. 1 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptPhysicsQueryHit.generated.cpp
  81. 4 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTNamedAnimationCurve.generated.cpp
  82. 2 1
      Source/Scripting/SBansheeEngine/Serialization/BsBuiltinComponentLookup.h
  83. 9 6
      Source/Scripting/SBansheeEngine/Serialization/BsManagedSerializableField.cpp
  84. 1 1
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptComponent.h
  85. 3 2
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptContextMenu.cpp
  86. 0 112
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptGUIContentImages.cpp
  87. 0 41
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptGUIContentImages.h
  88. 0 39
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptHString.cpp
  89. 0 38
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptHString.h
  90. 1 1
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptManagedComponent.h
  91. 0 66
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptProfilerOverlayInternal.cpp
  92. 0 42
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptProfilerOverlayInternal.h
  93. 1 1
      Source/Scripting/SBansheeEngine/Wrappers/BsScriptSceneObject.h
  94. 8 6
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIButton.cpp
  95. 4 2
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIButton.h
  96. 0 64
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.cpp
  97. 0 39
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.h
  98. 8 6
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUILabel.cpp
  99. 5 2
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUILabel.h
  100. 4 3
      Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIListBox.cpp

+ 5 - 5
Source/EditorCore/Testing/BsEditorTestSuite.cpp

@@ -433,11 +433,11 @@ namespace bs
 		GameObjectHandle<TestComponentA> cmpExternal = soExternal->addComponent<TestComponentA>();
 
 		cmpA1_1->ref1 = so2_0;
-		cmpA1_1->ref2 = cmpB1_1;
+		cmpA1_1->ref2 = static_object_cast<Component>(cmpB1_1);
 		cmpB1_1->ref1 = soExternal;
 		cmpB1_1->val1 = "InitialValue";
 		cmpExternal->ref1 = so1_1;
-		cmpExternal->ref2 = cmpA1_1;
+		cmpExternal->ref2 = static_object_cast<Component>(cmpA1_1);
 
 		CmdRecordSO::execute(so0_0);
 		cmpB1_1->val1 = "ModifiedValue";
@@ -480,11 +480,11 @@ namespace bs
 		GameObjectHandle<TestComponentA> cmpExternal = soExternal->addComponent<TestComponentA>();
 
 		cmpA1_1->ref1 = so2_0;
-		cmpA1_1->ref2 = cmpB1_1;
+		cmpA1_1->ref2 = static_object_cast<Component>(cmpB1_1);
 		cmpB1_1->ref1 = soExternal;
 		cmpB1_1->val1 = "InitialValue";
 		cmpExternal->ref1 = so1_1;
-		cmpExternal->ref2 = cmpA1_1;
+		cmpExternal->ref2 = static_object_cast<Component>(cmpA1_1);
 
 		CmdDeleteSO::execute(so0_0);
 		UndoRedo::instance().undo();
@@ -730,7 +730,7 @@ namespace bs
 
 		BS_TEST_ASSERT(so0->getNumChildren() == nso0->getNumChildren());
 		HSceneObject nso0_1 = nso0->getChild(0);
-		GameObjectHandle<TestComponentC> ncmp0_1 = nso0_1->getComponent<TestComponentD>();
+		GameObjectHandle<TestComponentD> ncmp0_1 = nso0_1->getComponent<TestComponentD>();
 		BS_TEST_ASSERT(ncmp0_1 != nullptr);
 
 		HSceneObject nso1 = newRoot->getChild(1);

+ 1 - 1
Source/EditorCore/UndoRedo/BsCmdDeleteSO.cpp

@@ -60,7 +60,7 @@ namespace bs
 
 		HSceneObject parent;
 		if (mSerializedObjectParentId != 0)
-			parent = GameObjectManager::instance().getObject(mSerializedObjectParentId);
+			parent = static_object_cast<SceneObject>(GameObjectManager::instance().getObject(mSerializedObjectParentId));
 
 		GameObjectManager::instance().setDeserializationMode(GODM_RestoreExternal | GODM_UseNewIds);
 

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIColorField.cs

@@ -63,7 +63,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIColorField(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 2 - 2
Source/Scripting/MBansheeEditor/GUI/GUIEnumField.cs

@@ -122,7 +122,7 @@ namespace BansheeEditor
         public GUIEnumField(Type enumType, bool multiselect, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, Enum.GetNames(enumType), Enum.GetValues(enumType), multiselect, 
-                null, 0, style, options, false);
+                new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>
@@ -136,7 +136,7 @@ namespace BansheeEditor
         public GUIEnumField(Type enumType, bool multiselect = false, params GUIOption[] options)
         {
             Internal_CreateInstance(this, Enum.GetNames(enumType), Enum.GetValues(enumType), multiselect, 
-                null, 0, "", options, false);
+                new GUIContent(), 0, "", options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIFloatField.cs

@@ -79,7 +79,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIFloatField(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIGameObjectField.cs

@@ -65,7 +65,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIGameObjectField(Type type, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, type, null, 0, style, options, false);
+            Internal_CreateInstance(this, type, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIIntField.cs

@@ -79,7 +79,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIIntField(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 4 - 4
Source/Scripting/MBansheeEditor/GUI/GUIListBoxField.cs

@@ -125,7 +125,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIListBoxField(LocString[] elements, bool multiselect = false, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, elements, multiselect, null, 0, style, options, false);
+            Internal_CreateInstance(this, elements, multiselect, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>
@@ -139,7 +139,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIListBoxField(LocString[] elements, bool multiselect = false, params GUIOption[] options)
         {
-            Internal_CreateInstance(this, elements, multiselect, null, 0, "", options, false);
+            Internal_CreateInstance(this, elements, multiselect, new GUIContent(), 0, "", options, false);
         }
 
         /// <summary>
@@ -224,7 +224,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIListBoxField(string[] elements, bool multiselect = false, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, ToLocalizedElements(elements), multiselect, null, 0, style, options, false);
+            Internal_CreateInstance(this, ToLocalizedElements(elements), multiselect, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>
@@ -238,7 +238,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIListBoxField(string[] elements, bool multiselect = false, params GUIOption[] options)
         {
-            Internal_CreateInstance(this, ToLocalizedElements(elements), multiselect, null, 0, "", options, false);
+            Internal_CreateInstance(this, ToLocalizedElements(elements), multiselect, new GUIContent(), 0, "", options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIResourceField.cs

@@ -81,7 +81,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIResourceField(Type type, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, type, null, 0, style, options, false);
+            Internal_CreateInstance(this, type, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUISliderField.cs

@@ -71,7 +71,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUISliderField(float min, float max, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, min, max, null, 0, style, options, false);
+            Internal_CreateInstance(this, min, max, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUITextField.cs

@@ -81,7 +81,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUITextField(bool multiline = false, string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, multiline, null, 0, style, options, false);
+            Internal_CreateInstance(this, multiline, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUITextureField.cs

@@ -80,7 +80,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUITextureField(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIToggleField.cs

@@ -62,7 +62,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIToggleField(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIVector2Field.cs

@@ -79,7 +79,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIVector2Field(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIVector3Field.cs

@@ -79,7 +79,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIVector3Field(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 1 - 1
Source/Scripting/MBansheeEditor/GUI/GUIVector4Field.cs

@@ -79,7 +79,7 @@ namespace BansheeEditor
         ///                       override any similar options set by style.</param>
         public GUIVector4Field(string style = "", params GUIOption[] options)
         {
-            Internal_CreateInstance(this, null, 0, style, options, false);
+            Internal_CreateInstance(this, new GUIContent(), 0, style, options, false);
         }
 
         /// <summary>

+ 2 - 1
Source/Scripting/MBansheeEditor/MBansheeEditor.csproj

@@ -90,6 +90,7 @@
     <Compile Include="Inspectors\SliderJointInspector.cs" />
     <Compile Include="Inspectors\SphereColliderInspector.cs" />
     <Compile Include="Inspectors\SphericalJointInspector.cs" />
+    <Compile Include="Windows\DbgWindow.cs" />
     <Compile Include="Windows\Inspector\Style\InspectableFieldRangeStyle.cs" />
     <Compile Include="Windows\Inspector\Style\InspectableFieldStepStyle.cs" />
     <Compile Include="Windows\Inspector\Style\InspectableFieldStyle.cs" />
@@ -247,4 +248,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
+</Project>

+ 6 - 4
Source/Scripting/MBansheeEditor/Utility/EditorBuiltin.cs

@@ -152,7 +152,8 @@ namespace BansheeEditor
         /// <returns>Sprite textures of the icon.</returns>
         public static GUIContentImages GetSceneWindowIcon(SceneWindowIcon icon)
         {
-            return Internal_GetSceneWindowIcon(icon);
+            Internal_GetSceneWindowIcon(icon, out var output);
+            return output;
         }
 
         /// <summary>
@@ -162,7 +163,8 @@ namespace BansheeEditor
         /// <returns>Sprite textures of the icon.</returns>
         public static GUIContentImages GetAnimationWindowIcon(AnimationWindowIcon icon)
         {
-            return Internal_GetAnimationWindowIcon(icon);
+            Internal_GetAnimationWindowIcon(icon, out var output);
+            return output;
         }
 
         /// <summary>
@@ -206,10 +208,10 @@ namespace BansheeEditor
         private static extern SpriteTexture Internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern GUIContentImages Internal_GetSceneWindowIcon(SceneWindowIcon icon);
+        private static extern void Internal_GetSceneWindowIcon(SceneWindowIcon icon, out GUIContentImages output);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern GUIContentImages Internal_GetAnimationWindowIcon(AnimationWindowIcon icon);
+        private static extern void Internal_GetAnimationWindowIcon(AnimationWindowIcon icon, out GUIContentImages output);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern SpriteTexture Internal_GetLogIcon(LogIcon icon, int size, bool dark);

+ 5 - 5
Source/Scripting/MBansheeEditor/Windows/AnimationWindow.cs

@@ -163,17 +163,17 @@ namespace BansheeEditor
             GUIContent recordIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.Record),
                 new LocEdString("Record"));
 
-            GUIContent prevFrameIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.FrameBack),
+            GUIContent prevFrameIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.FrameBack), 
                 new LocEdString("Previous frame"));
-            GUIContent nextFrameIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.FrameForward),
+            GUIContent nextFrameIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.FrameForward), 
                 new LocEdString("Next frame"));
 
-            GUIContent addKeyframeIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.AddKeyframe),
+            GUIContent addKeyframeIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.AddKeyframe), 
                 new LocEdString("Add keyframe"));
-            GUIContent addEventIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.AddEvent),
+            GUIContent addEventIcon = new GUIContent(EditorBuiltin.GetAnimationWindowIcon(AnimationWindowIcon.AddEvent), 
                 new LocEdString("Add event"));
 
-            GUIContent optionsIcon = new GUIContent(EditorBuiltin.GetLibraryWindowIcon(LibraryWindowIcon.Options),
+            GUIContent optionsIcon = new GUIContent(EditorBuiltin.GetLibraryWindowIcon(LibraryWindowIcon.Options), 
                 new LocEdString("Options"));
 
             playButton = new GUIToggle(playIcon, EditorStyles.Button);

+ 6 - 51
Source/Scripting/MBansheeEditor/Windows/Scene/SceneWindow.cs

@@ -26,7 +26,6 @@ namespace BansheeEditor
         private const int HeaderHeight = 20;
         private const float DefaultPlacementDepth = 5.0f;
         private static readonly Color ClearColor = new Color(0.0f, 0.3685f, 0.7969f);
-        private const string ProfilerOverlayActiveKey = "_Internal_ProfilerOverlayActive";
         private const int HandleAxesGUISize = 50;
         private const int HandleAxesGUIPaddingX = 10;
         private const int HandleAxesGUIPaddingY = 5;
@@ -76,11 +75,6 @@ namespace BansheeEditor
         private VirtualButton rotateToolKey;
         private VirtualButton scaleToolKey;
 
-        // Profiler overlay
-        private ProfilerOverlay activeProfilerOverlay;
-        private Camera profilerCamera;
-        private VirtualButton toggleProfilerOverlayKey;
-
         // Drag & drop
         private bool dragActive;
         private SceneObject draggedSO;
@@ -195,17 +189,17 @@ namespace BansheeEditor
                 new LocEdString("Move"));
             GUIContent rotateIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Rotate), 
                 new LocEdString("Rotate"));
-            GUIContent scaleIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Scale), 
-                new LocEdString("Scale"));
+            GUIContent scaleIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Scale),
+                new LocEdString("Scale")); 
 
-            GUIContent localIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Local), 
+            GUIContent localIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Local),
                 new LocEdString("Local"));
-            GUIContent worldIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.World), 
+            GUIContent worldIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.World),
                 new LocEdString("World"));
 
-            GUIContent pivotIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Pivot), 
+            GUIContent pivotIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Pivot),
                 new LocEdString("Pivot"));
-            GUIContent centerIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Center), 
+            GUIContent centerIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Center),
                 new LocEdString("Center"));
 
             GUIContent moveSnapIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.MoveSnap), 
@@ -283,7 +277,6 @@ namespace BansheeEditor
             GUIPanel focusPanel = GUI.AddPanel(-2);
             focusPanel.AddElement(focusCatcher);
 
-            toggleProfilerOverlayKey = new VirtualButton(ToggleProfilerOverlayBinding);
             viewToolKey = new VirtualButton(ViewToolBinding);
             moveToolKey = new VirtualButton(MoveToolBinding);
             rotateToolKey = new VirtualButton(RotateToolBinding);
@@ -291,7 +284,6 @@ namespace BansheeEditor
             frameKey = new VirtualButton(FrameBinding);
 
             UpdateRenderTexture(Width, Height - HeaderHeight);
-            UpdateProfilerOverlay();
         }
 
         private void OnDestroy()
@@ -471,8 +463,6 @@ namespace BansheeEditor
                         DuplicateSelection();
                     else if (VirtualInput.IsButtonDown(EditorApplication.DeleteKey))
                         DeleteSelection();
-                    else if (VirtualInput.IsButtonDown(toggleProfilerOverlayKey))
-                        EditorSettings.SetBool(ProfilerOverlayActiveKey, !EditorSettings.GetBool(ProfilerOverlayActiveKey));
                     else if(VirtualInput.IsButtonDown(viewToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.View;
                     else if(VirtualInput.IsButtonDown(moveToolKey))
@@ -488,7 +478,6 @@ namespace BansheeEditor
             if (editorSettingsHash != EditorSettings.Hash)
             {
                 UpdateButtonStates();
-                UpdateProfilerOverlay();
                 editorSettingsHash = EditorSettings.Hash;
             }
 
@@ -821,37 +810,6 @@ namespace BansheeEditor
             moveSnapInput.Value = Handles.RotateSnapAmount.Degrees;
         }
 
-        /// <summary>
-        /// Activates or deactivates the profiler overlay according to current editor settings.
-        /// </summary>
-        private void UpdateProfilerOverlay()
-        {
-            if (EditorSettings.GetBool(ProfilerOverlayActiveKey))
-            {
-                if (activeProfilerOverlay == null)
-                {
-                    SceneObject profilerSO = new SceneObject("EditorProfilerOverlay");
-                    profilerCamera = profilerSO.AddComponent<Camera>();
-                    profilerCamera.Viewport.Target = renderTexture;
-                    profilerCamera.Viewport.ClearFlags = ClearFlags.Empty;
-                    profilerCamera.Priority = 1;
-                    profilerCamera.Layers = 0;
-                    profilerCamera.RenderSettings.EnableHDR = false;
-
-                    activeProfilerOverlay = profilerSO.AddComponent<ProfilerOverlay>();
-                }
-            }
-            else
-            {
-                if (activeProfilerOverlay != null)
-                {
-                    activeProfilerOverlay.SceneObject.Destroy();
-                    activeProfilerOverlay = null;
-                    profilerCamera = null;
-                }
-            }
-        }
-
         /// <summary>
         /// Creates the scene camera and updates the render texture. Should be called at least once before using the
         /// scene view. Should be called whenever the window is resized.
@@ -912,9 +870,6 @@ namespace BansheeEditor
             // render target destroy/create cycle for every single pixel.
 
             camera.AspectRatio = width / (float)height;
-
-            if (profilerCamera != null)
-                profilerCamera.Viewport.Target = renderTexture;
         }
 
         /// <summary>

+ 2 - 149
Source/Scripting/MBansheeEngine/GUI/GUIContent.cs

@@ -8,47 +8,8 @@ namespace BansheeEngine
      *  @{
      */
 
-    /// <summary>
-    /// Type of GUI element states.
-    /// </summary>
-    public enum GUIElementState
+    public partial struct GUIContent
     {
-        /// <summary>Normal state when button is not being iteracted with.</summary>
-        Normal = 0x01,
-        /// <summary>State when pointer is hovering over the button.</summary>
-        Hover = 0x02,
-        /// <summary>State when button is being clicked.</summary>
-        Active = 0x04,
-        /// <summary>State when button has been selected.</summary>
-        Focused = 0x08,
-        /// <summary>Normal state when button is not being iteracted with and is in "on" state.</summary>
-        NormalOn = 0x11,
-        /// <summary>State when pointer is hovering over the button and is in "on" state.</summary>
-        HoverOn = 0x12,
-        /// <summary>State when button is being clicked and is in "on" state.</summary>
-        ActiveOn = 0x14,
-        /// <summary>State when button has been selected and is in "on" state.</summary>
-        FocusedOn = 0x18
-    };
-
-    /// <summary>
-    /// Holds data used for displaying content in a GUIElement. Content can consist of a string, image, a tooltip or none 
-    /// of those.
-    /// </summary>
-    public sealed class GUIContent
-    {
-        private LocString text;
-        private LocString tooltip;
-        private GUIContentImages images;
-
-        /// <summary>
-        /// Returns string content (if any).
-        /// </summary>
-        public LocString Text
-        {
-            get { return text; }
-        }
-
         /// <summary>
         /// Returns image content (if any).
         /// </summary>
@@ -77,80 +38,6 @@ namespace BansheeEngine
             }
         }
 
-        /// <summary>
-        /// Returns tooltip content (if any).
-        /// </summary>
-        public LocString Tooltip
-        {
-            get { return tooltip; }
-        }
-
-        /// <summary>
-        /// Constructs content with just a string.
-        /// </summary>
-        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
-        public GUIContent(LocString text)
-        {
-            this.text = text;
-        }
-
-        /// <summary>
-        /// Constructs content with a string and a tooltip.
-        /// </summary>
-        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
-        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.</param>
-        public GUIContent(LocString text, LocString tooltip)
-        {
-            this.text = text;
-            this.tooltip = tooltip;
-        }
-
-        /// <summary>
-        /// Constructs content with just an image.
-        /// </summary>
-        /// <param name="image">Image to be displayed on top of the GUI element.</param>
-        public GUIContent(GUIContentImages image)
-        {
-            this.images = image;
-        }
-
-        /// <summary>
-        /// Constructs content with an image and a tooltip.
-        /// </summary>
-        /// <param name="image">Image to be displayed on top of the GUI element.</param>
-        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.</param>
-        public GUIContent(GUIContentImages image, LocString tooltip)
-        {
-            this.images = image;
-            this.tooltip = tooltip;
-        }
-
-        /// <summary>
-        /// Constructs content with a string and an image.
-        /// </summary>
-        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
-        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the right or to the 
-        ///                     left of the text depending on active GUI style.</param>
-        public GUIContent(LocString text, GUIContentImages image)
-        {
-            this.text = text;
-            this.images = image;
-        }
-
-        /// <summary>
-        /// Constructs content with a string, an image and a tooltip.
-        /// </summary>
-        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
-        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the right or to the 
-        ///                     left of the text depending on active GUI style.</param>
-        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.</param>
-        public GUIContent(LocString text, GUIContentImages image, LocString tooltip)
-        {
-            this.text = text;
-            this.images = image;
-            this.tooltip = tooltip;
-        }
-
         /// <summary>
         /// Implicitly converts a localized string into a GUI content containing only text.
         /// </summary>
@@ -172,33 +59,8 @@ namespace BansheeEngine
         }
     }
 
-    /// <summary>
-    /// Contains separate GUI content images for every possible GUI element state.
-    /// </summary>
-    public sealed class GUIContentImages
+    public partial struct GUIContentImages
     {
-        /// <summary>
-        /// Creates an empty content image object referencing no images.
-        /// </summary>
-        public GUIContentImages()
-        { }
-
-        /// <summary>
-        /// Creates a new object where content images for all states are the same.
-        /// </summary>
-        /// <param name="image">Image to assign to all states.</param>
-        public GUIContentImages(SpriteTexture image)
-        {
-            normal = image;
-            hover = image;
-            active = image;
-            focused = image;
-            normalOn = image;
-            hoverOn = image;
-            activeOn = image;
-            focusedOn = image;
-        }
-
         /// <summary>
         /// Creates a new object where content images for on and off states are different.
         /// </summary>
@@ -225,15 +87,6 @@ namespace BansheeEngine
         {
             return new GUIContentImages(image);
         }
-
-        public SpriteTexture normal;
-        public SpriteTexture hover;
-        public SpriteTexture active;
-        public SpriteTexture focused;
-        public SpriteTexture normalOn;
-        public SpriteTexture hoverOn;
-        public SpriteTexture activeOn;
-        public SpriteTexture focusedOn;
     }
 
     /** @} */

+ 3 - 56
Source/Scripting/MBansheeEngine/GUI/LocString.cs

@@ -5,43 +5,12 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI_Engine
+    /** @addtogroup GUI
      *  @{
      */
 
-    /// <summary>
-    /// Handle to a localized string.
-    /// </summary>
-    public sealed class LocString : ScriptObject
+    public partial class LocString
     {
-        /// <summary>
-        /// Creates a new empty localized string.
-        /// </summary>
-        public LocString()
-        {
-            Internal_CreateInstance(this, "", 0);
-        }
-
-        /// <summary>
-        /// Creates a new empty localized string.
-        /// </summary>
-        /// <param name="tableId">Unique identifier of the string table to retrieve the string from.</param>
-        public LocString(int tableId)
-        {
-            Internal_CreateInstance(this, "", tableId);
-        }
-
-        /// <summary>
-        /// Creates a new localized string with the specified identifier. If the identifier doesn't previously exist in 
-        /// the string table, identifier value will also be used for initializing the default language version of the string.
-        /// </summary>
-        /// <param name="identifier">String you can use for later referencing the localized string.</param>
-        /// <param name="tableId">Unique identifier of the string table to retrieve the string from.</param>
-        public LocString(string identifier, int tableId = 0)
-        {
-            Internal_CreateInstance(this, identifier, tableId);
-        }
-
         /// <summary>
         /// Converts a normal string into a localized string by using the normal string as the identifier.
         /// </summary>
@@ -59,30 +28,8 @@ namespace BansheeEngine
         /// <returns>Translated text for the currently active language.</returns>
         public static explicit operator string(LocString text)
         {
-            string value;
-            Internal_GetValue(text.mCachedPtr, out value);
-            return value;
+            return Internal_getValue(text.mCachedPtr);
         }
-
-        /// <summary>
-        /// Sets a value of a string parameter. Parameters are specified as bracketed values within the string itself 
-        /// (for example {0}, {1}) etc. Use ^ as an escape character.
-        /// </summary>
-        /// <param name="idx">Index of the parameter to set.</param>
-        /// <param name="value">Value to insert at the parameter's position.</param>
-        public void SetParameter(int idx, string value)
-        {
-            Internal_SetParameter(mCachedPtr, idx, value);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(LocString instance, string identifier, int tableId);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetParameter(IntPtr nativeInstance, int idx, string identifier);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetValue(IntPtr nativeInstance, out string value);
     }
 
     /** @} */

+ 83 - 0
Source/Scripting/MBansheeEngine/Generated/GUIContent.generated.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+	/** @addtogroup GUI
+	 *  @{
+	 */
+
+	/// <summary>
+	/// Holds data used for displaying content in a GUIElement. Content can consist of a string, image, a tooltip or none  of 
+	/// those.
+	/// </summary>
+	[StructLayout(LayoutKind.Sequential), SerializeObject]
+	public partial struct GUIContent
+	{
+		/// <summary>Initializes the struct with default values.</summary>
+		public static GUIContent Default()
+		{
+			GUIContent value = new GUIContent();
+			value.text = null;
+			value.images = new GUIContentImages();
+			value.tooltip = null;
+
+			return value;
+		}
+
+		/// <summary>Constructs content with just a string.</summary>
+		public GUIContent(LocString text)
+		{
+			this.text = text;
+			this.images = new GUIContentImages();
+			this.tooltip = null;
+		}
+
+		/// <summary>Constructs content with a string and a tooltip.</summary>
+		public GUIContent(LocString text, LocString tooltip)
+		{
+			this.text = text;
+			this.images = new GUIContentImages();
+			this.tooltip = tooltip;
+		}
+
+		/// <summary>Constructs content with just an image.</summary>
+		public GUIContent(GUIContentImages image)
+		{
+			this.text = null;
+			this.images = image;
+			this.tooltip = null;
+		}
+
+		/// <summary>Constructs content with an image and a tooltip.</summary>
+		public GUIContent(GUIContentImages image, LocString tooltip)
+		{
+			this.text = null;
+			this.images = image;
+			this.tooltip = tooltip;
+		}
+
+		/// <summary>Constructs content with a string and an image.</summary>
+		public GUIContent(LocString text, GUIContentImages image)
+		{
+			this.text = text;
+			this.images = image;
+			this.tooltip = null;
+		}
+
+		/// <summary>Constructs content with a string, an image and a tooltip.</summary>
+		public GUIContent(LocString text, GUIContentImages image, LocString tooltip)
+		{
+			this.text = text;
+			this.images = image;
+			this.tooltip = tooltip;
+		}
+
+		public LocString text;
+		public GUIContentImages images;
+		public LocString tooltip;
+	}
+
+	/** @} */
+}

+ 54 - 0
Source/Scripting/MBansheeEngine/Generated/GUIContentImages.generated.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+	/** @addtogroup GUI
+	 *  @{
+	 */
+
+	/// <summary>Contains separate GUI content images for every possible GUI element state.</summary>
+	[StructLayout(LayoutKind.Sequential), SerializeObject]
+	public partial struct GUIContentImages
+	{
+		/// <summary>Initializes the struct with default values.</summary>
+		public static GUIContentImages Default()
+		{
+			GUIContentImages value = new GUIContentImages();
+			value.normal = null;
+			value.hover = null;
+			value.active = null;
+			value.focused = null;
+			value.normalOn = null;
+			value.hoverOn = null;
+			value.activeOn = null;
+			value.focusedOn = null;
+
+			return value;
+		}
+
+		public GUIContentImages(SpriteTexture image)
+		{
+			this.normal = image;
+			this.hover = image;
+			this.active = image;
+			this.focused = image;
+			this.normalOn = image;
+			this.hoverOn = image;
+			this.activeOn = image;
+			this.focusedOn = image;
+		}
+
+		public SpriteTexture normal;
+		public SpriteTexture hover;
+		public SpriteTexture active;
+		public SpriteTexture focused;
+		public SpriteTexture normalOn;
+		public SpriteTexture hoverOn;
+		public SpriteTexture activeOn;
+		public SpriteTexture focusedOn;
+	}
+
+	/** @} */
+}

+ 37 - 0
Source/Scripting/MBansheeEngine/Generated/GUIElementState.generated.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+	/** @addtogroup GUI
+	 *  @{
+	 */
+
+	/// <summary>Type of GUI element states.</summary>
+	public enum GUIElementState
+	{
+		/// <summary>Same as Hover, if the element is also in the "on" state.</summary>
+		HoverOn = 258,
+		/// <summary>Normal state when element is not being iteracted with.</summary>
+		Normal = 1,
+		/// <summary>Same as Normal, if the element is also in the "on" state.</summary>
+		NormalOn = 257,
+		/// <summary>State when pointer is hovering over the element.</summary>
+		Hover = 2,
+		/// <summary>State when element is being clicked.</summary>
+		Active = 4,
+		/// <summary>State when the element has input focus and pointer is hovering over the element.</summary>
+		FocusedHover = 16,
+		/// <summary>State when the element has input focus and pointer is not hovering over the element.</summary>
+		Focused = 8,
+		/// <summary>Same as Active, if the element is also in the "on" state.</summary>
+		ActiveOn = 260,
+		/// <summary>Same as Focused, if the element is also in the "on" state.</summary>
+		FocusedOn = 264,
+		/// <summary>Same as FocusedHover, if the element is also in the "on" state.</summary>
+		FocusedHoverOn = 272
+	}
+
+	/** @} */
+}

+ 86 - 0
Source/Scripting/MBansheeEngine/Generated/HString.generated.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+	/** @addtogroup Localization
+	 *  @{
+	 */
+
+	/// <summary>
+	/// String handle. Provides a wrapper around an Unicode string, primarily for localization purposes.
+	///
+	/// Actual value for this string is looked up in a global string table based on the provided identifier string and  
+	/// currently active language. If such value doesn't exist then the identifier is used as is.
+	///
+	/// Use {0}, {1}, etc. in the string value for values that might change dynamically.
+	/// </summary>
+	public partial class LocString : ScriptObject
+	{
+		private LocString(bool __dummy0) { }
+
+		/// <summary>
+		/// Creates a new localized string with the specified identifier. If the identifier doesn't previously exist in the  
+		/// string table, identifier value will also be used for initializing the default language version of the string.
+		/// </summary>
+		/// <param name="identifier">String you can use for later referencing the localized string.</param>
+		/// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
+		public LocString(string identifier, uint stringTableId = 0)
+		{
+			Internal_HString(this, identifier, stringTableId);
+		}
+
+		/// <summary>
+		/// Creates a new localized string with the specified identifier and sets the default language version of the  string. If 
+		/// a string with that identifier already exists default language string will be updated.
+		/// </summary>
+		/// <param name="identifier">String you can use for later referencing the localized string.</param>
+		/// <param name="defaultString">
+		/// Default string to assign to the specified identifier. Language to which it will be  assigned depends on the 
+		/// StringTable::DEFAULT_LANGUAGE value.
+		/// </param>
+		/// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
+		public LocString(string identifier, string defaultString, uint stringTableId = 0)
+		{
+			Internal_HString0(this, identifier, defaultString, stringTableId);
+		}
+
+		/// <summary>Creates a new empty localized string.</summary>
+		/// <param name="stringTableId">Unique identifier of the string table to retrieve the string from.</param>
+		public LocString(uint stringTableId)
+		{
+			Internal_HString1(this, stringTableId);
+		}
+
+		/// <summary>Creates a new empty localized string.</summary>
+		public LocString()
+		{
+			Internal_HString2(this);
+		}
+
+		/// <summary>
+		/// Sets a value of a string parameter. Parameters are specified as bracketed values within the string itself  (for 
+		/// example {0}, {1}) etc. Use ^ as an escape character.
+		/// </summary>
+		public void SetParameter(uint idx, string value)
+		{
+			Internal_setParameter(mCachedPtr, idx, value);
+		}
+
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_HString(LocString managedInstance, string identifier, uint stringTableId);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_HString0(LocString managedInstance, string identifier, string defaultString, uint stringTableId);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_HString1(LocString managedInstance, uint stringTableId);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_HString2(LocString managedInstance);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern string Internal_getValue(IntPtr thisPtr);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_setParameter(IntPtr thisPtr, uint idx, string value);
+	}
+
+	/** @} */
+}

+ 0 - 54
Source/Scripting/MBansheeEngine/Interop/ProfilerOverlayInternal.cs

@@ -1,54 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-
-    /// <summary>
-    /// Wrapper around the native ProfilerOverlay class.
-    /// <see cref="ProfilerOverlay"/>
-    /// </summary>
-    internal class ProfilerOverlayInternal : ScriptObject
-    {
-        internal ProfilerOverlayInternal(Camera camera)
-        {
-            IntPtr ptr = IntPtr.Zero;
-            if (camera != null)
-                ptr = camera.GetCachedPtr();
-
-            Internal_CreateInstance(this, ptr);
-        }
-
-        public void SetType(ProfilerOverlayType type)
-        {
-            Internal_SetType(mCachedPtr, type);
-        }
-
-        internal void Update()
-        {
-            Internal_Update(mCachedPtr);
-        }
-
-        internal void Destroy()
-        {
-            Internal_DestroyInstance(mCachedPtr);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(ProfilerOverlayInternal instance, IntPtr camera);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetType(IntPtr instance, ProfilerOverlayType type);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Update(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_DestroyInstance(IntPtr instance);
-    }
-
-    /** @endcond */
-}

+ 0 - 2
Source/Scripting/MBansheeEngine/MBansheeEngine.csproj

@@ -110,8 +110,6 @@
     <Compile Include="Utility\PixelUtility.cs" />
     <Compile Include="Utility\PlainText.cs" />
     <Compile Include="Scene\Prefab.cs" />
-    <Compile Include="Utility\ProfilerOverlay.cs" />
-    <Compile Include="Interop\ProfilerOverlayInternal.cs" />
     <Compile Include="Interop\Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Math\Quaternion.cs" />

+ 0 - 62
Source/Scripting/MBansheeEngine/Utility/ProfilerOverlay.cs

@@ -1,62 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-namespace BansheeEngine
-{
-    /** @addtogroup Utility
-     *  @{
-     */
-
-    /// <summary>
-    /// Determines type of data to display on the profiler overlay.
-    /// </summary>
-    public enum ProfilerOverlayType // Note: Must match the C++ enum ProfilerOverlayType
-	{
-		CPUSamples,
-		GPUSamples
-	};
-
-    /// <summary>
-    /// Component that displays a profiler overlay on the main game window.
-    /// </summary>
-    [RunInEditor]
-    public sealed class ProfilerOverlay : ManagedComponent
-    {
-        private ProfilerOverlayInternal impl;
-
-        /// <summary>
-        /// Controls whether the overlay is getting updated or not.
-        /// </summary>
-        public bool Paused { get; set; }
-
-        /// <summary>
-        /// Changes the type of data displayed by the overlay.
-        /// </summary>
-        /// <param name="type">Type that determines the type of data to display.</param>
-        public void SetType(ProfilerOverlayType type)
-        {
-            impl.SetType(type);   
-        }
-
-        private void OnReset()
-        {
-            if (impl != null)
-                impl.Destroy();
-
-            Camera cam = SceneObject.GetComponent<Camera>();
-            impl = new ProfilerOverlayInternal(cam);
-        }
-
-        private void OnUpdate()
-        {
-            if(!Paused)
-                impl.Update();
-        }
-
-        private void OnDestroy()
-        {
-            impl.Destroy();
-        }
-    }
-
-    /** @} */
-}

+ 3 - 3
Source/Scripting/SBansheeEditor/BsGUIGameObjectField.cpp

@@ -261,7 +261,7 @@ namespace bs
 
 		if (mType == sceneObjectClass->getFullName()) // A scene object
 		{
-			setValue(draggedSceneObjects->objects[0], true);
+			setValue(static_object_cast<GameObject>(draggedSceneObjects->objects[0]), true);
 		}
 		else // A component
 		{
@@ -286,7 +286,7 @@ namespace bs
 						{
 							if (providedClass->isSubClassOf(acceptedClass))
 							{
-								setValue(managedComponent, true);
+								setValue(static_object_cast<GameObject>(managedComponent), true);
 							}
 						}
 					}
@@ -297,7 +297,7 @@ namespace bs
 							continue;
 
 						if (info->monoClass->isSubClassOf(acceptedClass))
-							setValue(component, true);
+							setValue(static_object_cast<GameObject>(component), true);
 					}
 				}
 			}

+ 6 - 8
Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.cpp

@@ -5,11 +5,11 @@
 #include "BsMonoClass.h"
 #include "BsMonoMethod.h"
 #include "BsMonoUtil.h"
-#include "Wrappers/BsScriptGUIContentImages.h"
 #include "BsScriptResourceManager.h"
 #include "Wrappers/GUI/BsScriptGUISkin.h"
 
-#include "BsScriptSpriteTexture.generated.h"
+#include "Generated/BsScriptGUIContentImages.generated.h"
+#include "Generated/BsScriptSpriteTexture.generated.h"
 
 namespace bs
 {
@@ -71,18 +71,16 @@ namespace bs
 		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
-	MonoObject* ScriptEditorBuiltin::internal_GetSceneWindowIcon(SceneWindowIcon icon)
+	void ScriptEditorBuiltin::internal_GetSceneWindowIcon(SceneWindowIcon icon, __GUIContentImagesInterop* output)
 	{
 		GUIContentImages images = BuiltinEditorResources::instance().getSceneWindowIcon(icon);
-
-		return ScriptGUIContentImages::getManaged(images);
+		*output = ScriptGUIContentImages::toInterop(images);
 	}
 
-	MonoObject* ScriptEditorBuiltin::internal_GetAnimationWindowIcon(AnimationWindowIcon icon)
+	void ScriptEditorBuiltin::internal_GetAnimationWindowIcon(AnimationWindowIcon icon, __GUIContentImagesInterop* output)
 	{
 		GUIContentImages images = BuiltinEditorResources::instance().getAnimationWindowIcon(icon);
-
-		return ScriptGUIContentImages::getManaged(images);
+		*output = ScriptGUIContentImages::toInterop(images);
 	}
 
 	MonoObject* ScriptEditorBuiltin::internal_GetLogIcon(LogMessageIcon icon, int size, bool dark)

+ 4 - 2
Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.h

@@ -8,6 +8,8 @@
 
 namespace bs
 {
+	struct __GUIContentImagesInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -32,8 +34,8 @@ namespace bs
 		static MonoObject* internal_GetToolbarIcon(ToolbarIcon icon);
 		static MonoObject* internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
 		static MonoObject* internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
-		static MonoObject* internal_GetSceneWindowIcon(SceneWindowIcon icon);
-		static MonoObject* internal_GetAnimationWindowIcon(AnimationWindowIcon icon);
+		static void internal_GetSceneWindowIcon(SceneWindowIcon icon, __GUIContentImagesInterop* output);
+		static void internal_GetAnimationWindowIcon(AnimationWindowIcon icon, __GUIContentImagesInterop* output);
 		static MonoObject* internal_GetLogIcon(LogMessageIcon icon, int size, bool dark);
 		static MonoObject* internal_GetEditorIcon(EditorIcon icon);
 

+ 3 - 2
Source/Scripting/SBansheeEditor/Wrappers/BsScriptEditorWindow.cpp

@@ -14,11 +14,12 @@
 #include "BsMonoAssembly.h"
 #include "BsScriptObjectManager.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
-#include "Wrappers/BsScriptHString.h"
 #include "Platform/BsPlatform.h"
 #include "Input/BsInput.h"
 #include "Wrappers/BsScriptUndoRedo.h"
 
+#include "Generated/BsScriptHString.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -402,7 +403,7 @@ namespace bs
 
 				if (scriptHString != nullptr)
 				{
-					mDisplayName = HString(scriptHString->getInternalValue());
+					mDisplayName = HString(*scriptHString->getInternal());
 					parentContainer.refreshWidgetNames();
 				}
 			}

+ 3 - 2
Source/Scripting/SBansheeEditor/Wrappers/BsScriptModalWindow.cpp

@@ -9,10 +9,11 @@
 #include "BsMonoUtil.h"
 #include "BsMonoAssembly.h"
 #include "BsScriptObjectManager.h"
-#include "Wrappers/BsScriptHString.h"
 #include "RenderAPI/BsRenderWindow.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
 
+#include "Generated/BsScriptHString.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -64,7 +65,7 @@ namespace bs
 		if (title != nullptr)
 		{
 			ScriptHString* textScript = ScriptHString::toNative(title);
-			titleStr = textScript->getInternalValue();
+			titleStr = *textScript->getInternal();
 		}
 
 		thisPtr->mModalWindow->setTitle(titleStr);

+ 4 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIColorField.cpp

@@ -9,7 +9,8 @@
 #include "GUI/BsGUIColorField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -33,7 +34,7 @@ namespace bs
 		onClickedThunk = (OnClickedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnClicked")->getThunk();
 	}
 
-	void ScriptGUIColorField::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIColorField::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -48,7 +49,7 @@ namespace bs
 		GUIColorField* guiField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiField = GUIColorField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIColorField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -26,7 +28,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIColorField* nativeInstance, Color* output);

+ 5 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIEnumField.cpp

@@ -10,8 +10,9 @@
 #include "GUI/BsGUIListBoxField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -40,7 +41,7 @@ namespace bs
 	}
 
 	void ScriptGUIEnumField::internal_createInstance(MonoObject* instance, MonoArray* names, MonoArray* values, 
-		bool multiselect, MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
+		bool multiselect, __GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -59,7 +60,7 @@ namespace bs
 		GUIListBoxField* guiField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiField = GUIListBoxField::create(nativeNames, multiselect, nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIEnumField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -37,7 +39,7 @@ namespace bs
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoArray* names, MonoArray* values, bool multiselect,
-			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+			__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static UINT64 internal_getValue(ScriptGUIEnumField* nativeInstance);
 		static void internal_setValue(ScriptGUIEnumField* nativeInstance, UINT64 value);

+ 4 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIFloatField.cpp

@@ -9,7 +9,8 @@
 #include "GUI/BsGUIFloatField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -39,7 +40,7 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUIFloatField::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIFloatField::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -54,7 +55,7 @@ namespace bs
 		GUIFloatField* guiFloatField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiFloatField = GUIFloatField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIFloatField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -35,7 +37,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static float internal_getValue(ScriptGUIFloatField* nativeInstance);

+ 6 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIGameObjectField.cpp

@@ -8,7 +8,6 @@
 #include "BsGUIGameObjectField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "Wrappers/BsScriptGameObject.h"
 #include "Wrappers/BsScriptSceneObject.h"
 #include "Wrappers/BsScriptComponent.h"
@@ -18,6 +17,9 @@
 #include "BsScriptGameObjectManager.h"
 #include "Reflection/BsRTTIType.h"
 
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -40,8 +42,8 @@ namespace bs
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("DoOnChanged", 1)->getThunk();
 	}
 
-	void ScriptGUIGameObjectField::internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
-		MonoString* style, MonoArray* guiOptions, bool withTitle)
+	void ScriptGUIGameObjectField::internal_createInstance(MonoObject* instance, MonoReflectionType* type, 
+		__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -61,7 +63,7 @@ namespace bs
 		GUIGameObjectField* guiGameObjectField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiGameObjectField = GUIGameObjectField::create(typeNamespace, typeName, nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIGameObjectField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, 
+		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, __GUIContentInterop* title, 
 			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIGameObjectField* nativeInstance, MonoObject** output);

+ 5 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIIntField.cpp

@@ -9,7 +9,9 @@
 #include "GUI/BsGUIIntField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -39,7 +41,7 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUIIntField::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth, 
+	void ScriptGUIIntField::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth, 
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -54,7 +56,7 @@ namespace bs
 		GUIIntField* guiIntField = nullptr;
 		if(withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiIntField = GUIIntField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIIntField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static INT32 internal_getValue(ScriptGUIIntField* nativeInstance);

+ 8 - 7
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.cpp

@@ -9,10 +9,11 @@
 #include "GUI/BsGUIListBoxField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include <climits>
 
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -40,8 +41,8 @@ namespace bs
 		onSelectionChangedThunk = (OnSelectionChangedThunkDef)metaData.scriptClass->getMethod("DoOnSelectionChanged", 1)->getThunk();
 	}
 
-	void ScriptGUIListBoxField::internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, MonoObject* title, 
-		UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
+	void ScriptGUIListBoxField::internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, 
+		__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -64,14 +65,14 @@ namespace bs
 			else
 			{
 				ScriptHString* textScript = ScriptHString::toNative(stringManaged);
-				nativeElements.push_back(textScript->getInternalValue());
+				nativeElements.push_back(*textScript->getInternal());
 			}
 		}
 
 		GUIListBoxField* guiField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiField = GUIListBoxField::create(nativeElements, multiselect, nativeContent, titleWidth, options, styleName);
 		}
 		else
@@ -126,7 +127,7 @@ namespace bs
 			else
 			{
 				ScriptHString* textScript = ScriptHString::toNative(stringManaged);
-				nativeElements.push_back(textScript->getInternalValue());
+				nativeElements.push_back(*textScript->getInternal());
 			}
 		}
 

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -31,7 +33,7 @@ namespace bs
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 		static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, 
-			MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
+			__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_setElements(ScriptGUIListBoxField* nativeInstance, MonoArray* elements);
 		static UINT32 internal_getValue(ScriptGUIListBoxField* nativeInstance);

+ 5 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIResourceField.cpp

@@ -10,11 +10,12 @@
 #include "BsGUIResourceField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "Wrappers/BsScriptResource.h"
 #include "BsScriptResourceManager.h"
 #include "Wrappers/BsScriptResourceRef.h"
 
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -39,8 +40,8 @@ namespace bs
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("DoOnChanged", 1)->getThunk();
 	}
 
-	void ScriptGUIResourceField::internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
-		MonoString* style, MonoArray* guiOptions, bool withTitle)
+	void ScriptGUIResourceField::internal_createInstance(MonoObject* instance, MonoReflectionType* type, 
+		__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -59,7 +60,7 @@ namespace bs
 		GUIResourceField* guiResourceField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiResourceField = GUIResourceField::create(typeNamespace, typeName, nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIResourceField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, 
+		static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, __GUIContentInterop* title, 
 			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIResourceField* nativeInstance, MonoObject** output);

+ 5 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUISliderField.cpp

@@ -10,7 +10,8 @@
 #include "GUI/BsGUISliderField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -38,8 +39,8 @@ namespace bs
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("DoOnChanged", 1)->getThunk();
 	}
 
-	void ScriptGUISliderField::internal_createInstance(MonoObject* instance, float min, float max, MonoObject* title, UINT32 titleWidth,
-		MonoString* style, MonoArray* guiOptions, bool withTitle)
+	void ScriptGUISliderField::internal_createInstance(MonoObject* instance, float min, float max, 
+		__GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -53,7 +54,7 @@ namespace bs
 		GUISliderField* guiSliderField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiSliderField = GUISliderField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 4 - 2
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUISliderField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -30,8 +32,8 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, float min, float max, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
+		static void internal_createInstance(MonoObject* instance, float min, float max, __GUIContentInterop* title, 
+			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static float internal_getValue(ScriptGUISliderField* nativeInstance);
 		static float internal_getStep(ScriptGUISliderField* nativeInstance);

+ 5 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextField.cpp

@@ -9,7 +9,8 @@
 #include "GUI/BsGUITextField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -36,8 +37,8 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUITextField::internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
-		MonoString* style, MonoArray* guiOptions, bool withTitle)
+	void ScriptGUITextField::internal_createInstance(MonoObject* instance, bool multiline, __GUIContentInterop* title, 
+		UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
 
@@ -51,7 +52,7 @@ namespace bs
 		GUITextField* guiField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiField = GUITextField::create(multiline, nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 4 - 2
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,8 +35,8 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, bool multiline, MonoObject* title, UINT32 titleWidth,
-			MonoString* style, MonoArray* guiOptions, bool withTitle);
+		static void internal_createInstance(MonoObject* instance, bool multiline, __GUIContentInterop* title, 
+			UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUITextField* nativeInstance, MonoString** output);
 		static void internal_setValue(ScriptGUITextField* nativeInstance, MonoString* value);

+ 4 - 4
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextureField.cpp

@@ -9,11 +9,11 @@
 #include "BsGUITextureField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "BsScriptResourceManager.h"
 #include "Wrappers/BsScriptResourceRef.h"
 
-#include "BsScriptTexture.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
+#include "Generated/BsScriptTexture.generated.h"
 
 using namespace std::placeholders;
 
@@ -39,7 +39,7 @@ namespace bs
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnChanged", 1)->getThunk();
 	}
 
-	void ScriptGUITextureField::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUITextureField::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -54,7 +54,7 @@ namespace bs
 		GUITextureField* guiTextureField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiTextureField = GUITextureField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUITextureField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -34,7 +36,7 @@ namespace bs
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUITextureField* nativeInstance, MonoObject** output);

+ 5 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIToggleField.cpp

@@ -9,7 +9,9 @@
 #include "GUI/BsGUIToggleField.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
 
 using namespace std::placeholders;
 
@@ -33,7 +35,7 @@ namespace bs
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("DoOnChanged", 1)->getThunk();
 	}
 
-	void ScriptGUIToggleField::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIToggleField::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -48,7 +50,7 @@ namespace bs
 		GUIToggleField* guiField = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			guiField = GUIToggleField::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIToggleField.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -30,7 +32,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIToggleField* nativeInstance, bool* output);

+ 5 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector2Field.cpp

@@ -10,9 +10,11 @@
 #include "GUI/BsGUIVector2Field.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "Wrappers/BsScriptVector.h"
 
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -38,7 +40,7 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUIVector2Field::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIVector2Field::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -53,7 +55,7 @@ namespace bs
 		GUIVector2Field* field = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			field = GUIVector2Field::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector2Field.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIVector2Field* nativeInstance, Vector2* output);

+ 4 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector3Field.cpp

@@ -10,9 +10,10 @@
 #include "GUI/BsGUIVector3Field.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "Wrappers/BsScriptVector.h"
 
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -38,7 +39,7 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUIVector3Field::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIVector3Field::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -53,7 +54,7 @@ namespace bs
 		GUIVector3Field* field = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			field = GUIVector3Field::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector3Field.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIVector3Field* nativeInstance, Vector3* output);

+ 4 - 3
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector4Field.cpp

@@ -9,9 +9,10 @@
 #include "GUI/BsGUIVector4Field.h"
 #include "GUI/BsGUIOptions.h"
 #include "GUI/BsGUIContent.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 #include "Wrappers/BsScriptVector.h"
 
+#include "Generated/BsScriptGUIContent.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -37,7 +38,7 @@ namespace bs
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 	}
 
-	void ScriptGUIVector4Field::internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+	void ScriptGUIVector4Field::internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 		MonoString* style, MonoArray* guiOptions, bool withTitle)
 	{
 		GUIOptions options;
@@ -52,7 +53,7 @@ namespace bs
 		GUIVector4Field* field = nullptr;
 		if (withTitle)
 		{
-			GUIContent nativeContent(ScriptGUIContent::getText(title), ScriptGUIContent::getImage(title), ScriptGUIContent::getTooltip(title));
+			GUIContent nativeContent = ScriptGUIContent::fromInterop(*title);
 			field = GUIVector4Field::create(nativeContent, titleWidth, options, styleName);
 		}
 		else

+ 3 - 1
Source/Scripting/SBansheeEditor/Wrappers/GUI/BsScriptGUIVector4Field.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEditor
 	 *  @{
 	 */
@@ -33,7 +35,7 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 		static void internal_getValue(ScriptGUIVector4Field* nativeInstance, Vector4* output);

+ 1 - 1
Source/Scripting/SBansheeEngine/BsManagedComponent.cpp

@@ -328,7 +328,7 @@ namespace bs
 			{
 				if (component.get() == this)
 				{
-					componentHandle = component;
+					componentHandle = static_object_cast<ManagedComponent>(component);
 					break;
 				}
 			}

+ 1 - 1
Source/Scripting/SBansheeEngine/BsScriptGameObjectManager.cpp

@@ -94,7 +94,7 @@ namespace bs
 			return nullptr;
 
 		ScriptComponentBase* nativeInstance = info->createCallback(component);
-		nativeInstance->setNativeHandle(component);
+		nativeInstance->setNativeHandle(static_object_cast<GameObject>(component));
 
 		UINT64 instanceId = component->getInstanceId();
 		mScriptComponents[instanceId] = nativeInstance;

+ 0 - 8
Source/Scripting/SBansheeEngine/CMakeSources.cmake

@@ -17,7 +17,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS_GUI
 	"Wrappers/GUI/BsScriptRange.cpp"
 	"Wrappers/GUI/BsScriptStep.cpp"
 	"Wrappers/GUI/BsScriptGUIButton.cpp"
-	"Wrappers/GUI/BsScriptGUIContent.cpp"
 	"Wrappers/GUI/BsScriptGUIElementStateStyle.cpp"
 	"Wrappers/GUI/BsScriptGUIElementStyle.cpp"
 	"Wrappers/GUI/BsScriptGUIFixedSpace.cpp"
@@ -60,8 +59,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS
 	"Wrappers/BsScriptCursor.h"
 	"Wrappers/BsScriptDebug.h"
 	"Wrappers/BsScriptGameObject.h"
-	"Wrappers/BsScriptGUIContentImages.h"
-	"Wrappers/BsScriptHString.h"
 	"Wrappers/BsScriptInput.h"
 	"Wrappers/BsScriptInputConfiguration.h"
 	"Wrappers/BsScriptLogEntry.h"
@@ -69,7 +66,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS
 	"Wrappers/BsScriptPixelUtility.h"
 	"Wrappers/BsScriptPlainText.h"
 	"Wrappers/BsScriptPrefab.h"
-	"Wrappers/BsScriptProfilerOverlayInternal.h"
 	"Wrappers/BsScriptResource.h"
 	"Wrappers/BsScriptVirtualInput.h"
 	"Wrappers/BsScriptVirtualButton.h"
@@ -97,7 +93,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS_GUI
 	"Wrappers/GUI/BsScriptRange.h"
 	"Wrappers/GUI/BsScriptStep.h"
 	"Wrappers/GUI/BsScriptGUIButton.h"
-	"Wrappers/GUI/BsScriptGUIContent.h"
 	"Wrappers/GUI/BsScriptGUIElementStateStyle.h"
 	"Wrappers/GUI/BsScriptGUIElementStyle.h"
 	"Wrappers/GUI/BsScriptGUIFixedSpace.h"
@@ -142,8 +137,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS
 	"Wrappers/BsScriptCursor.cpp"
 	"Wrappers/BsScriptDebug.cpp"
 	"Wrappers/BsScriptGameObject.cpp"
-	"Wrappers/BsScriptGUIContentImages.cpp"
-	"Wrappers/BsScriptHString.cpp"
 	"Wrappers/BsScriptInput.cpp"
 	"Wrappers/BsScriptInputConfiguration.cpp"
 	"Wrappers/BsScriptLogEntry.cpp"
@@ -151,7 +144,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS
 	"Wrappers/BsScriptPixelUtility.cpp"
 	"Wrappers/BsScriptPlainText.cpp"
 	"Wrappers/BsScriptPrefab.cpp"
-	"Wrappers/BsScriptProfilerOverlayInternal.cpp"
 	"Wrappers/BsScriptVirtualInput.cpp"
 	"Wrappers/BsScriptVirtualButton.cpp"
 	"Wrappers/BsScriptVector2I.cpp"

+ 0 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptBlend1DInfo.generated.cpp

@@ -3,7 +3,6 @@
 #include "BsMonoClass.h"
 #include "BsMonoUtil.h"
 #include "BsScriptBlendClipInfo.generated.h"
-#include "BsScriptBlendClipInfo.generated.h"
 
 namespace bs
 {

+ 1 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptBlend1DInfo.generated.h

@@ -4,6 +4,7 @@
 #include "BsScriptObject.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimation.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimation.h"
+#include "BsScriptBlendClipInfo.generated.h"
 
 namespace bs
 {

+ 1 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptCJoint.generated.cpp

@@ -51,7 +51,7 @@ namespace bs
 		MonoObject* __output;
 		ScriptComponentBase* script__output = nullptr;
 		if(tmp__output)
-				script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(tmp__output);
+				script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(tmp__output));
 		if(script__output != nullptr)
 			__output = script__output->getManagedInstance();
 		else

+ 1 - 2
Source/Scripting/SBansheeEngine/Generated/BsScriptCollisionData.generated.cpp

@@ -5,7 +5,6 @@
 #include "BsScriptGameObjectManager.h"
 #include "BsScriptCCollider.generated.h"
 #include "BsScriptContactPoint.generated.h"
-#include "BsScriptContactPoint.generated.h"
 
 namespace bs
 {
@@ -69,7 +68,7 @@ namespace bs
 		{
 			ScriptComponentBase* scriptcollider = nullptr;
 			if(value.collider[i])
-						scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(value.collider[i]);
+						scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(value.collider[i]));
 				if(scriptcollider != nullptr)
 				arraycollider.set(i, scriptcollider->getManagedInstance());
 			else

+ 1 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptCollisionData.generated.h

@@ -4,6 +4,7 @@
 #include "BsScriptObject.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Physics/BsPhysicsCommon.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Physics/BsPhysicsCommon.h"
+#include "BsScriptContactPoint.generated.h"
 
 namespace bs
 {

+ 1 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptControllerColliderCollision.generated.cpp

@@ -49,7 +49,7 @@ namespace bs
 		__ControllerColliderCollisionInterop output;
 		ScriptComponentBase* scriptcollider = nullptr;
 		if(value.collider)
-				scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(value.collider);
+				scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(value.collider));
 		MonoObject* tmpcollider;
 		if(scriptcollider != nullptr)
 			tmpcollider = scriptcollider->getManagedInstance();

+ 1 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptControllerControllerCollision.generated.cpp

@@ -48,7 +48,7 @@ namespace bs
 		__ControllerControllerCollisionInterop output;
 		ScriptComponentBase* scriptcontroller = nullptr;
 		if(value.controller)
-				scriptcontroller = ScriptGameObjectManager::instance().getBuiltinScriptComponent(value.controller);
+				scriptcontroller = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(value.controller));
 		MonoObject* tmpcontroller;
 		if(scriptcontroller != nullptr)
 			tmpcontroller = scriptcontroller->getManagedInstance();

+ 72 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContent.generated.cpp

@@ -0,0 +1,72 @@
+#include "BsScriptGUIContent.generated.h"
+#include "BsMonoMethod.h"
+#include "BsMonoClass.h"
+#include "BsMonoUtil.h"
+#include "BsScriptHString.generated.h"
+#include "BsScriptHString.generated.h"
+#include "BsScriptGUIContentImages.generated.h"
+
+namespace bs
+{
+	ScriptGUIContent::ScriptGUIContent(MonoObject* managedInstance)
+		:ScriptObject(managedInstance)
+	{ }
+
+	void ScriptGUIContent::initRuntimeData()
+	{ }
+
+	MonoObject*ScriptGUIContent::box(const __GUIContentInterop& value)
+	{
+		return MonoUtil::box(metaData.scriptClass->_getInternalClass(), (void*)&value);
+	}
+
+	__GUIContentInterop ScriptGUIContent::unbox(MonoObject* value)
+	{
+		return *(__GUIContentInterop*)MonoUtil::unbox(value);
+	}
+
+	GUIContent ScriptGUIContent::fromInterop(const __GUIContentInterop& value)
+	{
+		GUIContent output;
+		SPtr<HString> tmptext;
+		ScriptHString* scripttext;
+		scripttext = ScriptHString::toNative(value.text);
+		if(scripttext != nullptr)
+			tmptext = scripttext->getInternal();
+		if(tmptext != nullptr)
+		output.text = *tmptext;
+		GUIContentImages tmpimages;
+		tmpimages = ScriptGUIContentImages::fromInterop(value.images);
+		output.images = tmpimages;
+		SPtr<HString> tmptooltip;
+		ScriptHString* scripttooltip;
+		scripttooltip = ScriptHString::toNative(value.tooltip);
+		if(scripttooltip != nullptr)
+			tmptooltip = scripttooltip->getInternal();
+		if(tmptooltip != nullptr)
+		output.tooltip = *tmptooltip;
+
+		return output;
+	}
+
+	__GUIContentInterop ScriptGUIContent::toInterop(const GUIContent& value)
+	{
+		__GUIContentInterop output;
+		MonoObject* tmptext;
+		SPtr<HString> tmptextcopy;
+		tmptextcopy = bs_shared_ptr_new<HString>(value.text);
+		tmptext = ScriptHString::create(tmptextcopy);
+		output.text = tmptext;
+		__GUIContentImagesInterop tmpimages;
+		tmpimages = ScriptGUIContentImages::toInterop(value.images);
+		output.images = tmpimages;
+		MonoObject* tmptooltip;
+		SPtr<HString> tmptooltipcopy;
+		tmptooltipcopy = bs_shared_ptr_new<HString>(value.tooltip);
+		tmptooltip = ScriptHString::create(tmptooltipcopy);
+		output.tooltip = tmptooltip;
+
+		return output;
+	}
+
+}

+ 33 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContent.generated.h

@@ -0,0 +1,33 @@
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsScriptObject.h"
+#include "../../../bsf/Source/Foundation/bsfEngine/GUI/BsGUIContent.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Localization/BsHString.h"
+#include "../../../bsf/Source/Foundation/bsfEngine/GUI/BsGUIContent.h"
+#include "BsScriptGUIContentImages.generated.h"
+
+namespace bs
+{
+	struct __GUIContentInterop
+	{
+		MonoObject* text;
+		__GUIContentImagesInterop images;
+		MonoObject* tooltip;
+	};
+
+	class BS_SCR_BE_EXPORT ScriptGUIContent : public ScriptObject<ScriptGUIContent>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContent")
+
+		static MonoObject* box(const __GUIContentInterop& value);
+		static __GUIContentInterop unbox(MonoObject* value);
+		static GUIContent fromInterop(const __GUIContentInterop& value);
+		static __GUIContentInterop toInterop(const GUIContent& value);
+
+	private:
+		ScriptGUIContent(MonoObject* managedInstance);
+
+	};
+}

+ 153 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContentImages.generated.cpp

@@ -0,0 +1,153 @@
+#include "BsScriptGUIContentImages.generated.h"
+#include "BsMonoMethod.h"
+#include "BsMonoClass.h"
+#include "BsMonoUtil.h"
+#include "BsScriptResourceManager.h"
+#include "BsScriptSpriteTexture.generated.h"
+
+namespace bs
+{
+	ScriptGUIContentImages::ScriptGUIContentImages(MonoObject* managedInstance)
+		:ScriptObject(managedInstance)
+	{ }
+
+	void ScriptGUIContentImages::initRuntimeData()
+	{ }
+
+	MonoObject*ScriptGUIContentImages::box(const __GUIContentImagesInterop& value)
+	{
+		return MonoUtil::box(metaData.scriptClass->_getInternalClass(), (void*)&value);
+	}
+
+	__GUIContentImagesInterop ScriptGUIContentImages::unbox(MonoObject* value)
+	{
+		return *(__GUIContentImagesInterop*)MonoUtil::unbox(value);
+	}
+
+	GUIContentImages ScriptGUIContentImages::fromInterop(const __GUIContentImagesInterop& value)
+	{
+		GUIContentImages output;
+		ResourceHandle<SpriteTexture> tmpnormal;
+		ScriptSpriteTexture* scriptnormal;
+		scriptnormal = ScriptSpriteTexture::toNative(value.normal);
+		if(scriptnormal != nullptr)
+			tmpnormal = scriptnormal->getHandle();
+		output.normal = tmpnormal;
+		ResourceHandle<SpriteTexture> tmphover;
+		ScriptSpriteTexture* scripthover;
+		scripthover = ScriptSpriteTexture::toNative(value.hover);
+		if(scripthover != nullptr)
+			tmphover = scripthover->getHandle();
+		output.hover = tmphover;
+		ResourceHandle<SpriteTexture> tmpactive;
+		ScriptSpriteTexture* scriptactive;
+		scriptactive = ScriptSpriteTexture::toNative(value.active);
+		if(scriptactive != nullptr)
+			tmpactive = scriptactive->getHandle();
+		output.active = tmpactive;
+		ResourceHandle<SpriteTexture> tmpfocused;
+		ScriptSpriteTexture* scriptfocused;
+		scriptfocused = ScriptSpriteTexture::toNative(value.focused);
+		if(scriptfocused != nullptr)
+			tmpfocused = scriptfocused->getHandle();
+		output.focused = tmpfocused;
+		ResourceHandle<SpriteTexture> tmpnormalOn;
+		ScriptSpriteTexture* scriptnormalOn;
+		scriptnormalOn = ScriptSpriteTexture::toNative(value.normalOn);
+		if(scriptnormalOn != nullptr)
+			tmpnormalOn = scriptnormalOn->getHandle();
+		output.normalOn = tmpnormalOn;
+		ResourceHandle<SpriteTexture> tmphoverOn;
+		ScriptSpriteTexture* scripthoverOn;
+		scripthoverOn = ScriptSpriteTexture::toNative(value.hoverOn);
+		if(scripthoverOn != nullptr)
+			tmphoverOn = scripthoverOn->getHandle();
+		output.hoverOn = tmphoverOn;
+		ResourceHandle<SpriteTexture> tmpactiveOn;
+		ScriptSpriteTexture* scriptactiveOn;
+		scriptactiveOn = ScriptSpriteTexture::toNative(value.activeOn);
+		if(scriptactiveOn != nullptr)
+			tmpactiveOn = scriptactiveOn->getHandle();
+		output.activeOn = tmpactiveOn;
+		ResourceHandle<SpriteTexture> tmpfocusedOn;
+		ScriptSpriteTexture* scriptfocusedOn;
+		scriptfocusedOn = ScriptSpriteTexture::toNative(value.focusedOn);
+		if(scriptfocusedOn != nullptr)
+			tmpfocusedOn = scriptfocusedOn->getHandle();
+		output.focusedOn = tmpfocusedOn;
+
+		return output;
+	}
+
+	__GUIContentImagesInterop ScriptGUIContentImages::toInterop(const GUIContentImages& value)
+	{
+		__GUIContentImagesInterop output;
+		ScriptResourceBase* scriptnormal;
+		scriptnormal = ScriptResourceManager::instance().getScriptResource(value.normal, true);
+		MonoObject* tmpnormal;
+		if(scriptnormal != nullptr)
+			tmpnormal = scriptnormal->getManagedInstance();
+		else
+			tmpnormal = nullptr;
+		output.normal = tmpnormal;
+		ScriptResourceBase* scripthover;
+		scripthover = ScriptResourceManager::instance().getScriptResource(value.hover, true);
+		MonoObject* tmphover;
+		if(scripthover != nullptr)
+			tmphover = scripthover->getManagedInstance();
+		else
+			tmphover = nullptr;
+		output.hover = tmphover;
+		ScriptResourceBase* scriptactive;
+		scriptactive = ScriptResourceManager::instance().getScriptResource(value.active, true);
+		MonoObject* tmpactive;
+		if(scriptactive != nullptr)
+			tmpactive = scriptactive->getManagedInstance();
+		else
+			tmpactive = nullptr;
+		output.active = tmpactive;
+		ScriptResourceBase* scriptfocused;
+		scriptfocused = ScriptResourceManager::instance().getScriptResource(value.focused, true);
+		MonoObject* tmpfocused;
+		if(scriptfocused != nullptr)
+			tmpfocused = scriptfocused->getManagedInstance();
+		else
+			tmpfocused = nullptr;
+		output.focused = tmpfocused;
+		ScriptResourceBase* scriptnormalOn;
+		scriptnormalOn = ScriptResourceManager::instance().getScriptResource(value.normalOn, true);
+		MonoObject* tmpnormalOn;
+		if(scriptnormalOn != nullptr)
+			tmpnormalOn = scriptnormalOn->getManagedInstance();
+		else
+			tmpnormalOn = nullptr;
+		output.normalOn = tmpnormalOn;
+		ScriptResourceBase* scripthoverOn;
+		scripthoverOn = ScriptResourceManager::instance().getScriptResource(value.hoverOn, true);
+		MonoObject* tmphoverOn;
+		if(scripthoverOn != nullptr)
+			tmphoverOn = scripthoverOn->getManagedInstance();
+		else
+			tmphoverOn = nullptr;
+		output.hoverOn = tmphoverOn;
+		ScriptResourceBase* scriptactiveOn;
+		scriptactiveOn = ScriptResourceManager::instance().getScriptResource(value.activeOn, true);
+		MonoObject* tmpactiveOn;
+		if(scriptactiveOn != nullptr)
+			tmpactiveOn = scriptactiveOn->getManagedInstance();
+		else
+			tmpactiveOn = nullptr;
+		output.activeOn = tmpactiveOn;
+		ScriptResourceBase* scriptfocusedOn;
+		scriptfocusedOn = ScriptResourceManager::instance().getScriptResource(value.focusedOn, true);
+		MonoObject* tmpfocusedOn;
+		if(scriptfocusedOn != nullptr)
+			tmpfocusedOn = scriptfocusedOn->getManagedInstance();
+		else
+			tmpfocusedOn = nullptr;
+		output.focusedOn = tmpfocusedOn;
+
+		return output;
+	}
+
+}

+ 35 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptGUIContentImages.generated.h

@@ -0,0 +1,35 @@
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsScriptObject.h"
+#include "../../../bsf/Source/Foundation/bsfEngine/GUI/BsGUIContent.h"
+
+namespace bs
+{
+	struct __GUIContentImagesInterop
+	{
+		MonoObject* normal;
+		MonoObject* hover;
+		MonoObject* active;
+		MonoObject* focused;
+		MonoObject* normalOn;
+		MonoObject* hoverOn;
+		MonoObject* activeOn;
+		MonoObject* focusedOn;
+	};
+
+	class BS_SCR_BE_EXPORT ScriptGUIContentImages : public ScriptObject<ScriptGUIContentImages>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContentImages")
+
+		static MonoObject* box(const __GUIContentImagesInterop& value);
+		static __GUIContentImagesInterop unbox(MonoObject* value);
+		static GUIContentImages fromInterop(const __GUIContentImagesInterop& value);
+		static __GUIContentImagesInterop toInterop(const GUIContentImages& value);
+
+	private:
+		ScriptGUIContentImages(MonoObject* managedInstance);
+
+	};
+}

+ 83 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptHString.generated.cpp

@@ -0,0 +1,83 @@
+#include "BsScriptHString.generated.h"
+#include "BsMonoMethod.h"
+#include "BsMonoClass.h"
+#include "BsMonoUtil.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Localization/BsHString.h"
+
+namespace bs
+{
+	ScriptHString::ScriptHString(MonoObject* managedInstance, const SPtr<HString>& value)
+		:ScriptObject(managedInstance), mInternal(value)
+	{
+	}
+
+	void ScriptHString::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_HString", (void*)&ScriptHString::Internal_HString);
+		metaData.scriptClass->addInternalCall("Internal_HString0", (void*)&ScriptHString::Internal_HString0);
+		metaData.scriptClass->addInternalCall("Internal_HString1", (void*)&ScriptHString::Internal_HString1);
+		metaData.scriptClass->addInternalCall("Internal_HString2", (void*)&ScriptHString::Internal_HString2);
+		metaData.scriptClass->addInternalCall("Internal_getValue", (void*)&ScriptHString::Internal_getValue);
+		metaData.scriptClass->addInternalCall("Internal_setParameter", (void*)&ScriptHString::Internal_setParameter);
+
+	}
+
+	MonoObject* ScriptHString::create(const SPtr<HString>& value)
+	{
+		if(value == nullptr) return nullptr; 
+
+		bool dummy = false;
+		void* ctorParams[1] = { &dummy };
+
+		MonoObject* managedInstance = metaData.scriptClass->createInstance("bool", ctorParams);
+		new (bs_alloc<ScriptHString>()) ScriptHString(managedInstance, value);
+		return managedInstance;
+	}
+	void ScriptHString::Internal_HString(MonoObject* managedInstance, MonoString* identifier, uint32_t stringTableId)
+	{
+		String tmpidentifier;
+		tmpidentifier = MonoUtil::monoToString(identifier);
+		SPtr<HString> instance = bs_shared_ptr_new<HString>(tmpidentifier, stringTableId);
+		new (bs_alloc<ScriptHString>())ScriptHString(managedInstance, instance);
+	}
+
+	void ScriptHString::Internal_HString0(MonoObject* managedInstance, MonoString* identifier, MonoString* defaultString, uint32_t stringTableId)
+	{
+		String tmpidentifier;
+		tmpidentifier = MonoUtil::monoToString(identifier);
+		String tmpdefaultString;
+		tmpdefaultString = MonoUtil::monoToString(defaultString);
+		SPtr<HString> instance = bs_shared_ptr_new<HString>(tmpidentifier, tmpdefaultString, stringTableId);
+		new (bs_alloc<ScriptHString>())ScriptHString(managedInstance, instance);
+	}
+
+	void ScriptHString::Internal_HString1(MonoObject* managedInstance, uint32_t stringTableId)
+	{
+		SPtr<HString> instance = bs_shared_ptr_new<HString>(stringTableId);
+		new (bs_alloc<ScriptHString>())ScriptHString(managedInstance, instance);
+	}
+
+	void ScriptHString::Internal_HString2(MonoObject* managedInstance)
+	{
+		SPtr<HString> instance = bs_shared_ptr_new<HString>();
+		new (bs_alloc<ScriptHString>())ScriptHString(managedInstance, instance);
+	}
+
+	MonoString* ScriptHString::Internal_getValue(ScriptHString* thisPtr)
+	{
+		String tmp__output;
+		tmp__output = thisPtr->getInternal()->getValue();
+
+		MonoString* __output;
+		__output = MonoUtil::stringToMono(tmp__output);
+
+		return __output;
+	}
+
+	void ScriptHString::Internal_setParameter(ScriptHString* thisPtr, uint32_t idx, MonoString* value)
+	{
+		String tmpvalue;
+		tmpvalue = MonoUtil::monoToString(value);
+		thisPtr->getInternal()->setParameter(idx, tmpvalue);
+	}
+}

+ 30 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptHString.generated.h

@@ -0,0 +1,30 @@
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace bs
+{
+	class HString;
+
+	class BS_SCR_BE_EXPORT ScriptHString : public ScriptObject<ScriptHString>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "LocString")
+
+		ScriptHString(MonoObject* managedInstance, const SPtr<HString>& value);
+
+		SPtr<HString> getInternal() const { return mInternal; }
+		static MonoObject* create(const SPtr<HString>& value);
+
+	private:
+		SPtr<HString> mInternal;
+
+		static void Internal_HString(MonoObject* managedInstance, MonoString* identifier, uint32_t stringTableId);
+		static void Internal_HString0(MonoObject* managedInstance, MonoString* identifier, MonoString* defaultString, uint32_t stringTableId);
+		static void Internal_HString1(MonoObject* managedInstance, uint32_t stringTableId);
+		static void Internal_HString2(MonoObject* managedInstance);
+		static MonoString* Internal_getValue(ScriptHString* thisPtr);
+		static void Internal_setParameter(ScriptHString* thisPtr, uint32_t idx, MonoString* value);
+	};
+}

+ 4 - 4
Source/Scripting/SBansheeEngine/Generated/BsScriptPhysics.generated.cpp

@@ -342,7 +342,7 @@ namespace bs
 		{
 			ScriptComponentBase* script__output = nullptr;
 			if(vec__output[i])
-						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(vec__output[i]);
+						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(vec__output[i]));
 			if(script__output != nullptr)
 				array__output.set(i, script__output->getManagedInstance());
 			else
@@ -365,7 +365,7 @@ namespace bs
 		{
 			ScriptComponentBase* script__output = nullptr;
 			if(vec__output[i])
-						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(vec__output[i]);
+						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(vec__output[i]));
 			if(script__output != nullptr)
 				array__output.set(i, script__output->getManagedInstance());
 			else
@@ -388,7 +388,7 @@ namespace bs
 		{
 			ScriptComponentBase* script__output = nullptr;
 			if(vec__output[i])
-						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(vec__output[i]);
+						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(vec__output[i]));
 			if(script__output != nullptr)
 				array__output.set(i, script__output->getManagedInstance());
 			else
@@ -416,7 +416,7 @@ namespace bs
 		{
 			ScriptComponentBase* script__output = nullptr;
 			if(vec__output[i])
-						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(vec__output[i]);
+						script__output = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(vec__output[i]));
 			if(script__output != nullptr)
 				array__output.set(i, script__output->getManagedInstance());
 			else

+ 1 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptPhysicsQueryHit.generated.cpp

@@ -56,7 +56,7 @@ namespace bs
 		output.triangleIdx = value.triangleIdx;
 		ScriptComponentBase* scriptcollider = nullptr;
 		if(value.collider)
-				scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(value.collider);
+				scriptcollider = ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(value.collider));
 		MonoObject* tmpcollider;
 		if(scriptcollider != nullptr)
 			tmpcollider = scriptcollider->getManagedInstance();

+ 4 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTNamedAnimationCurve.generated.cpp

@@ -42,6 +42,7 @@ namespace bs
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(value.curve);
 		if(scriptcurve != nullptr)
 			tmpcurve = scriptcurve->getInternal();
+		if(tmpcurve != nullptr)
 		output.curve = *tmpcurve;
 
 		return output;
@@ -93,6 +94,7 @@ namespace bs
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(value.curve);
 		if(scriptcurve != nullptr)
 			tmpcurve = scriptcurve->getInternal();
+		if(tmpcurve != nullptr)
 		output.curve = *tmpcurve;
 
 		return output;
@@ -144,6 +146,7 @@ namespace bs
 		scriptcurve = ScriptTAnimationCurveQuaternion::toNative(value.curve);
 		if(scriptcurve != nullptr)
 			tmpcurve = scriptcurve->getInternal();
+		if(tmpcurve != nullptr)
 		output.curve = *tmpcurve;
 
 		return output;
@@ -195,6 +198,7 @@ namespace bs
 		scriptcurve = ScriptTAnimationCurveint32_t::toNative(value.curve);
 		if(scriptcurve != nullptr)
 			tmpcurve = scriptcurve->getInternal();
+		if(tmpcurve != nullptr)
 		output.curve = *tmpcurve;
 
 		return output;

+ 2 - 1
Source/Scripting/SBansheeEngine/Serialization/BsBuiltinComponentLookup.h

@@ -26,7 +26,8 @@ namespace bs
 		static ScriptComponentBase* create##ScriptType(const HComponent& component)											\
 		{																													\
 			MonoObject* managedInstance = ScriptType::getMetaData()->scriptClass->createInstance();							\
-			ScriptType* scriptComponent = new (bs_alloc<ScriptType>()) ScriptType(managedInstance, component);				\
+			ScriptType* scriptComponent = new (bs_alloc<ScriptType>())														\
+				ScriptType(managedInstance, static_object_cast<ComponentType>(component));									\
 																															\
 			return scriptComponent;																							\
 		}																													\

+ 9 - 6
Source/Scripting/SBansheeEngine/Serialization/BsManagedSerializableField.cpp

@@ -195,7 +195,7 @@ namespace bs
 				if (value != nullptr)
 				{
 					ScriptSceneObject* scriptSceneObject = ScriptSceneObject::toNative(value);
-					fieldData->value = static_object_cast<SceneObject>(scriptSceneObject->getNativeHandle());
+					fieldData->value = scriptSceneObject->getNativeHandle();
 				}
 
 				return fieldData;
@@ -208,7 +208,7 @@ namespace bs
 				if (value != nullptr)
 				{
 					ScriptManagedComponent* scriptComponent = ScriptManagedComponent::toNative(value);
-					fieldData->value = static_object_cast<Component>(scriptComponent->getNativeHandle());
+					fieldData->value = scriptComponent->getNativeHandle();
 				}
 
 				return fieldData;
@@ -225,7 +225,7 @@ namespace bs
 				if (value != nullptr)
 				{
 					ScriptComponentBase* scriptComponent = ScriptComponent::toNative(value);
-					fieldData->value = scriptComponent->getComponent();
+					fieldData->value = static_object_cast<GameObject>(scriptComponent->getComponent());
 				}
 
 				return fieldData;
@@ -538,7 +538,8 @@ namespace bs
 			{
 				if(value)
 				{
-					ScriptSceneObject* scriptSceneObject = ScriptGameObjectManager::instance().getOrCreateScriptSceneObject(value);
+					ScriptSceneObject* scriptSceneObject = 
+						ScriptGameObjectManager::instance().getOrCreateScriptSceneObject(static_object_cast<SceneObject>(value));
 					return scriptSceneObject->getManagedInstance();
 				}
 				else
@@ -549,7 +550,8 @@ namespace bs
 			{
 				if (value)
 				{
-					ScriptManagedComponent* scriptComponent = ScriptGameObjectManager::instance().getManagedScriptComponent(value);
+					ScriptManagedComponent* scriptComponent =
+						ScriptGameObjectManager::instance().getManagedScriptComponent(static_object_cast<ManagedComponent>(value));
 					assert(scriptComponent != nullptr);
 
 					return scriptComponent->getManagedInstance();
@@ -562,7 +564,8 @@ namespace bs
 			{
 				if (value)
 				{
-					ScriptComponentBase* scriptComponent = ScriptGameObjectManager::instance().getBuiltinScriptComponent(value);
+					ScriptComponentBase* scriptComponent = 
+						ScriptGameObjectManager::instance().getBuiltinScriptComponent(static_object_cast<Component>(value));
 					assert(scriptComponent != nullptr);
 
 					return scriptComponent->getManagedInstance();

+ 1 - 1
Source/Scripting/SBansheeEngine/Wrappers/BsScriptComponent.h

@@ -42,7 +42,7 @@ namespace bs
 	{
 	public:
 		/**	Returns a generic handle to the internal wrapped component. */
-		HGameObject getNativeHandle() const override { return mComponent; }
+		HGameObject getNativeHandle() const override { return static_object_cast<GameObject>(mComponent); }
 
 		/**	Sets the internal component this object wraps. */
 		void setNativeHandle(const HGameObject& gameObject) override { mComponent = static_object_cast<CompType>(gameObject); }

+ 3 - 2
Source/Scripting/SBansheeEngine/Wrappers/BsScriptContextMenu.cpp

@@ -8,10 +8,11 @@
 #include "BsMonoMethod.h"
 #include "BsMonoUtil.h"
 #include "GUI/BsGUIContextMenu.h"
-#include "Wrappers/BsScriptHString.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
 #include "GUI/BsGUILayout.h"
 
+#include "Generated/BsScriptHString.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs
@@ -81,7 +82,7 @@ namespace bs
 
 		String nativeLabel = MonoUtil::monoToString(label);
 		SPtr<GUIContextMenu> contextMenu = instance->getInternal();
-		contextMenu->setLocalizedName(nativeLabel, name->getInternalValue());
+		contextMenu->setLocalizedName(nativeLabel, *name->getInternal());
 	}
 
 	void ScriptContextMenu::onContextMenuItemTriggered(UINT32 idx)

+ 0 - 112
Source/Scripting/SBansheeEngine/Wrappers/BsScriptGUIContentImages.cpp

@@ -1,112 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptGUIContentImages.h"
-#include "BsScriptResourceManager.h"
-
-#include "BsScriptSpriteTexture.generated.h"
-
-namespace bs
-{
-	MonoField* ScriptGUIContentImages::mNormalField;
-	MonoField* ScriptGUIContentImages::mHoverField;
-	MonoField* ScriptGUIContentImages::mActiveField;
-	MonoField* ScriptGUIContentImages::mFocusedField;
-	MonoField* ScriptGUIContentImages::mNormalOnField;
-	MonoField* ScriptGUIContentImages::mHoverOnField;
-	MonoField* ScriptGUIContentImages::mActiveOnField;
-	MonoField* ScriptGUIContentImages::mFocusedOnField;
-
-	ScriptGUIContentImages::ScriptGUIContentImages(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptGUIContentImages::initRuntimeData()
-	{
-		mNormalField = metaData.scriptClass->getField("normal");
-		mHoverField = metaData.scriptClass->getField("hover");
-		mActiveField = metaData.scriptClass->getField("active");
-		mFocusedField = metaData.scriptClass->getField("focused");
-		mNormalOnField = metaData.scriptClass->getField("normalOn");
-		mHoverOnField = metaData.scriptClass->getField("hoverOn");
-		mActiveOnField = metaData.scriptClass->getField("activeOn");
-		mFocusedOnField = metaData.scriptClass->getField("focusedOn");
-	}
-
-	GUIContentImages ScriptGUIContentImages::getNative(MonoObject* instance)
-	{
-		GUIContentImages output;
-
-		struct Entry
-		{
-			Entry(MonoField* field, HSpriteTexture& outputImage)
-				:field(field), outputImage(outputImage)
-			{ }
-
-			MonoField* field;
-			HSpriteTexture& outputImage;
-		};
-
-		Entry entries[8] = 
-		{ 
-			{ mNormalField, output.normal },
-			{ mHoverField, output.hover },
-			{ mActiveField, output.active },
-			{ mFocusedField, output.focused },
-			{ mNormalOnField, output.normalOn },
-			{ mHoverOnField, output.hoverOn },
-			{ mActiveOnField, output.activeOn },
-			{ mFocusedOnField, output.focusedOn },
-		};
-
-		for (auto& entry : entries)
-		{
-			MonoObject* managedImage;
-			entry.field->get(instance, &managedImage);
-
-			if (managedImage != nullptr)
-				entry.outputImage = ScriptSpriteTexture::toNative(managedImage)->getHandle();
-		}
-
-		return output;
-	}
-
-	MonoObject* ScriptGUIContentImages::getManaged(const GUIContentImages& images)
-	{
-		struct Entry
-		{
-			Entry(MonoField* field, const HSpriteTexture& outputImage)
-				:field(field), image(outputImage)
-			{ }
-
-			MonoField* field;
-			const HSpriteTexture& image;
-		};
-
-		Entry entries[8] =
-		{
-			{ mNormalField, images.normal },
-			{ mHoverField, images.hover },
-			{ mActiveField, images.active },
-			{ mFocusedField, images.focused },
-			{ mNormalOnField, images.normalOn },
-			{ mHoverOnField, images.hoverOn },
-			{ mActiveOnField, images.activeOn },
-			{ mFocusedOnField, images.focusedOn },
-		};
-
-		MonoObject* output = metaData.scriptClass->createInstance();
-		for (auto& entry : entries)
-		{
-			MonoObject* managedImage = nullptr;
-			if (entry.image != nullptr)
-			{
-				ScriptResourceBase* scriptImage = ScriptResourceManager::instance().getScriptResource(entry.image, true);
-				managedImage = scriptImage->getManagedInstance();
-			}
-
-			entry.field->set(output, managedImage);
-		}
-
-		return output;
-	}
-}

+ 0 - 41
Source/Scripting/SBansheeEngine/Wrappers/BsScriptGUIContentImages.h

@@ -1,41 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptObject.h"
-#include "GUI/BsGUIContent.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for GUIContentImages. */
-	class BS_SCR_BE_EXPORT ScriptGUIContentImages : public ScriptObject<ScriptGUIContentImages>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContentImages")
-
-		/**	Converts a managed GUIContentImages instance to a native one. */
-		static GUIContentImages getNative(MonoObject* instance);
-
-		/**	Converts a native GUIContentImages instance to a managed one. */
-		static MonoObject* getManaged(const GUIContentImages& images);
-
-	private:
-		ScriptGUIContentImages(MonoObject* instance);
-
-		static MonoField* mNormalField;
-		static MonoField* mHoverField;
-		static MonoField* mActiveField;
-		static MonoField* mFocusedField;
-		static MonoField* mNormalOnField;
-		static MonoField* mHoverOnField;
-		static MonoField* mActiveOnField;
-		static MonoField* mFocusedOnField;
-	};
-
-	/** @} */
-}

+ 0 - 39
Source/Scripting/SBansheeEngine/Wrappers/BsScriptHString.cpp

@@ -1,39 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptHString.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoUtil.h"
-
-namespace bs
-{
-	ScriptHString::ScriptHString(MonoObject* instance, const HString& string)
-		:ScriptObject(instance), mString(string)
-	{ }
-
-	void ScriptHString::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", (void*)&ScriptHString::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_SetParameter", (void*)&ScriptHString::internal_setParameter);
-		metaData.scriptClass->addInternalCall("Internal_GetValue", (void*)&ScriptHString::internal_getValue);
-	}
-
-	void ScriptHString::internal_createInstance(MonoObject* instance, MonoString* identifier, UINT32 tableId)
-	{
-		HString string(MonoUtil::monoToString(identifier), tableId);
-		
-		new (bs_alloc<ScriptHString>()) ScriptHString(instance, string);
-	}
-
-	void ScriptHString::internal_setParameter(ScriptHString* nativeInstance, UINT32 idx, MonoString* value)
-	{
-		nativeInstance->mString.setParameter(idx, MonoUtil::monoToString(value));
-	}
-
-	void ScriptHString::internal_getValue(ScriptHString* nativeInstance, MonoString** value)
-	{
-		MonoUtil::referenceCopy(value, (MonoObject*)MonoUtil::stringToMono(nativeInstance->mString.getValue()));
-	}
-}

+ 0 - 38
Source/Scripting/SBansheeEngine/Wrappers/BsScriptHString.h

@@ -1,38 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptObject.h"
-#include "Localization/BsHString.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for HString. */
-	class BS_SCR_BE_EXPORT ScriptHString : public ScriptObject<ScriptHString>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "LocString")
-
-		/**	Returns the wrapped native HString. */
-		const HString& getInternalValue() const { return mString; }
-
-	private:
-		ScriptHString(MonoObject* instance, const HString& string);
-
-		HString mString;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoString* identifier, UINT32 tableId);
-		static void internal_setParameter(ScriptHString* nativeInstance, UINT32 idx, MonoString* value);
-		static void internal_getValue(ScriptHString* nativeInstance, MonoString** value);
-	};
-
-	/** @} */
-}

+ 1 - 1
Source/Scripting/SBansheeEngine/Wrappers/BsScriptManagedComponent.h

@@ -19,7 +19,7 @@ namespace bs
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "ManagedComponent")
 
 		/**	Returns a generic handle to the internal wrapped component. */
-		HGameObject getNativeHandle() const override { return mComponent; }
+		HGameObject getNativeHandle() const override { return static_object_cast<GameObject>(mComponent); }
 
 		/**	Sets the internal component this object wraps. */
 		void setNativeHandle(const HGameObject& gameObject) override { mComponent = static_object_cast<ManagedComponent>(gameObject); }

+ 0 - 66
Source/Scripting/SBansheeEngine/Wrappers/BsScriptProfilerOverlayInternal.cpp

@@ -1,66 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptProfilerOverlayInternal.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoUtil.h"
-#include "BsApplication.h"
-#include "Components/BsCCamera.h"
-
-#include "BsScriptCCamera.generated.h"
-
-namespace bs
-{
-	ScriptProfilerOverlayInternal::ScriptProfilerOverlayInternal(MonoObject* managedInstance, const SPtr<Camera>& camera)
-		:ScriptObject(managedInstance), mProfilerOverlayInternal(nullptr)
-	{
-		if (camera != nullptr)
-			mProfilerOverlayInternal = bs_new<ProfilerOverlayInternal>(camera);
-	}
-
-	ScriptProfilerOverlayInternal::~ScriptProfilerOverlayInternal()
-	{
-		if (mProfilerOverlayInternal != nullptr)
-			bs_delete(mProfilerOverlayInternal);
-	}
-
-	void ScriptProfilerOverlayInternal::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", (void*)&ScriptProfilerOverlayInternal::internal_CreateInstance);
-		metaData.scriptClass->addInternalCall("Internal_SetType", (void*)&ScriptProfilerOverlayInternal::internal_SetType);
-		metaData.scriptClass->addInternalCall("Internal_Update", (void*)&ScriptProfilerOverlayInternal::internal_Update);
-		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", (void*)&ScriptProfilerOverlayInternal::internal_DestroyInstance);
-	}
-
-	void ScriptProfilerOverlayInternal::internal_CreateInstance(MonoObject* instance, ScriptCCamera* camera)
-	{
-		SPtr<Camera> nativeCamera;
-		if (camera != nullptr)
-			nativeCamera = camera->getHandle()->_getCamera();
-
-		new (bs_alloc<ScriptProfilerOverlayInternal>()) ScriptProfilerOverlayInternal(instance, nativeCamera);
-	}
-
-	void ScriptProfilerOverlayInternal::internal_SetType(ScriptProfilerOverlayInternal* thisPtr, ProfilerOverlayType type)
-	{
-		if (thisPtr->mProfilerOverlayInternal != nullptr)
-			thisPtr->mProfilerOverlayInternal->show(type);
-	}
-
-	void ScriptProfilerOverlayInternal::internal_Update(ScriptProfilerOverlayInternal* thisPtr)
-	{
-		if (thisPtr->mProfilerOverlayInternal != nullptr)
-			thisPtr->mProfilerOverlayInternal->update();
-	}
-
-	void ScriptProfilerOverlayInternal::internal_DestroyInstance(ScriptProfilerOverlayInternal* thisPtr)
-	{
-		if (thisPtr->mProfilerOverlayInternal != nullptr)
-		{
-			bs_delete(thisPtr->mProfilerOverlayInternal);
-			thisPtr->mProfilerOverlayInternal = nullptr;
-		}
-	}
-}

+ 0 - 42
Source/Scripting/SBansheeEngine/Wrappers/BsScriptProfilerOverlayInternal.h

@@ -1,42 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptObject.h"
-#include "GUI/BsProfilerOverlay.h"
-
-namespace bs
-{
-	class ScriptCCamera;
-
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for ProfilerOverlayInternal. */
-	class BS_SCR_BE_EXPORT ScriptProfilerOverlayInternal : public ScriptObject < ScriptProfilerOverlayInternal >
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "ProfilerOverlayInternal")
-
-		/**	Returns the native profiler overlay instance. */
-		ProfilerOverlayInternal* getInternal() const { return mProfilerOverlayInternal; }
-
-	private:
-		ScriptProfilerOverlayInternal(MonoObject* managedInstance, const SPtr<Camera>& camera);
-		~ScriptProfilerOverlayInternal();
-
-		ProfilerOverlayInternal* mProfilerOverlayInternal;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, ScriptCCamera* camera);
-		static void internal_SetType(ScriptProfilerOverlayInternal* thisPtr, ProfilerOverlayType type);
-		static void internal_Update(ScriptProfilerOverlayInternal* thisPtr);
-		static void internal_DestroyInstance(ScriptProfilerOverlayInternal* thisPtr);
-	};
-
-	/** @} */
-}

+ 1 - 1
Source/Scripting/SBansheeEngine/Wrappers/BsScriptSceneObject.h

@@ -20,7 +20,7 @@ namespace bs
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "SceneObject")
 
 		/** @copydoc ScriptGameObjectBase::getNativeHandle */
-		HGameObject getNativeHandle() const override { return mSceneObject; }
+		HGameObject getNativeHandle() const override { return static_object_cast<GameObject>(mSceneObject); }
 
 		/** @copydoc ScriptGameObjectBase::setNativeHandle */
 		void setNativeHandle(const HGameObject& gameObject) override;

+ 8 - 6
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIButton.cpp

@@ -13,8 +13,9 @@
 #include "GUI/BsGUIOptions.h"
 #include "Wrappers/GUI/BsScriptGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
 
 namespace bs
 {
@@ -41,7 +42,8 @@ namespace bs
 		onOutThunk = (OnOutThunkDef)metaData.scriptClass->getMethod("DoOnOut")->getThunk();
 	}
 
-	void ScriptGUIButton::internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions)
+	void ScriptGUIButton::internal_createInstance(MonoObject* instance, __GUIContentInterop* content,
+		MonoString* style, MonoArray* guiOptions)
 	{
 		GUIOptions options;
 
@@ -50,7 +52,7 @@ namespace bs
 		for(UINT32 i = 0; i < arrayLen; i++)
 			options.addOption(scriptArray.get<GUIOption>(i));
 
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
+		GUIContent nativeContent = ScriptGUIContent::fromInterop(*content);
 		GUIButton* guiButton = GUIButton::create(nativeContent, options, MonoUtil::monoToString(style));
 
 		auto nativeInstance = new (bs_alloc<ScriptGUIButton>()) ScriptGUIButton(instance, guiButton);
@@ -61,9 +63,9 @@ namespace bs
 		guiButton->onOut.connect(std::bind(&ScriptGUIButton::onOut, nativeInstance));
 	}
 
-	void ScriptGUIButton::internal_setContent(ScriptGUIButton* nativeInstance, MonoObject* content)
+	void ScriptGUIButton::internal_setContent(ScriptGUIButton* nativeInstance, __GUIContentInterop* content)
 	{
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
+		GUIContent nativeContent = ScriptGUIContent::fromInterop(*content);
 
 		GUIButton* button = (GUIButton*)nativeInstance->getGUIElement();
 		button->setContent(nativeContent);

+ 4 - 2
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIButton.h

@@ -8,6 +8,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEngine
 	 *  @{
 	 */
@@ -36,8 +38,8 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
-		static void internal_setContent(ScriptGUIButton* nativeInstance, MonoObject* content);
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* content, MonoString* style, MonoArray* guiOptions);
+		static void internal_setContent(ScriptGUIButton* nativeInstance, __GUIContentInterop* content);
 		static void internal_setTint(ScriptGUIButton* nativeInstance, Color* color);
 
 		typedef void (BS_THUNKCALL *OnClickThunkDef) (MonoObject*, MonoException**);

+ 0 - 64
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.cpp

@@ -1,64 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/GUI/BsScriptGUIContent.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoUtil.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Image/BsSpriteTexture.h"
-#include "Wrappers/BsScriptGUIContentImages.h"
-
-namespace bs
-{
-	MonoField* ScriptGUIContent::mTextField;
-	MonoField* ScriptGUIContent::mTooltipField;
-	MonoField* ScriptGUIContent::mImagesField;
-
-	ScriptGUIContent::ScriptGUIContent(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptGUIContent::initRuntimeData()
-	{
-		mTextField = metaData.scriptClass->getField("text");
-		mTooltipField = metaData.scriptClass->getField("tooltip");
-		mImagesField = metaData.scriptClass->getField("images");
-	}
-
-	const HString& ScriptGUIContent::getText(MonoObject* instance)
-	{
-		MonoObject* textManaged = nullptr;
-		mTextField->get(instance, &textManaged);
-
-		if(textManaged == nullptr)
-			return HString::dummy();
-
-		ScriptHString* textScript = ScriptHString::toNative(textManaged);
-		return textScript->getInternalValue();
-	}
-
-	const HString& ScriptGUIContent::getTooltip(MonoObject* instance)
-	{
-		MonoObject* tooltipManaged = nullptr;
-		mTooltipField->get(instance, &tooltipManaged);
-
-		if(tooltipManaged == nullptr)
-			return HString::dummy();
-
-		ScriptHString* tooltipScript = ScriptHString::toNative(tooltipManaged);
-		return tooltipScript->getInternalValue();
-	}
-
-	GUIContentImages ScriptGUIContent::getImage(MonoObject* instance)
-	{
-		MonoObject* imagesManaged = nullptr;
-		mImagesField->get(instance, &imagesManaged);
-
-		if(imagesManaged == nullptr)
-			return GUIContentImages();
-
-		return ScriptGUIContentImages::getNative(imagesManaged);
-	}
-}

+ 0 - 39
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.h

@@ -1,39 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptObject.h"
-#include "GUI/BsGUIContent.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for GUIContent. */
-	class BS_SCR_BE_EXPORT ScriptGUIContent : public ScriptObject<ScriptGUIContent>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContent")
-
-		/**	Retrieves the title text in a managed GUIContent instance. */
-		static const HString& getText(MonoObject* instance);
-
-		/**	Retrieves the tooltip text in a managed GUIContent instance. */
-		static const HString& getTooltip(MonoObject* instance);
-
-		/**	Retrieves the content image in a managed GUIContent instance. */
-		static GUIContentImages getImage(MonoObject* instance);
-
-	private:
-		ScriptGUIContent(MonoObject* instance);
-
-		static MonoField* mTextField;
-		static MonoField* mTooltipField;
-		static MonoField* mImagesField;
-	};
-
-	/** @} */
-}

+ 8 - 6
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUILabel.cpp

@@ -12,8 +12,9 @@
 #include "GUI/BsGUIOptions.h"
 #include "Wrappers/GUI/BsScriptGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
+
+#include "Generated/BsScriptHString.generated.h"
+#include "Generated/BsScriptGUIContent.generated.h"
 
 namespace bs
 {
@@ -30,7 +31,8 @@ namespace bs
 		metaData.scriptClass->addInternalCall("Internal_SetTint", (void*)&ScriptGUILabel::internal_setTint);
 	}
 
-	void ScriptGUILabel::internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions)
+	void ScriptGUILabel::internal_createInstance(MonoObject* instance, __GUIContentInterop* content, MonoString* style, 
+		MonoArray* guiOptions)
 	{
 		GUIOptions options;
 
@@ -39,15 +41,15 @@ namespace bs
 		for (UINT32 i = 0; i < arrayLen; i++)
 			options.addOption(scriptArray.get<GUIOption>(i));
 
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
+		GUIContent nativeContent = ScriptGUIContent::fromInterop(*content);
 		GUILabel* guiLabel = GUILabel::create(nativeContent, options, MonoUtil::monoToString(style));
 
 		new (bs_alloc<ScriptGUILabel>()) ScriptGUILabel(instance, guiLabel);
 	}
 
-	void ScriptGUILabel::internal_setContent(ScriptGUILabel* nativeInstance, MonoObject* content)
+	void ScriptGUILabel::internal_setContent(ScriptGUILabel* nativeInstance, __GUIContentInterop* content)
 	{
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
+		GUIContent nativeContent = ScriptGUIContent::fromInterop(*content);
 
 		GUILabel* label = (GUILabel*)nativeInstance->getGUIElement();
 		label->setContent(nativeContent);

+ 5 - 2
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUILabel.h

@@ -7,6 +7,8 @@
 
 namespace bs
 {
+	struct __GUIContentInterop;
+
 	/** @addtogroup ScriptInteropEngine
 	 *  @{
 	 */
@@ -23,8 +25,9 @@ namespace bs
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
-		static void internal_setContent(ScriptGUILabel* nativeInstance, MonoObject* content);
+		static void internal_createInstance(MonoObject* instance, __GUIContentInterop* content, MonoString* style, 
+			MonoArray* guiOptions);
+		static void internal_setContent(ScriptGUILabel* nativeInstance, __GUIContentInterop* content);
 		static void internal_setTint(ScriptGUILabel* nativeInstance, Color* color);
 	};
 

+ 4 - 3
Source/Scripting/SBansheeEngine/Wrappers/GUI/BsScriptGUIListBox.cpp

@@ -13,7 +13,8 @@
 #include "GUI/BsGUIOptions.h"
 #include "Wrappers/GUI/BsScriptGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
-#include "Wrappers/BsScriptHString.h"
+
+#include "Generated/BsScriptHString.generated.h"
 
 using namespace std::placeholders;
 
@@ -62,7 +63,7 @@ namespace bs
 			else
 			{
 				ScriptHString* textScript = ScriptHString::toNative(stringManaged);
-				nativeElements.push_back(textScript->getInternalValue());
+				nativeElements.push_back(*textScript->getInternal());
 			}
 		}
 
@@ -87,7 +88,7 @@ namespace bs
 			else
 			{
 				ScriptHString* textScript = ScriptHString::toNative(stringManaged);
-				nativeElements.push_back(textScript->getInternalValue());
+				nativeElements.push_back(*textScript->getInternal());
 			}
 		}
 

Some files were not shown because too many files changed in this diff