BsScriptGUIGameObjectField.h 1.7 KB

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