diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/IMGUI/GUIContent.h |
Diffstat (limited to 'Runtime/IMGUI/GUIContent.h')
-rw-r--r-- | Runtime/IMGUI/GUIContent.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Runtime/IMGUI/GUIContent.h b/Runtime/IMGUI/GUIContent.h new file mode 100644 index 0000000..5570bf8 --- /dev/null +++ b/Runtime/IMGUI/GUIContent.h @@ -0,0 +1,36 @@ +#ifndef GUIContent_H +#define GUIContent_H + +#include "Runtime/IMGUI/TextUtil.h" +#include "Runtime/Graphics/Texture.h" +#include "Runtime/Utilities/dynamic_array.h" +#include "Runtime/Misc/UTF8.h" + +struct GUIContent +{ + UTF16String m_Text; + UTF16String m_Tooltip; + PPtr<Texture> m_Image; + + void operator = (const GUIContent& other) + { + m_Text.CopyString(other.m_Text); + m_Tooltip.CopyString(other.m_Tooltip); + m_Image = other.m_Image; + } +}; + +#if ENABLE_SCRIPTING + +struct MonoGUIContent +{ + ScriptingStringPtr m_Text; + ScriptingObjectPtr m_Image; + ScriptingStringPtr m_Tooltip; +}; + +GUIContent &MonoGUIContentToTempNative (ScriptingObjectPtr monoContent); +void MonoGUIContentToNative (ScriptingObjectPtr monoContent, GUIContent& cppContent); +#endif + +#endif |