Browse Source

Refactor: Moving GUICurvesField to C++

BearishSun 7 years ago
parent
commit
ec09dbaf87
27 changed files with 807 additions and 163 deletions
  1. 2 0
      Source/EditorCore/CMakeSources.cmake
  2. 9 3
      Source/EditorCore/GUI/BsGUICurves.h
  3. 89 0
      Source/EditorCore/GUI/BsGUICurvesField.cpp
  4. 69 0
      Source/EditorCore/GUI/BsGUICurvesField.h
  5. 5 0
      Source/EditorCore/GUI/BsGUIFieldBase.h
  6. 0 146
      Source/Scripting/MBansheeEditor/GUI/GUICurveField.cs
  7. 10 0
      Source/Scripting/MBansheeEditor/Generated/CurveDrawInfo.generated.cs
  8. 113 0
      Source/Scripting/MBansheeEditor/Generated/GUICurvesField.generated.cs
  9. 2 2
      Source/Scripting/MBansheeEditor/Generated/GUIGraphTicks.generated.cs
  10. 0 1
      Source/Scripting/MBansheeEditor/MBansheeEditor.csproj
  11. 1 1
      Source/Scripting/MBansheeEditor/Windows/Animation/GUIGraphTime.cs
  12. 1 1
      Source/Scripting/MBansheeEditor/Windows/Animation/GUIGraphValues.cs
  13. 0 6
      Source/Scripting/MBansheeEngine/Generated/AnimationUtility.generated.cs
  14. 1 1
      Source/Scripting/MBansheeEngine/Generated/CAudioSource.generated.cs
  15. 52 0
      Source/Scripting/MBansheeEngine/Generated/TAnimationCurve.generated.cs
  16. 20 0
      Source/Scripting/MBansheeEngine/Generated/TKeyframe.generated.cs
  17. 50 0
      Source/Scripting/MBansheeEngine/Generated/TNamedAnimationCurve.generated.cs
  18. 111 0
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.cpp
  19. 34 0
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.h
  20. 1 1
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIGraphTicks.generated.cpp
  21. 1 1
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIGraphTicks.generated.h
  22. 67 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTAnimationCurve.generated.cpp
  23. 22 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTAnimationCurve.generated.h
  24. 42 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTKeyframe.generated.cpp
  25. 26 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTKeyframe.generated.h
  26. 54 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTNamedAnimationCurve.generated.cpp
  27. 25 0
      Source/Scripting/SBansheeEngine/Generated/BsScriptTNamedAnimationCurve.generated.h

+ 2 - 0
Source/EditorCore/CMakeSources.cmake

@@ -63,6 +63,7 @@ set(BS_BANSHEEEDITOR_SRC_GUI
 	"GUI/BsGUIWindowFrame.cpp"
 	"GUI/BsGUIWindowFrame.cpp"
 	"GUI/BsGUIWindowFrameWidget.cpp"
 	"GUI/BsGUIWindowFrameWidget.cpp"
 	"GUI/BsGUICurves.cpp"
 	"GUI/BsGUICurves.cpp"
+	"GUI/BsGUICurvesField.cpp"
 )
 )
 
 
 set(BS_BANSHEEEDITOR_INC_LIBRARY
 set(BS_BANSHEEEDITOR_INC_LIBRARY
@@ -100,6 +101,7 @@ set(BS_BANSHEEEDITOR_INC_GUI
 	"GUI/BsGUIWindowFrame.h"
 	"GUI/BsGUIWindowFrame.h"
 	"GUI/BsGUIWindowFrameWidget.h"
 	"GUI/BsGUIWindowFrameWidget.h"
 	"GUI/BsGUICurves.h"
 	"GUI/BsGUICurves.h"
+	"GUI/BsGUICurvesField.h"
 )
 )
 
 
 set(BS_BANSHEEEDITOR_INC_UNDOREDO
 set(BS_BANSHEEEDITOR_INC_UNDOREDO

+ 9 - 3
Source/EditorCore/GUI/BsGUICurves.h

@@ -118,6 +118,15 @@ namespace bs
 		BS_SCRIPT_EXPORT()
 		BS_SCRIPT_EXPORT()
 		float getTimeForFrame(INT32 index) const;
 		float getTimeForFrame(INT32 index) const;
 
 
+		/**
+		 * @name Internal
+		 * @{
+		 */
+
+		/** @copydoc GUIElement::_getOptimalSize */
+		Vector2I _getOptimalSize() const override;
+
+		/** @} */
 	protected:
 	protected:
 		GUITimeline(const String& styleName, const GUIDimensions& dimensions);
 		GUITimeline(const String& styleName, const GUIDimensions& dimensions);
 		~GUITimeline() override = default;
 		~GUITimeline() override = default;
@@ -137,9 +146,6 @@ namespace bs
 		/** @copydoc GUIElement::_updateLayoutInternal */
 		/** @copydoc GUIElement::_updateLayoutInternal */
 		void _updateLayoutInternal(const GUILayoutData& data) override;
 		void _updateLayoutInternal(const GUILayoutData& data) override;
 
 
-		/** @copydoc GUIElement::_getOptimalSize */
-		Vector2I _getOptimalSize() const override;
-
 		/** @copydoc GUIElement::styleUpdated */
 		/** @copydoc GUIElement::styleUpdated */
 		void styleUpdated() override;
 		void styleUpdated() override;
 
 

+ 89 - 0
Source/EditorCore/GUI/BsGUICurvesField.cpp

@@ -0,0 +1,89 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2018 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "GUI/BsGUICurvesField.h"
+#include "GUI/BsGUILayout.h"
+#include "GUI/BsGUILabel.h"
+#include "GUI/BsGUICurves.h"
+
+using namespace std::placeholders;
+
+namespace bs
+{
+	GUICurvesField::GUICurvesField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
+		const String& style, const GUIDimensions& dimensions, bool withLabel)
+		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel)
+	{
+		mCurves = GUICurves::create(getSubStyleName(getCurveStyleType()));
+		mCurves->onClicked.connect(std::bind(&GUICurvesField::clicked, this));
+
+		mLayout->addElement(mCurves);
+	}
+
+	void GUICurvesField::setCurve(const TAnimationCurve<float>& curve)
+	{
+		const Vector<CurveDrawInfo> drawInfos =
+		{
+			CurveDrawInfo(curve, Color::BansheeOrange)
+		};
+
+		mCurves->setCurves(drawInfos);
+	}
+
+
+	void GUICurvesField::setCurveRange(const TAnimationCurve<float>& curveA, const TAnimationCurve<float>& curveB)
+	{
+		const Vector<CurveDrawInfo> drawInfos =
+		{
+			CurveDrawInfo(curveA, Color::BansheeOrange),
+			CurveDrawInfo(curveB, Color::Green)
+		};
+
+		mCurves->setCurves(drawInfos);
+	}
+
+	void GUICurvesField::setTint(const Color& color)
+	{
+		if (mLabel != nullptr)
+			mLabel->setTint(color);
+
+		mCurves->setTint(color);
+	}
+
+	Vector2I GUICurvesField::_getOptimalSize() const
+	{
+		Vector2I optimalsize = mCurves->_getOptimalSize();
+
+		if(mLabel != nullptr)
+		{
+			optimalsize.x += mLabel->_getOptimalSize().x;
+			optimalsize.y = std::max(optimalsize.y, mLabel->_getOptimalSize().y);
+		}
+
+		return optimalsize;
+	}
+
+	void GUICurvesField::styleUpdated()
+	{
+		if (mLabel != nullptr)
+			mLabel->setStyle(getSubStyleName(getLabelStyleType()));
+
+		mCurves->setStyle(getSubStyleName(getCurveStyleType()));
+	}
+
+	void GUICurvesField::clicked()
+	{
+		onClicked();
+	}
+
+	const String& GUICurvesField::getGUITypeName()
+	{
+		static String typeName = "GUICurvesField";
+		return typeName;
+	}
+
+	const String& GUICurvesField::getCurveStyleType()
+	{
+		static String STYLE_TYPE = "EditorFieldCurves";
+		return STYLE_TYPE;
+	}
+}

+ 69 - 0
Source/EditorCore/GUI/BsGUICurvesField.h

@@ -0,0 +1,69 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2018 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsEditorPrerequisites.h"
+#include "GUI/BsGUIFieldBase.h"
+#include "Animation/BsAnimationCurve.h"
+
+namespace bs
+{
+	class GUICurves;
+
+	/** @addtogroup GUI-Editor
+	 *  @{
+	 */
+
+	/**
+	 * A composite GUI object representing an editor field. Editor fields are a combination of a label and an input field.
+	 * Label is optional. This specific implementation displays an animation curve or a range between two animation curves.
+	 */
+	class BS_ED_EXPORT BS_SCRIPT_EXPORT(ed:true,m:GUIEditor) GUICurvesField final : public TGUIField<GUICurvesField>
+	{
+	public:
+		/** Returns type name of the GUI element used for finding GUI element styles. */
+		static const String& getGUITypeName();
+
+		/** Style type name for the internal curve field. */
+		static const String& getCurveStyleType();
+
+		GUICurvesField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
+			const String& style, const GUIDimensions& dimensions, bool withLabel);
+
+		/** Sets an animation curve to display on the field. */
+		BS_SCRIPT_EXPORT() 
+		void setCurve(const TAnimationCurve<float>& curve);
+
+		/** Sets a set of animation curves and displays the difference (range) between them. */
+		BS_SCRIPT_EXPORT()
+		void setCurveRange(const TAnimationCurve<float>& curveA, const TAnimationCurve<float>& curveB);
+
+		/** @copydoc GUIElement::setTint */
+		void setTint(const Color& color) override;
+
+		BS_SCRIPT_EXPORT() 
+		Event<void()> onClicked; /**< Triggered when the user clicks on the GUI element. */
+
+		/** @name Internal 
+		 *  @{
+		 */
+
+		/** @copydoc GUIElement::_getOptimalSize */
+		Vector2I _getOptimalSize() const override;
+
+		/** @} */
+
+	protected:
+		/** @copydoc GUIElement::styleUpdated */
+		void styleUpdated() override;
+
+		/**	Triggered when the child color input field is clicked on. */
+		void clicked();
+
+		UINT32 mLabelWidth = 100;
+		GUILabel* mLabel = nullptr;
+		GUICurves* mCurves = nullptr;
+	};
+
+	/** @} */
+}

