挂接脚本入口的基类
Inheritance: ScriptRuntime.Base
        /// <summary>
        /// 是否挂载了某个类型的脚本
        /// </summary>
        /// <typeparam name="TScript">类名</typeparam>
        /// <returns>结果</returns>
        public bool ContainScript <TScript>()
        {
            int count = ICall_ScriptComponent_GetScriptInstanceCount(this);

            for (int i = 0; i < count; ++i)
            {
                ScriptableClass sc = ICall_ScriptComponent_GetScriptObject(this, i);
                if (null != sc)
                {
                    if (sc is TScript)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        /// <summary>
        /// 通过类名获得脚本实例
        /// </summary>
        /// <typeparam name="TScript">类名</typeparam>
        /// <returns>返回脚本实例</returns>
        public TScript GetScriptObject <TScript>()
            where TScript : ScriptableClass
        {
            int count = ICall_ScriptComponent_GetScriptInstanceCount(this);

            for (int i = 0; i < count; ++i)
            {
                ScriptableClass sc = ICall_ScriptComponent_GetScriptObject(this, i);
                if (null != sc)
                {
                    if (sc is TScript)
                    {
                        return(sc as TScript);
                    }
                }
            }
            return(null);
        }
示例#3
0
 private static extern void ICall_ScriptableClass_SetName(ScriptableClass self, String name);
示例#4
0
 private static extern void ICall_ScriptableClass_Release(ScriptableClass self);
示例#5
0
 private static extern Actor ICall_ScriptableClass_GetOwner(ScriptableClass self);
示例#6
0
 private static extern String ICall_ScriptableClass_GetName(ScriptableClass self);
 extern private static void ICall_ScriptableClass_Release(ScriptableClass self);
 extern private static String ICall_ScriptableClass_GetName(ScriptableClass self);
 extern private static void ICall_ScriptableClass_SetName(ScriptableClass self, String name);
 extern private static Actor ICall_ScriptableClass_GetOwner(ScriptableClass self);