using System; using System.Runtime.CompilerServices; namespace BansheeEngine { /// /// A resource containing compileable script code. /// public class ScriptCode : Resource { /// /// Constructor for internal use by the runtime. /// private ScriptCode() { } /// /// Script code text. /// public string Text { get { return Internal_GetText(mCachedPtr); } set { Internal_SetText(mCachedPtr, value); } } /// /// Determines should the script code be compiled with editor assemblies. /// public bool EditorScript { get { return Internal_IsEditorScript(mCachedPtr); } set { Internal_SetEditorScript(mCachedPtr, value); } } /// /// Returns all script types that have been created when this script code resource was compiled. /// public Type[] Types { get { return Internal_GetTypes(mCachedPtr); } } [MethodImpl(MethodImplOptions.InternalCall)] private static extern string Internal_GetText(IntPtr thisPtr); [MethodImpl(MethodImplOptions.InternalCall)] private static extern void Internal_SetText(IntPtr thisPtr, string value); [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool Internal_IsEditorScript(IntPtr thisPtr); [MethodImpl(MethodImplOptions.InternalCall)] private static extern void Internal_SetEditorScript(IntPtr thisPtr, bool value); [MethodImpl(MethodImplOptions.InternalCall)] private static extern Type[] Internal_GetTypes(IntPtr thisPtr); } }