+ 5 - 0
Source/EditorCore/GUI/BsGUIFieldBase.h

@@ -165,6 +165,7 @@ namespace bs
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(ec:T)
 		static T* create(const GUIContent& labelContent, UINT32 labelWidth,
 		static T* create(const GUIContent& labelContent, UINT32 labelWidth,
 			const String& style = StringUtil::BLANK)
 			const String& style = StringUtil::BLANK)
 		{
 		{
@@ -182,6 +183,7 @@ namespace bs
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(ec:T)
 		static T* create(const GUIContent& labelContent,
 		static T* create(const GUIContent& labelContent,
 			const String& style = StringUtil::BLANK)
 			const String& style = StringUtil::BLANK)
 		{
 		{
@@ -201,6 +203,7 @@ namespace bs
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(ec:T)
 		static T* create(const HString& labelText, UINT32 labelWidth,
 		static T* create(const HString& labelText, UINT32 labelWidth,
 			const String& style = StringUtil::BLANK)
 			const String& style = StringUtil::BLANK)
 		{
 		{
@@ -219,6 +222,7 @@ namespace bs
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(ec:T)
 		static T* create(const HString& labelText, const String& style = StringUtil::BLANK)
 		static T* create(const HString& labelText, const String& style = StringUtil::BLANK)
 		{
 		{
 			const String* curStyle = &style;
 			const String* curStyle = &style;
@@ -235,6 +239,7 @@ namespace bs
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	style			Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(ec:T)
 		static T* create(const String& style = StringUtil::BLANK)
 		static T* create(const String& style = StringUtil::BLANK)
 		{
 		{
 			const String* curStyle = &style;
 			const String* curStyle = &style;

+ 0 - 146
Source/Scripting/MBansheeEditor/GUI/GUICurveField.cs

@@ -1,146 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2018 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using BansheeEngine;
-
-namespace BansheeEditor
-{
-    /// <summary>
-    /// Displays a preview of a single animation curve or a range represented by two curves. Clicking on the field
-    /// open an editor window that allows the user to edit the curve(s).
-    /// </summary>
-    public class GUICurveField
-    {
-        private GUIPanel mainPanel;
-        //private GUICurveDrawing curveDrawing;
-        private CurveDrawInfo[] drawInfos;
-        private bool drawRange;
-
-        /// <summary>
-        /// Constructs the element displaying a single animation curve.
-        /// </summary>
-        /// <param name="layout">GUI layout to which to add the element to.</param>
-        /// <param name="curve">Curve to display.</param>
-        /// <param name="width">Width of the GUI element in pixels.</param>
-        /// <param name="height">Height of the GUI element in pixels.</param>
-        public GUICurveField(GUILayout layout, AnimationCurve curve, int width = 200, int height = 60)
-        { 
-            drawInfos = new [] { new CurveDrawInfo(curve, Color.BansheeOrange ) };
-            drawRange = false;
-
-            Initialize(layout, width, height);
-        }
-
-        /// <summary>
-        /// Constructs the element displaying a curve between two animation curves.
-        /// </summary>
-        /// <param name="layout">GUI layout to which to add the element to.</param>
-        /// <param name="curveA">First curve to display.</param>
-        /// <param name="curveB">Second curve to display.</param>
-        /// <param name="width">Width of the GUI element in pixels.</param>
-        /// <param name="height">Height of the GUI element in pixels.</param>
-        public GUICurveField(GUILayout layout, AnimationCurve curveA, AnimationCurve curveB, int width = 200, int height = 60)
-        { 
-            drawInfos = new []
-            {
-                new CurveDrawInfo(curveA, Color.BansheeOrange ),
-                new CurveDrawInfo(curveB, Color.Green )
-            };
-            drawRange = true;
-
-            Initialize(layout, width, height);
-        }
-
-        /// <summary>
-        /// Contains common initialization code for all constructors.
-        /// </summary>
-        /// <param name="layout">GUI layout to which to add the element to.</param>
-        /// <param name="width">Width of the GUI element in pixels.</param>
-        /// <param name="height">Height of the GUI element in pixels.</param>
-        private void Initialize(GUILayout layout, int width, int height)
-        {
-            Rect2I padding = new Rect2I(2, 2, 4, 6);
-
-            mainPanel = layout.AddPanel();
-
-            GUIPanel curveDrawingPanel = mainPanel.AddPanel();
-            GUIPanel underlayPanel = mainPanel.AddPanel(1);
-            GUIPanel overlayPanel = mainPanel.AddPanel(-1);
-            curveDrawingPanel.SetPosition(padding.x, padding.y);
-
-            CurveDrawOptions drawOptions = CurveDrawOptions.DrawMarkers;
-            if (drawRange)
-                drawOptions |= CurveDrawOptions.DrawRange;
-
-            //curveDrawing = new GUICurveDrawing(curveDrawingPanel, width - padding.width, height - padding.height,
-            //    drawInfos, drawOptions);
-
-            Refresh();
-
-            GUITexture containerBg = new GUITexture(null, EditorStylesInternal.ContainerBg);
-            containerBg.SetWidth(width);
-            containerBg.SetHeight(height);
-
-            underlayPanel.AddElement(containerBg);
-
-            GUIButton button = new GUIButton(new LocEdString(""), EditorStyles.Blank, GUIOption.FixedWidth(width),
-                GUIOption.FixedHeight(height));
-            overlayPanel.AddElement(button);
-
-            button.OnClick += DoOnClick;
-        }
-
-        /// <summary>
-        /// Triggers when the user clicks on the GUI element.
-        /// </summary>
-        private void DoOnClick()
-        {
-            if (drawRange)
-            {
-                CurveEditorWindow.Show(drawInfos[0].curve, drawInfos[1].curve,
-                    (success, curveA, curveB) =>
-                {
-                    if (!success)
-                        return;
-
-                    drawInfos[0].curve = curveA;
-                    drawInfos[1].curve = curveB;
-                    //curveDrawing.SetCurves(drawInfos);
-                    Refresh();
-                });
-            }
-            else
-            {
-                CurveEditorWindow.Show(drawInfos[0].curve, (success, curve) =>
-                {
-                    if (!success)
-                        return;
-
-                    drawInfos[0].curve = curve;
-                    //curveDrawing.SetCurves(drawInfos);
-                    Refresh();
-                });
-            }
-        }
-
-        /// <summary>
-        /// Removes the GUI element from the parent layout.
-        /// </summary>
-        public void Destroy()
-        {
-            mainPanel.Destroy();
-        }
-
-        /// <summary>
-        /// Refreshes the curve drawing control. Should be called after curves change.
-        /// </summary>
-        private void Refresh()
-        {
-            Vector2 offset, range;
-            //GUICurveDrawing.GetOptimalRangeAndOffset(drawInfos, out offset, out range);
-            //curveDrawing.SetRange(range.x, range.y * 2.0f);
-            //curveDrawing.SetOffset(offset);
-            //curveDrawing.Rebuild();
-        }
-    }
-}

+ 10 - 0
Source/Scripting/MBansheeEditor/Generated/CurveDrawInfo.generated.cs

@@ -13,6 +13,16 @@ namespace BansheeEditor
 	[StructLayout(LayoutKind.Sequential), SerializeObject]
 	[StructLayout(LayoutKind.Sequential), SerializeObject]
 	public partial struct CurveDrawInfo
 	public partial struct CurveDrawInfo
 	{
 	{
+		/// <summary>Initializes the struct with default values.</summary>
+		public static CurveDrawInfo Default()
+		{
+			CurveDrawInfo value = new CurveDrawInfo();
+			value.curve = null;
+			value.color = new Color();
+
+			return value;
+		}
+
 		public CurveDrawInfo(AnimationCurve curve, Color color)
 		public CurveDrawInfo(AnimationCurve curve, Color color)
 		{
 		{
 			this.curve = curve;
 			this.curve = curve;

+ 113 - 0
Source/Scripting/MBansheeEditor/Generated/GUICurvesField.generated.cs

@@ -0,0 +1,113 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using BansheeEngine;
+
+namespace BansheeEditor
+{
+	/** @addtogroup GUIEditor
+	 *  @{
+	 */
+
+	/// <summary>
+	/// A composite GUI object representing an editor field. Editor fields are a combination of a label and an input field. 
+	/// Label is optional. This specific implementation displays an animation curve or a range between two animation curves.
+	/// </summary>
+	public partial class GUICurvesField : GUIElement
+	{
+		private GUICurvesField(bool __dummy0) { }
+		protected GUICurvesField() { }
+
+		/// <summary>Creates a new GUI editor field with a label.</summary>
+		/// <param name="labelContent">Content to display in the editor field label.</param>
+		/// <param name="labelWidth">Width of the label in pixels.</param>
+		/// <param name="style">
+		/// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. 
+		/// If not specified default style is used.
+		/// </param>
+		public GUICurvesField(GUIContent labelContent, uint labelWidth, string style = "")
+		{
+			Internal_create(this, ref labelContent, labelWidth, style);
+		}
+
+		/// <summary>Creates a new GUI editor field with a label.</summary>
+		/// <param name="labelContent">Content to display in the editor field label.</param>
+		/// <param name="style">
+		/// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. 
+		/// If not specified default style is used.
+		/// </param>
+		public GUICurvesField(GUIContent labelContent, string style = "")
+		{
+			Internal_create0(this, ref labelContent, style);
+		}
+
+		/// <summary>Creates a new GUI editor field with a label.</summary>
+		/// <param name="labelText">String to display in the editor field label.</param>
+		/// <param name="labelWidth">Width of the label in pixels.</param>
+		/// <param name="style">
+		/// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. 
+		/// If not specified default style is used.
+		/// </param>
+		public GUICurvesField(LocString labelText, uint labelWidth, string style = "")
+		{
+			Internal_create1(this, labelText, labelWidth, style);
+		}
+
+		/// <summary>Creates a new GUI editor field with a label.</summary>
+		/// <param name="labelText">String to display in the editor field label.</param>
+		/// <param name="style">
+		/// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. 
+		/// If not specified default style is used.
+		/// </param>
+		public GUICurvesField(LocString labelText, string style = "")
+		{
+			Internal_create2(this, labelText, style);
+		}
+
+		/// <summary>Creates a new GUI editor field without a label.</summary>
+		/// <param name="style">
+		/// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. 
+		/// If not specified default style is used.
+		/// </param>
+		public GUICurvesField(string style = "")
+		{
+			Internal_create3(this, style);
+		}
+
+		/// <summary>Triggered when the user clicks on the GUI element.</summary>
+		public event Action OnClicked;
+
+		/// <summary>Sets an animation curve to display on the field.</summary>
+		public void SetCurve(AnimationCurve curve)
+		{
+			Internal_setCurve(mCachedPtr, curve);
+		}
+
+		/// <summary>Sets a set of animation curves and displays the difference (range) between them.</summary>
+		public void SetCurveRange(AnimationCurve curveA, AnimationCurve curveB)
+		{
+			Internal_setCurveRange(mCachedPtr, curveA, curveB);
+		}
+
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_setCurve(IntPtr thisPtr, AnimationCurve curve);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_setCurveRange(IntPtr thisPtr, AnimationCurve curveA, AnimationCurve curveB);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_create(GUICurvesField managedInstance, ref GUIContent labelContent, uint labelWidth, string style);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_create0(GUICurvesField managedInstance, ref GUIContent labelContent, string style);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_create1(GUICurvesField managedInstance, LocString labelText, uint labelWidth, string style);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_create2(GUICurvesField managedInstance, LocString labelText, string style);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_create3(GUICurvesField managedInstance, string style);
+		private void Internal_onClicked()
+		{
+			OnClicked?.Invoke();
+		}
+	}
+
+	/** @} */
+}

+ 2 - 2
Source/Scripting/MBansheeEditor/Generated/GUIGraphTicks.generated.cs

@@ -71,7 +71,7 @@ namespace BansheeEditor
 		/// </summary>
 		/// </summary>
 		/// <param name="level">Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.</param>
 		/// <param name="level">Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.</param>
 		/// <returns>Positions of all ticks of the provided level.</returns>
 		/// <returns>Positions of all ticks of the provided level.</returns>
-		public float[] GetTicks(int level)
+		public float[] GetTicks(uint level)
 		{
 		{
 			return Internal_getTicks(mCachedPtr, level);
 			return Internal_getTicks(mCachedPtr, level);
 		}
 		}
@@ -87,7 +87,7 @@ namespace BansheeEditor
 		[MethodImpl(MethodImplOptions.InternalCall)]
 		[MethodImpl(MethodImplOptions.InternalCall)]
 		private static extern float Internal_getLevelStrength(IntPtr thisPtr, uint level);
 		private static extern float Internal_getLevelStrength(IntPtr thisPtr, uint level);
 		[MethodImpl(MethodImplOptions.InternalCall)]
 		[MethodImpl(MethodImplOptions.InternalCall)]
-		private static extern float[] Internal_getTicks(IntPtr thisPtr, int level);
+		private static extern float[] Internal_getTicks(IntPtr thisPtr, uint level);
 	}
 	}
 
 
 	/** @} */
 	/** @} */

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

@@ -37,7 +37,6 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Compile Include="GUI\GUIColorGradient.cs" />
     <Compile Include="GUI\GUIColorGradient.cs" />
-    <Compile Include="GUI\GUICurveField.cs" />
     <Compile Include="Inspectors\AnimationClipInspector.cs" />
     <Compile Include="Inspectors\AnimationClipInspector.cs" />
     <Compile Include="Inspectors\AnimationInspector.cs" />
     <Compile Include="Inspectors\AnimationInspector.cs" />
     <Compile Include="Inspectors\AudioClipInspector.cs" />
     <Compile Include="Inspectors\AudioClipInspector.cs" />

+ 1 - 1
Source/Scripting/MBansheeEditor/Windows/Animation/GUIGraphTime.cs

@@ -99,7 +99,7 @@ namespace BansheeEditor
             {
             {
                 bool drawText = i == 0;
                 bool drawText = i == 0;
 
 
-                float[] ticks = tickHandler.GetTicks(i);
+                float[] ticks = tickHandler.GetTicks((uint)i);
                 float strength = tickHandler.GetLevelStrength((uint)i);
                 float strength = tickHandler.GetLevelStrength((uint)i);
 
 
                 if (ticks.Length > 0)
                 if (ticks.Length > 0)

+ 1 - 1
Source/Scripting/MBansheeEditor/Windows/Animation/GUIGraphValues.cs

@@ -128,7 +128,7 @@ namespace BansheeEditor
             int numTickLevels = (int)tickHandler.NumLevels;
             int numTickLevels = (int)tickHandler.NumLevels;
             for (int i = numTickLevels - 1; i >= 0; i--)
             for (int i = numTickLevels - 1; i >= 0; i--)
             {
             {
-                float[] ticks = tickHandler.GetTicks(i);
+                float[] ticks = tickHandler.GetTicks((uint)i);
                 float strength = tickHandler.GetLevelStrength((uint)i);
                 float strength = tickHandler.GetLevelStrength((uint)i);
                
                
                 if (ticks.Length > 0)
                 if (ticks.Length > 0)

+ 0 - 6
Source/Scripting/MBansheeEngine/Generated/AnimationUtility.generated.cs

@@ -38,12 +38,6 @@ namespace BansheeEngine
 			return Internal_combineCurve(curveComponents);
 			return Internal_combineCurve(curveComponents);
 		}
 		}
 
 
-		/// <summary>Calculates the total range covered by a set of curves.</summary>
-		/// <param name="curves">Curves to calculate range for.</param>
-		/// <param name="xMin">Minimum time value present in the curves.</param>
-		/// <param name="xMax">Maximum time value present in the curves.</param>
-		/// <param name="yMin">Minimum curve value present in the curves.</param>
-		/// <param name="yMax">Maximum curve value present in the curves.</param>
 		public static void CalculateRange(AnimationCurve[] curves, out float xMin, out float xMax, out float yMin, out float yMax)
 		public static void CalculateRange(AnimationCurve[] curves, out float xMin, out float xMax, out float yMin, out float yMax)
 		{
 		{
 			Internal_calculateRange(curves, out xMin, out xMax, out yMin, out yMax);
 			Internal_calculateRange(curves, out xMin, out xMax, out yMin, out yMax);

+ 1 - 1
Source/Scripting/MBansheeEngine/Generated/CAudioSource.generated.cs

@@ -20,7 +20,7 @@ namespace BansheeEngine
 		private AudioSource(bool __dummy0) { }
 		private AudioSource(bool __dummy0) { }
 		protected AudioSource() { }
 		protected AudioSource() { }
 
 
-		/// <summary>Aaudio clip to play.</summary>
+		/// <summary>Audio clip to play.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
 		public RRef<AudioClip> Clip
 		public RRef<AudioClip> Clip
 		{
 		{

+ 52 - 0
Source/Scripting/MBansheeEngine/Generated/TAnimationCurve.generated.cs

@@ -106,6 +106,58 @@ namespace BansheeEngine
 
 
 	/** @} */
 	/** @} */
 
 
+	/** @addtogroup Animation
+	 *  @{
+	 */
+
+	/// <summary>
+	/// Animation spline represented by a set of keyframes, each representing an endpoint of a cubic hermite curve. The spline 
+	/// can be evaluated at any time, and uses caching to speed up multiple sequential evaluations.
+	/// </summary>
+	public partial class Vector2Curve : ScriptObject
+	{
+		private Vector2Curve(bool __dummy0) { }
+		protected Vector2Curve() { }
+
+		/// <summary>Creates a new animation curve.</summary>
+		/// <param name="keyframes">Keyframes to initialize the curve with. They must be sorted by time.</param>
+		public Vector2Curve(KeyFrameVec2[] keyframes)
+		{
+			Internal_TAnimationCurve(this, keyframes);
+		}
+
+		/// <summary>Returns a list of all keyframes in the curve.</summary>
+		public KeyFrameVec2[] KeyFrames
+		{
+			get { return Internal_getKeyFrames(mCachedPtr); }
+		}
+
+		/// <summary>
+		/// Evaluate the animation curve at the specified time. If evaluating multiple values in a sequential order consider 
+		/// using the cached version of evaluate() for better performance.
+		/// </summary>
+		/// <param name="time">%Time to evaluate the curve at.</param>
+		/// <param name="loop">
+		/// If true the curve will loop when it goes past the end or beggining. Otherwise the curve  value will be clamped.
+		/// </param>
+		/// <returns>Interpolated value from the curve at provided time.</returns>
+		public Vector2 Evaluate(float time, bool loop = true)
+		{
+			Vector2 temp;
+			Internal_evaluate(mCachedPtr, time, loop, out temp);
+			return temp;
+		}
+
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_TAnimationCurve(Vector2Curve managedInstance, KeyFrameVec2[] keyframes);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern void Internal_evaluate(IntPtr thisPtr, float time, bool loop, out Vector2 __output);
+		[MethodImpl(MethodImplOptions.InternalCall)]
+		private static extern KeyFrameVec2[] Internal_getKeyFrames(IntPtr thisPtr);
+	}
+
+	/** @} */
+
 	/** @addtogroup Animation
 	/** @addtogroup Animation
 	 *  @{
 	 *  @{
 	 */
 	 */

+ 20 - 0
Source/Scripting/MBansheeEngine/Generated/TKeyframe.generated.cs

@@ -60,6 +60,26 @@ namespace BansheeEngine
 
 
 	/** @} */
 	/** @} */
 
 
+	/** @addtogroup Animation
+	 *  @{
+	 */
+
+	/// <summary>Animation keyframe, represented as an endpoint of a cubic hermite spline.</summary>
+	[StructLayout(LayoutKind.Sequential), SerializeObject]
+	public partial struct KeyFrameVec2
+	{
+		/// <summary>Value of the key.</summary>
+		public Vector2 value;
+		/// <summary>Input tangent (going from the previous key to this one) of the key.</summary>
+		public Vector2 inTangent;
+		/// <summary>Output tangent (going from this key to next one) of the key.</summary>
+		public Vector2 outTangent;
+		/// <summary>Position of the key along the animation spline.</summary>
+		public float time;
+	}
+
+	/** @} */
+
 	/** @addtogroup Animation
 	/** @addtogroup Animation
 	 *  @{
 	 *  @{
 	 */
 	 */

+ 50 - 0
Source/Scripting/MBansheeEngine/Generated/TNamedAnimationCurve.generated.cs

@@ -104,6 +104,56 @@ namespace BansheeEngine
 
 
 	/** @} */
 	/** @} */
 
 
+	/** @addtogroup Animation
+	 *  @{
+	 */
+
+	/// <summary>An animation curve and its name.</summary>
+	[StructLayout(LayoutKind.Sequential), SerializeObject]
+	public partial struct NamedVector2Curve
+	{
+		/// <summary>Initializes the struct with default values.</summary>
+		public static NamedVector2Curve Default()
+		{
+			NamedVector2Curve value = new NamedVector2Curve();
+			value.name = "";
+			value.flags = (AnimationCurveFlags)0;
+			value.curve = null;
+
+			return value;
+		}
+
+		/// <summary>Constructs a new named animation curve.</summary>
+		/// <param name="name">Name of the curve.</param>
+		/// <param name="curve">Curve containing the animation data.</param>
+		public NamedVector2Curve(string name, Vector2Curve curve)
+		{
+			this.name = name;
+			this.flags = (AnimationCurveFlags)0;
+			this.curve = curve;
+		}
+
+		/// <summary>Constructs a new named animation curve.</summary>
+		/// <param name="name">Name of the curve.</param>
+		/// <param name="flags">Flags that describe the animation curve.</param>
+		/// <param name="curve">Curve containing the animation data.</param>
+		public NamedVector2Curve(string name, AnimationCurveFlags flags, Vector2Curve curve)
+		{
+			this.name = name;
+			this.flags = (AnimationCurveFlags)0;
+			this.curve = curve;
+		}
+
+		/// <summary>Name of the curve.</summary>
+		public string name;
+		/// <summary>Flags that describe the animation curve.</summary>
+		public AnimationCurveFlags flags;
+		/// <summary>Actual curve containing animation data.</summary>
+		public Vector2Curve curve;
+	}
+
+	/** @} */
+
 	/** @addtogroup Animation
 	/** @addtogroup Animation
 	 *  @{
 	 *  @{
 	 */
 	 */

+ 111 - 0
Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.cpp

@@ -0,0 +1,111 @@
+#include "BsScriptGUICurvesField.generated.h"
+#include "BsMonoMethod.h"
+#include "BsMonoClass.h"
+#include "BsMonoUtil.h"
+#include "../../../EditorCore/GUI/BsGUICurvesField.h"
+#include "BsScriptHString.generated.h"
+#include "BsScriptTAnimationCurve.generated.h"
+#include "BsScriptGUIContent.generated.h"
+#include "../../../EditorCore/GUI/BsGUICurvesField.h"
+
+namespace bs
+{
+	ScriptGUICurvesField::onClickedThunkDef ScriptGUICurvesField::onClickedThunk; 
+
+	ScriptGUICurvesField::ScriptGUICurvesField(MonoObject* managedInstance, GUICurvesField* value)
+		:TScriptGUIElement(managedInstance, value)
+	{
+		value->onClicked.connect(std::bind(&ScriptGUICurvesField::onClicked, this));
+	}
+
+	void ScriptGUICurvesField::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_setCurve", (void*)&ScriptGUICurvesField::Internal_setCurve);
+		metaData.scriptClass->addInternalCall("Internal_setCurveRange", (void*)&ScriptGUICurvesField::Internal_setCurveRange);
+		metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUICurvesField::Internal_create);
+		metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUICurvesField::Internal_create0);
+		metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUICurvesField::Internal_create1);
+		metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUICurvesField::Internal_create2);
+		metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUICurvesField::Internal_create3);
+
+		onClickedThunk = (onClickedThunkDef)metaData.scriptClass->getMethodExact("Internal_onClicked", "")->getThunk();
+	}
+
+	void ScriptGUICurvesField::onClicked()
+	{
+		MonoUtil::invokeThunk(onClickedThunk, getManagedInstance());
+	}
+	void ScriptGUICurvesField::Internal_setCurve(ScriptGUICurvesField* thisPtr, MonoObject* curve)
+	{
+		SPtr<TAnimationCurve<float>> tmpcurve;
+		ScriptTAnimationCurvefloat* scriptcurve;
+		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
+		tmpcurve = scriptcurve->getInternal();
+		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
+	}
+
+	void ScriptGUICurvesField::Internal_setCurveRange(ScriptGUICurvesField* thisPtr, MonoObject* curveA, MonoObject* curveB)
+	{
+		SPtr<TAnimationCurve<float>> tmpcurveA;
+		ScriptTAnimationCurvefloat* scriptcurveA;
+		scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
+		tmpcurveA = scriptcurveA->getInternal();
+		SPtr<TAnimationCurve<float>> tmpcurveB;
+		ScriptTAnimationCurvefloat* scriptcurveB;
+		scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
+		tmpcurveB = scriptcurveB->getInternal();
+		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
+	}
+
+	void ScriptGUICurvesField::Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
+	{
+		GUIContent tmplabelContent;
+		tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
+		String tmpstyle;
+		tmpstyle = MonoUtil::monoToString(style);
+		GUICurvesField* instance = GUICurvesField::create(tmplabelContent, labelWidth, tmpstyle);
+		new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
+	}
+
+	void ScriptGUICurvesField::Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
+	{
+		GUIContent tmplabelContent;
+		tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
+		String tmpstyle;
+		tmpstyle = MonoUtil::monoToString(style);
+		GUICurvesField* instance = GUICurvesField::create(tmplabelContent, tmpstyle);
+		new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
+	}
+
+	void ScriptGUICurvesField::Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
+	{
+		SPtr<HString> tmplabelText;
+		ScriptHString* scriptlabelText;
+		scriptlabelText = ScriptHString::toNative(labelText);
+		tmplabelText = scriptlabelText->getInternal();
+		String tmpstyle;
+		tmpstyle = MonoUtil::monoToString(style);
+		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
+		new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
+	}
+
+	void ScriptGUICurvesField::Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
+	{
+		SPtr<HString> tmplabelText;
+		ScriptHString* scriptlabelText;
+		scriptlabelText = ScriptHString::toNative(labelText);
+		tmplabelText = scriptlabelText->getInternal();
+		String tmpstyle;
+		tmpstyle = MonoUtil::monoToString(style);
+		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);
+		new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
+	}
+
+	void ScriptGUICurvesField::Internal_create3(MonoObject* managedInstance, MonoString* style)
+	{
+		String tmpstyle;
+		tmpstyle = MonoUtil::monoToString(style);
+		GUICurvesField* instance = GUICurvesField::create(tmpstyle);
+		new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
+	}
+}

+ 34 - 0
Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.h

@@ -0,0 +1,34 @@
+#pragma once
+
+#include "BsScriptEditorPrerequisites.h"
+#include "Wrappers/GUI/BsScriptGUIElement.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Localization/BsHString.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
+
+namespace bs
+{
+	class GUICurvesField;
+	struct __GUIContentInterop;
+
+	class BS_SCR_BED_EXPORT ScriptGUICurvesField : public TScriptGUIElement<ScriptGUICurvesField>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUICurvesField")
+
+		ScriptGUICurvesField(MonoObject* managedInstance, GUICurvesField* value);
+
+	private:
+		void onClicked();
+
+		typedef void(BS_THUNKCALL *onClickedThunkDef) (MonoObject*, MonoException**);
+		static onClickedThunkDef onClickedThunk;
+
+		static void Internal_setCurve(ScriptGUICurvesField* thisPtr, MonoObject* curve);
+		static void Internal_setCurveRange(ScriptGUICurvesField* thisPtr, MonoObject* curveA, MonoObject* curveB);
+		static void Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style);
+		static void Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style);
+		static void Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style);
+		static void Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style);
+		static void Internal_create3(MonoObject* managedInstance, MonoString* style);
+	};
+}

+ 1 - 1
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIGraphTicks.generated.cpp

@@ -71,7 +71,7 @@ namespace bs
 		return __output;
 		return __output;
 	}
 	}
 
 
-	MonoArray* ScriptGUIGraphTicks::Internal_getTicks(ScriptGUIGraphTicks* thisPtr, int32_t level)
+	MonoArray* ScriptGUIGraphTicks::Internal_getTicks(ScriptGUIGraphTicks* thisPtr, uint32_t level)
 	{
 	{
 		Vector<float> vec__output;
 		Vector<float> vec__output;
 		vec__output = thisPtr->getInternal()->getTicks(level);
 		vec__output = thisPtr->getInternal()->getTicks(level);

+ 1 - 1
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIGraphTicks.generated.h

@@ -26,6 +26,6 @@ namespace bs
 		static void Internal_setRange(ScriptGUIGraphTicks* thisPtr, float valueRangeStart, float valueRangeEnd, uint32_t pixelRange);
 		static void Internal_setRange(ScriptGUIGraphTicks* thisPtr, float valueRangeStart, float valueRangeEnd, uint32_t pixelRange);
 		static void Internal_setTickSpacing(ScriptGUIGraphTicks* thisPtr, int32_t minPx, int32_t maxPx);
 		static void Internal_setTickSpacing(ScriptGUIGraphTicks* thisPtr, int32_t minPx, int32_t maxPx);
 		static float Internal_getLevelStrength(ScriptGUIGraphTicks* thisPtr, uint32_t level);
 		static float Internal_getLevelStrength(ScriptGUIGraphTicks* thisPtr, uint32_t level);
-		static MonoArray* Internal_getTicks(ScriptGUIGraphTicks* thisPtr, int32_t level);
+		static MonoArray* Internal_getTicks(ScriptGUIGraphTicks* thisPtr, uint32_t level);
 	};
 	};
 }
 }

+ 67 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTAnimationCurve.generated.cpp

@@ -6,6 +6,8 @@
 #include "BsScriptTKeyframe.generated.h"
 #include "BsScriptTKeyframe.generated.h"
 #include "BsScriptTKeyframe.generated.h"
 #include "BsScriptTKeyframe.generated.h"
 #include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptVector.h"
+#include "BsScriptTKeyframe.generated.h"
+#include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptQuaternion.h"
 #include "Wrappers/BsScriptQuaternion.h"
 #include "BsScriptTKeyframe.generated.h"
 #include "BsScriptTKeyframe.generated.h"
 
 
@@ -144,6 +146,71 @@ namespace bs
 		return __output;
 		return __output;
 	}
 	}
 
 
