Exemple #1
0
 private void StopLuaEvents()
 {
     update    = null;
     start     = null;
     awake     = null;
     onGUI     = null;
     onDestory = null;
 }
Exemple #2
0
        private void InitLuaEvents()
        {
            LuaFunction fun = null;

            fun = self["Start"] as LuaFunction;
            if (fun != null)
            {
                start = fun.cast <LuaStartDelegate>();
            }

            fun = self["Update"] as LuaFunction;
            if (fun != null)
            {
                update = fun.cast <LuaVoidDelegate>();
            }

            fun = self["Awake"] as LuaFunction;
            if (fun != null)
            {
                awake = fun.cast <LuaVoidDelegate>();
            }

            fun = self["OnGUI"] as LuaFunction;
            if (fun != null)
            {
                onGUI = fun.cast <LuaVoidDelegate>();
            }

            fun = self["FixedUpdate"] as LuaFunction;
            if (fun != null)
            {
                fixedUpdate = fun.cast <LuaVoidDelegate>();
            }

            fun = self["LateUpdate"] as LuaFunction;
            if (fun != null)
            {
                lateUpdate = fun.cast <LuaVoidDelegate>();
            }

            fun = self["onEnable"] as LuaFunction;
            if (fun != null)
            {
                onEnable = fun.cast <LuaVoidDelegate>();
            }

            fun = self["OnDisable"] as LuaFunction;
            if (fun != null)
            {
                onDisable = fun.cast <LuaVoidDelegate>();
            }

            fun = self["Reset"] as LuaFunction;
            if (fun != null)
            {
                reset = fun.cast <LuaVoidDelegate>();
            }
        }