BsScriptGUIGameObjectField.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEditorPrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Interop class between C++ & CLR for GUIGameObjectField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUIGameObjectField : public TScriptGUIElement<ScriptGUIGameObjectField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIGameObjectField")
  15. private:
  16. /**
  17. * @brief Triggered when the value in the native game object field changes.
  18. *
  19. * @param instance Managed GUIGameObjectField instance.
  20. * @param newValue New field value.
  21. */
  22. static void onChanged(MonoObject* instance, const HGameObject& newValue);
  23. /**
  24. * @brief Retrieves a managed instance of the specified native game object.
  25. * Will return null if one doesn't exist.
  26. */
  27. static MonoObject* nativeToManagedGO(const HGameObject& instance);
  28. ScriptGUIGameObjectField(MonoObject* instance, GUIGameObjectField* GOField);
  29. /************************************************************************/
  30. /* CLR HOOKS */
  31. /************************************************************************/
  32. static void internal_createInstance(MonoObject* instance, MonoReflectionType* type, MonoObject* title, UINT32 titleWidth,
  33. MonoString* style, MonoArray* guiOptions, bool withTitle);
  34. static void internal_getValue(ScriptGUIGameObjectField* nativeInstance, MonoObject** output);
  35. static void internal_setValue(ScriptGUIGameObjectField* nativeInstance, MonoObject* value);
  36. static void internal_setTint(ScriptGUIGameObjectField* nativeInstance, Color* color);
  37. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
  38. static OnChangedThunkDef onChangedThunk;
  39. };
  40. }