| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Runtime.CompilerServices;
- using BansheeEngine;
- namespace BansheeEditor
- {
- public sealed class GUIGameObjectField : GUIElement
- {
- public delegate void OnChangedDelegate(GameObject newValue);
- public event OnChangedDelegate OnChanged;
- public GameObject Value
- {
- get
- {
- GameObject value;
- Internal_GetValue(mCachedPtr, out value);
- return value;
- }
- set { Internal_SetValue(mCachedPtr, value); }
- }
- public GUIGameObjectField(Type type, GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
- {
- Internal_CreateInstance(this, type, title, titleWidth, style, options, true);
- }
- public GUIGameObjectField(Type type, string style = "", params GUIOption[] options)
- {
- Internal_CreateInstance(this, type, null, 0, style, options, false);
- }
- public void SetTint(Color color)
- {
- Internal_SetTint(mCachedPtr, color);
- }
- private void DoOnChanged(GameObject newValue)
- {
- if (OnChanged != null)
- OnChanged(newValue);
- }
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_CreateInstance(GUIGameObjectField instance, Type type, GUIContent title, int titleWidth,
- string style, GUIOption[] options, bool withTitle);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_GetValue(IntPtr nativeInstance, out GameObject value);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_SetValue(IntPtr nativeInstance, GameObject value);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
- }
- }
|