+	ScriptTAnimationCurveVector2::ScriptTAnimationCurveVector2(MonoObject* managedInstance, const SPtr<TAnimationCurve<Vector2>>& value)
+		:ScriptObject(managedInstance), mInternal(value)
+	{
+	}
+
+	void ScriptTAnimationCurveVector2::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_TAnimationCurve", (void*)&ScriptTAnimationCurveVector2::Internal_TAnimationCurve);
+		metaData.scriptClass->addInternalCall("Internal_evaluate", (void*)&ScriptTAnimationCurveVector2::Internal_evaluate);
+		metaData.scriptClass->addInternalCall("Internal_getKeyFrames", (void*)&ScriptTAnimationCurveVector2::Internal_getKeyFrames);
+
+	}
+
+	MonoObject* ScriptTAnimationCurveVector2::create(const SPtr<TAnimationCurve<Vector2>>& value)
+	{
+		if(value == nullptr) return nullptr; 
+
+		bool dummy = false;
+		void* ctorParams[1] = { &dummy };
+
+		MonoObject* managedInstance = metaData.scriptClass->createInstance("bool", ctorParams);
+		new (bs_alloc<ScriptTAnimationCurveVector2>()) ScriptTAnimationCurveVector2(managedInstance, value);
+		return managedInstance;
+	}
+	void ScriptTAnimationCurveVector2::Internal_TAnimationCurve(MonoObject* managedInstance, MonoArray* keyframes)
+	{
+		Vector<TKeyframe<Vector2>> veckeyframes;
+		if(keyframes != nullptr)
+		{
+			ScriptArray arraykeyframes(keyframes);
+			veckeyframes.resize(arraykeyframes.size());
+			for(int i = 0; i < (int)arraykeyframes.size(); i++)
+			{
+				veckeyframes[i] = ScriptTKeyframeVector2::fromInterop(arraykeyframes.get<__TKeyframeVector2Interop>(i));
+			}
+		}
+		SPtr<TAnimationCurve<Vector2>> instance = bs_shared_ptr_new<TAnimationCurve<Vector2>>(veckeyframes);
+		new (bs_alloc<ScriptTAnimationCurveVector2>())ScriptTAnimationCurveVector2(managedInstance, instance);
+	}
+
+	void ScriptTAnimationCurveVector2::Internal_evaluate(ScriptTAnimationCurveVector2* thisPtr, float time, bool loop, Vector2* __output)
+	{
+		Vector2 tmp__output;
+		tmp__output = thisPtr->getInternal()->evaluate(time, loop);
+
+		*__output = tmp__output;
+	}
+
+	MonoArray* ScriptTAnimationCurveVector2::Internal_getKeyFrames(ScriptTAnimationCurveVector2* thisPtr)
+	{
+		Vector<TKeyframe<Vector2>> vec__output;
+		vec__output = thisPtr->getInternal()->getKeyFrames();
+
+		MonoArray* __output;
+		int arraySize__output = (int)vec__output.size();
+		ScriptArray array__output = ScriptArray::create<ScriptTKeyframeVector2>(arraySize__output);
+		for(int i = 0; i < arraySize__output; i++)
+		{
+			array__output.set(i, ScriptTKeyframeVector2::toInterop(vec__output[i]));
+		}
+		__output = array__output.getInternal();
+
+		return __output;
+	}
+
 	ScriptTAnimationCurveQuaternion::ScriptTAnimationCurveQuaternion(MonoObject* managedInstance, const SPtr<TAnimationCurve<Quaternion>>& value)
 	ScriptTAnimationCurveQuaternion::ScriptTAnimationCurveQuaternion(MonoObject* managedInstance, const SPtr<TAnimationCurve<Quaternion>>& value)
 		:ScriptObject(managedInstance), mInternal(value)
 		:ScriptObject(managedInstance), mInternal(value)
 	{
 	{

+ 22 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTAnimationCurve.generated.h

@@ -9,7 +9,10 @@
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "BsScriptObject.h"
 #include "BsScriptObject.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
+#include "BsScriptObject.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "Math/BsVector3.h"
 #include "Math/BsVector3.h"
+#include "Math/BsVector2.h"
 #include "Math/BsQuaternion.h"
 #include "Math/BsQuaternion.h"
 
 
 namespace bs
 namespace bs
@@ -17,6 +20,7 @@ namespace bs
 	struct __TKeyframeQuaternionInterop;
 	struct __TKeyframeQuaternionInterop;
 	template<class T0> class TAnimationCurve;
 	template<class T0> class TAnimationCurve;
 	struct __TKeyframeVector3Interop;
 	struct __TKeyframeVector3Interop;
+	struct __TKeyframeVector2Interop;
 
 
 	class BS_SCR_BE_EXPORT ScriptTAnimationCurvefloat : public ScriptObject<ScriptTAnimationCurvefloat>
 	class BS_SCR_BE_EXPORT ScriptTAnimationCurvefloat : public ScriptObject<ScriptTAnimationCurvefloat>
 	{
 	{
@@ -54,6 +58,24 @@ namespace bs
 		static MonoArray* Internal_getKeyFrames(ScriptTAnimationCurveVector3* thisPtr);
 		static MonoArray* Internal_getKeyFrames(ScriptTAnimationCurveVector3* thisPtr);
 	};
 	};
 
 
+	class BS_SCR_BE_EXPORT ScriptTAnimationCurveVector2 : public ScriptObject<ScriptTAnimationCurveVector2>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "Vector2Curve")
+
+		ScriptTAnimationCurveVector2(MonoObject* managedInstance, const SPtr<TAnimationCurve<Vector2>>& value);
+
+		SPtr<TAnimationCurve<Vector2>> getInternal() const { return mInternal; }
+		static MonoObject* create(const SPtr<TAnimationCurve<Vector2>>& value);
+
+	private:
+		SPtr<TAnimationCurve<Vector2>> mInternal;
+
+		static void Internal_TAnimationCurve(MonoObject* managedInstance, MonoArray* keyframes);
+		static void Internal_evaluate(ScriptTAnimationCurveVector2* thisPtr, float time, bool loop, Vector2* __output);
+		static MonoArray* Internal_getKeyFrames(ScriptTAnimationCurveVector2* thisPtr);
+	};
+
 	class BS_SCR_BE_EXPORT ScriptTAnimationCurveQuaternion : public ScriptObject<ScriptTAnimationCurveQuaternion>
 	class BS_SCR_BE_EXPORT ScriptTAnimationCurveQuaternion : public ScriptObject<ScriptTAnimationCurveQuaternion>
 	{
 	{
 	public:
 	public:

+ 42 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTKeyframe.generated.cpp

@@ -5,6 +5,8 @@
 #include "Wrappers/BsScriptQuaternion.h"
 #include "Wrappers/BsScriptQuaternion.h"
 #include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptVector.h"
+#include "Wrappers/BsScriptVector.h"
+#include "Wrappers/BsScriptVector.h"
 #include "Wrappers/BsScriptQuaternion.h"
 #include "Wrappers/BsScriptQuaternion.h"
 
 
 namespace bs
 namespace bs
@@ -85,6 +87,46 @@ namespace bs
 	}
 	}
 
 
 
 
