Ejemplo n.º 1
0
        public void __Gen_Delegate_Imp1(UnityEngine.Collision2D p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int err_func   = LuaAPI.load_error_func(L, errorFuncRef);
            ObjectTranslator translator = luaEnv.translator;

            LuaAPI.lua_getref(L, luaReference);

            translator.Push(L, p0);

            int __gen_error = LuaAPI.lua_pcall(L, 1, 0, err_func);
            if (__gen_error != 0)
            {
                luaEnv.ThrowExceptionFromError(err_func - 1);
            }



            LuaAPI.lua_settop(L, err_func - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Ejemplo n.º 2
0
        public Entity AddCollision(UnityEngine.Collision2D newCollision)
        {
            var component = _collisionComponentPool.Count > 0 ? _collisionComponentPool.Pop() : new Assets.Entitasteroids.Scripts.Sources.Features.Physics.CollisionComponent();

            component.collision = newCollision;
            return(AddComponent(ComponentIds.Collision, component));
        }
    public void ReplaceCollisionEnter2D(UnityEngine.Collision2D newValue)
    {
        var index     = GameComponentsLookup.CollisionEnter2D;
        var component = (CollisionEnter2DComponent)CreateComponent(index, typeof(CollisionEnter2DComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 4
0
 void Execute(UnityEngine.Collision2D collision)
 {
     if (storeCollision.isAssigned)
     {
         storeCollision.Set(collision);
     }
     Finish();
 }
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *__ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new UnityEngine.Collision2D();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Ejemplo n.º 6
0
 public override void OnCollisionStay2D(UnityEngine.Collision2D collision)
 {
     if (Instance.mOnCollisionStay2D_24.CheckShouldInvokeBase(this.instance))
     {
         base.OnCollisionStay2D(collision);
     }
     else
     {
         Instance.mOnCollisionStay2D_24.Invoke(this.instance, collision);
     }
 }
        static int _g_get_relativeVelocity(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Collision2D gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineVector2(L, gen_to_be_invoked.relativeVelocity);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Ejemplo n.º 8
0
        static int _g_get_otherCollider(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.Collision2D __cl_gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);
                translator.Push(L, __cl_gen_to_be_invoked.otherCollider);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
        static int _g_get_contactCount(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Collision2D gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.contactCount);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Ejemplo n.º 10
0
        public Entity ReplaceCollision(UnityEngine.Collision2D newCollision)
        {
            var previousComponent = hasCollision ? collision : null;
            var component         = _collisionComponentPool.Count > 0 ? _collisionComponentPool.Pop() : new Assets.Entitasteroids.Scripts.Sources.Features.Physics.CollisionComponent();

            component.collision = newCollision;
            ReplaceComponent(ComponentIds.Collision, component);
            if (previousComponent != null)
            {
                _collisionComponentPool.Push(previousComponent);
            }
            return(this);
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    var gen_ret = new UnityEngine.Collision2D();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Collision2D constructor!"));
        }
        public void __Gen_Delegate_Imp20(UnityEngine.Collision2D p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.Push(L, p0);

            PCall(L, 1, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Ejemplo n.º 13
0
        static int _m_GetContacts(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.Collision2D gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <UnityEngine.ContactPoint2D[]>(L, 2))
                {
                    UnityEngine.ContactPoint2D[] _contacts = (UnityEngine.ContactPoint2D[])translator.GetObject(L, 2, typeof(UnityEngine.ContactPoint2D[]));

                    int gen_ret = gen_to_be_invoked.GetContacts(_contacts);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <System.Collections.Generic.List <UnityEngine.ContactPoint2D> >(L, 2))
                {
                    System.Collections.Generic.List <UnityEngine.ContactPoint2D> _contacts = (System.Collections.Generic.List <UnityEngine.ContactPoint2D>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <UnityEngine.ContactPoint2D>));

                    int gen_ret = gen_to_be_invoked.GetContacts(_contacts);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Collision2D.GetContacts!"));
        }
        static int _m_GetContacts(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.Collision2D gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.ContactPoint2D[] _contacts = (UnityEngine.ContactPoint2D[])translator.GetObject(L, 2, typeof(UnityEngine.ContactPoint2D[]));

                    var gen_ret = gen_to_be_invoked.GetContacts(_contacts);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_GetContact(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.Collision2D gen_to_be_invoked = (UnityEngine.Collision2D)translator.FastGetCSObj(L, 1);



                {
                    int _index = LuaAPI.xlua_tointeger(L, 2);

                    var gen_ret = gen_to_be_invoked.GetContact(_index);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// OnCollisionStay2D is called once per frame for every collider2D/rigidbody2D that is touching rigidbody2D/collider2D (2D physics only)
        /// </summary>
#if LOG_ONCOLLISIONSTAY2D
        protected virtual void OnCollisionStay2D(UnityEngine.Collision2D collision) => Log("OnCollisionStay2D", $"{this} [{GetInstanceID ()}] ({collision})");
Ejemplo n.º 17
0
 protected virtual void OnCollisionStay2D(UnityEngine.Collision2D collision)
 {
 }