Ejemplo n.º 1
0
        protected virtual void InitLuaFuns()
        {
            LuaFunction f = luaObjectHost.GetLuaFun("InitManager");

            if (f != null)
            {
                fnInitManager = f.cast <LuaReturnBoolDelegate>();
            }
            f = luaObjectHost.GetLuaFun("InitStore");
            if (f != null)
            {
                fnInitStore = f.cast <LuaStoreReturnBoolDelegate>();
            }
            f = luaObjectHost.GetLuaFun("InitActions");
            if (f != null)
            {
                fnInitActions = f.cast <LuaActionStoreReturnBoolDelegate>();
            }
            f = luaObjectHost.GetLuaFun("InitPre");
            if (f != null)
            {
                fnInitPre = f.cast <LuaVoidDelegate>();
            }
            f = luaObjectHost.GetLuaFun("ReleaseManager");
            if (f != null)
            {
                fnReleaseManager = f.cast <LuaReturnBoolDelegate>();
            }
        }
Ejemplo n.º 2
0
 private void StopLuaEvents()
 {
     update    = null;
     start     = null;
     awake     = null;
     onGUI     = null;
     onDestory = null;
 }
Ejemplo n.º 3
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>();
            }
        }
Ejemplo n.º 4
0
        public override void OnInitLua(GameLuaObjectHost host)
        {
            LuaFunction fun;

            self = host.LuaSelf;

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

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

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

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

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

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

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

            fun = self["OnBecameVisible"] as LuaFunction;
            if (fun != null)
            {
                luaOnBecameVisible = fun.cast <LuaVoidDelegate>();
            }
        }
Ejemplo n.º 5
0
        private void InitLuaFun()
        {
            self = GameLuaObjectHost.LuaSelf;
            LuaFunction fn = self["Active"] as LuaFunction;

            if (fn != null)
            {
                fnActive = fn.cast <LuaVector3Delegate>();
            }
            fn = self["Deactive"] as LuaFunction;
            if (fn != null)
            {
                fnDeactive = fn.cast <LuaVoidDelegate>();
            }
            fn = self["Init"] as LuaFunction;
            if (fn != null)
            {
                fnInit = fn.cast <LuaReturnBoolDelegate>();
            }
            fn = self["Destroy"] as LuaFunction;
            if (fn != null)
            {
                fnDestroy = fn.cast <LuaVoidDelegate>();
            }
            fn = self["BallPush"] as LuaFunction;
            if (fn != null)
            {
                fnBallPush = fn.cast <LuaVoidDelegate>();
            }
            fn = self["EndControll"] as LuaFunction;
            if (fn != null)
            {
                fnEndControll = fn.cast <LuaBoolDelegate>();
            }
            fn = self["Recover"] as LuaFunction;
            if (fn != null)
            {
                fnRecover = fn.cast <LuaVector3Delegate>();
            }
            fn = self["RemoveSpeed"] as LuaFunction;
            if (fn != null)
            {
                fnRemoveSpeed = fn.cast <LuaVoidDelegate>();
            }
            fn = self["StartControll"] as LuaFunction;
            if (fn != null)
            {
                fnStartControll = fn.cast <LuaVoidDelegate>();
            }
        }
Ejemplo n.º 6
0
        public override void OnInitLua(GameLuaObjectHost host)
        {
            LuaFunction fun;

            self = host.LuaSelf;

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

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

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

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

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

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

            fun = self["OnMouseUpAsButton"] as LuaFunction;
            if (fun != null)
            {
                luaOnMouseUpAsButton = fun.cast <LuaVoidDelegate>();
            }
        }
        public override void OnInitLua(GameLuaObjectHost host)
        {
            LuaFunction fun;

            self = host.LuaSelf;

            fun = self[supportEvents[0]] as LuaFunction;
            if (fun != null)
            {
                luaOnAnimatorIK = fun.cast <LuaIntDelegate>();
            }

            fun = self[supportEvents[1]] as LuaFunction;
            if (fun != null)
            {
                luaOnAnimatorMove = fun.cast <LuaVoidDelegate>();
            }
        }
Ejemplo n.º 8
0
        public override void OnInitLua(GameLuaObjectHost host)
        {
            LuaFunction fun;

            self = host.LuaSelf;

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

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

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