+	ScriptTKeyframeVector2::ScriptTKeyframeVector2(MonoObject* managedInstance)
+		:ScriptObject(managedInstance)
+	{ }
+
+	void ScriptTKeyframeVector2::initRuntimeData()
+	{ }
+
+	MonoObject*ScriptTKeyframeVector2::box(const __TKeyframeVector2Interop& value)
+	{
+		return MonoUtil::box(metaData.scriptClass->_getInternalClass(), (void*)&value);
+	}
+
+	__TKeyframeVector2Interop ScriptTKeyframeVector2::unbox(MonoObject* value)
+	{
+		return *(__TKeyframeVector2Interop*)MonoUtil::unbox(value);
+	}
+
+	TKeyframe<Vector2> ScriptTKeyframeVector2::fromInterop(const __TKeyframeVector2Interop& value)
+	{
+		TKeyframe<Vector2> output;
+		output.value = value.value;
+		output.inTangent = value.inTangent;
+		output.outTangent = value.outTangent;
+		output.time = value.time;
+
+		return output;
+	}
+
+	__TKeyframeVector2Interop ScriptTKeyframeVector2::toInterop(const TKeyframe<Vector2>& value)
+	{
+		__TKeyframeVector2Interop output;
+		output.value = value.value;
+		output.inTangent = value.inTangent;
+		output.outTangent = value.outTangent;
+		output.time = value.time;
+
+		return output;
+	}
+
+
 	ScriptTKeyframeQuaternion::ScriptTKeyframeQuaternion(MonoObject* managedInstance)
 	ScriptTKeyframeQuaternion::ScriptTKeyframeQuaternion(MonoObject* managedInstance)
 		:ScriptObject(managedInstance)
 		:ScriptObject(managedInstance)
 	{ }
 	{ }

