Ejemplo n.º 1
0
        public Component(IntPtr native) : this()
        {
            m_nativePtr = native;

            cbkAwake      = new ScriptableCallback(Awake);
            cbkStart      = new ScriptableCallback(Start);
            cbkUpdate     = new ScriptableCallback(Update);
            cbkLateUpdate = new ScriptableCallback(LateUpdate);
            cbkOnEnable   = new ScriptableCallback(OnEnable);
            cbkDisable    = new ScriptableCallback(OnDisable);

            //ComponentRegisterCallScriptable(native, ScriptableFuncType.Awake, cbkAwake);
            //ComponentRegisterCallScriptable(native, ScriptableFuncType.Start, cbkStart);
            //ComponentRegisterCallScriptable(native, ScriptableFuncType.Update, cbkUpdate);
            //ComponentRegisterCallScriptable(native, ScriptableFuncType.LateUpdate, cbkLateUpdate);
            //ComponentRegisterCallScriptable(native, ScriptableFuncType.OnEnable, cbkOnEnable);
            //ComponentRegisterCallScriptable(native, ScriptableFuncType.OnDisable, cbkDisable);
        }
Ejemplo n.º 2
0
        internal object Del(object val2, Context cx)
        {
            if (!(val2 is InterpretedFunction))
            {
                return(this);
            }
            InterpretedFunction ifn = (InterpretedFunction)val2;

            ScriptableCallback sc = (ScriptableCallback)Activator.CreateInstance(
                GetOrCreateType(m_EventInfo.EventHandlerType));

            sc.Context  = cx;
            sc.Function = ifn;
            sc.ThisObj  = ParentScope;
            sc.Scope    = ifn;
            m_EventInfo.RemoveEventHandler((ParentScope as CliObject).Object,
                                           Delegate.CreateDelegate(m_EventInfo.EventHandlerType, sc, "DynMethod")
                                           );
            return(this);
        }
Ejemplo n.º 3
0
 public static extern void ComponentRegisterCallScriptable(IntPtr native, ScriptableFuncType type, ScriptableCallback cbk);