+ 26 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTKeyframe.generated.h

@@ -9,7 +9,10 @@
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "BsScriptObject.h"
 #include "BsScriptObject.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
+#include "BsScriptObject.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "Math/BsVector3.h"
 #include "Math/BsVector3.h"
+#include "Math/BsVector2.h"
 #include "Math/BsQuaternion.h"
 #include "Math/BsQuaternion.h"
 
 
 namespace bs
 namespace bs
@@ -63,6 +66,29 @@ namespace bs
 
 
 	};
 	};
 
 
+	struct __TKeyframeVector2Interop
+	{
+		Vector2 value;
+		Vector2 inTangent;
+		Vector2 outTangent;
+		float time;
+	};
+
+	class BS_SCR_BE_EXPORT ScriptTKeyframeVector2 : public ScriptObject<ScriptTKeyframeVector2>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "KeyFrameVec2")
+
+		static MonoObject* box(const __TKeyframeVector2Interop& value);
+		static __TKeyframeVector2Interop unbox(MonoObject* value);
+		static TKeyframe<Vector2> fromInterop(const __TKeyframeVector2Interop& value);
+		static __TKeyframeVector2Interop toInterop(const TKeyframe<Vector2>& value);
+
+	private:
+		ScriptTKeyframeVector2(MonoObject* managedInstance);
+
+	};
+
 	struct __TKeyframeQuaternionInterop
 	struct __TKeyframeQuaternionInterop
 	{
 	{
 		Quaternion value;
 		Quaternion value;

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

@@ -10,6 +10,8 @@
 #include "BsScriptTAnimationCurve.generated.h"
 #include "BsScriptTAnimationCurve.generated.h"
 #include "BsScriptTAnimationCurve.generated.h"
 #include "BsScriptTAnimationCurve.generated.h"
 #include "BsScriptTAnimationCurve.generated.h"
 #include "BsScriptTAnimationCurve.generated.h"
+#include "BsScriptTAnimationCurve.generated.h"
+#include "BsScriptTAnimationCurve.generated.h"
 
 
 namespace bs
 namespace bs
 {
 {
@@ -117,6 +119,58 @@ namespace bs
 	}
 	}
 
 
 
 
+	ScriptTNamedAnimationCurveVector2::ScriptTNamedAnimationCurveVector2(MonoObject* managedInstance)
+		:ScriptObject(managedInstance)
+	{ }
+
+	void ScriptTNamedAnimationCurveVector2::initRuntimeData()
+	{ }
+
+	MonoObject*ScriptTNamedAnimationCurveVector2::box(const __TNamedAnimationCurveVector2Interop& value)
+	{
+		return MonoUtil::box(metaData.scriptClass->_getInternalClass(), (void*)&value);
+	}
+
+	__TNamedAnimationCurveVector2Interop ScriptTNamedAnimationCurveVector2::unbox(MonoObject* value)
+	{
+		return *(__TNamedAnimationCurveVector2Interop*)MonoUtil::unbox(value);
+	}
+
+	TNamedAnimationCurve<Vector2> ScriptTNamedAnimationCurveVector2::fromInterop(const __TNamedAnimationCurveVector2Interop& value)
+	{
+		TNamedAnimationCurve<Vector2> output;
+		String tmpname;
+		tmpname = MonoUtil::monoToString(value.name);
+		output.name = tmpname;
+		output.flags = value.flags;
+		SPtr<TAnimationCurve<Vector2>> tmpcurve;
+		ScriptTAnimationCurveVector2* scriptcurve;
+		scriptcurve = ScriptTAnimationCurveVector2::toNative(value.curve);
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
+		if(tmpcurve != nullptr)
+		output.curve = *tmpcurve;
+
+		return output;
+	}
+
+	__TNamedAnimationCurveVector2Interop ScriptTNamedAnimationCurveVector2::toInterop(const TNamedAnimationCurve<Vector2>& value)
+	{
+		__TNamedAnimationCurveVector2Interop output;
+		MonoString* tmpname;
+		tmpname = MonoUtil::stringToMono(value.name);
+		output.name = tmpname;
+		output.flags = value.flags;
+		MonoObject* tmpcurve;
+		SPtr<TAnimationCurve<Vector2>> tmpcurvecopy;
+		tmpcurvecopy = bs_shared_ptr_new<TAnimationCurve<Vector2>>(value.curve);
+		tmpcurve = ScriptTAnimationCurveVector2::create(tmpcurvecopy);
+		output.curve = tmpcurve;
+
+		return output;
+	}
+
+
 	ScriptTNamedAnimationCurveQuaternion::ScriptTNamedAnimationCurveQuaternion(MonoObject* managedInstance)
 	ScriptTNamedAnimationCurveQuaternion::ScriptTNamedAnimationCurveQuaternion(MonoObject* managedInstance)
 		:ScriptObject(managedInstance)
 		:ScriptObject(managedInstance)
 	{ }
 	{ }

+ 25 - 0
Source/Scripting/SBansheeEngine/Generated/BsScriptTNamedAnimationCurve.generated.h

@@ -9,6 +9,9 @@
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "BsScriptObject.h"
 #include "BsScriptObject.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
+#include "BsScriptObject.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
+#include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Animation/BsAnimationCurve.h"
@@ -61,6 +64,28 @@ namespace bs
 
 
 	};
 	};
 
 
+	struct __TNamedAnimationCurveVector2Interop
+	{
+		MonoString* name;
+		Flags<AnimationCurveFlag> flags;
+		MonoObject* curve;
+	};
+
+	class BS_SCR_BE_EXPORT ScriptTNamedAnimationCurveVector2 : public ScriptObject<ScriptTNamedAnimationCurveVector2>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "NamedVector2Curve")
+
+		static MonoObject* box(const __TNamedAnimationCurveVector2Interop& value);
+		static __TNamedAnimationCurveVector2Interop unbox(MonoObject* value);
+		static TNamedAnimationCurve<Vector2> fromInterop(const __TNamedAnimationCurveVector2Interop& value);
+		static __TNamedAnimationCurveVector2Interop toInterop(const TNamedAnimationCurve<Vector2>& value);
+
+	private:
+		ScriptTNamedAnimationCurveVector2(MonoObject* managedInstance);
+
+	};
+
 	struct __TNamedAnimationCurveQuaternionInterop
 	struct __TNamedAnimationCurveQuaternionInterop
 	{
 	{
 		MonoString* name;
 		MonoString* name;