public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, ref Vector3 color)
 {
     UnityEngine.Bounds b = new UnityEngine.Bounds(bbMin.ToUnity(), UnityEngine.Vector3.zero);
     b.Encapsulate(bbMax.ToUnity());
     UnityEngine.Gizmos.color = new UnityEngine.Color(color.X, color.Y, color.Z);
     UnityEngine.Gizmos.DrawWireCube(b.center,b.size);
 }
        static StackObject *set_localBounds_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Bounds value = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.SkinnedMeshRenderer instance_of_this_method;
            instance_of_this_method = (UnityEngine.SkinnedMeshRenderer) typeof(UnityEngine.SkinnedMeshRenderer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.localBounds = value;

            return(__ret);
        }
        static StackObject *ToString_23(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.ToString();

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static StackObject *TestPlanesAABB_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Bounds bounds = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Plane[] planes = (UnityEngine.Plane[]) typeof(UnityEngine.Plane[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.GeometryUtility.TestPlanesAABB(planes, bounds);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Exemple #5
0
        static StackObject *op_Inequality_18(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Bounds rhs = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Bounds lhs = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = lhs != rhs;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Exemple #6
0
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector3 @size = new UnityEngine.Vector3();
            if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null)
            {
                ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.ParseValue(ref @size, __intp, ptr_of_this_method, __mStack, true);
            }
            else
            {
                @size = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
                __intp.Free(ptr_of_this_method);
            }

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector3 @center = new UnityEngine.Vector3();
            if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null)
            {
                ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.ParseValue(ref @center, __intp, ptr_of_this_method, __mStack, true);
            }
            else
            {
                @center = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
                __intp.Free(ptr_of_this_method);
            }


            var result_of_this_method = new UnityEngine.Bounds(@center, @size);

            if (!isNewObj)
            {
                __ret--;
                WriteBackInstance(__domain, __ret, __mStack, ref result_of_this_method);
                return(__ret);
            }

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        public void UpdateUnityEngineBounds(RealStatePtr L, int index, UnityEngine.Bounds val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID)
                {
                    throw new Exception("invalid userdata for UnityEngine.Bounds");
                }

                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0, val))
                {
                    throw new Exception("pack fail for UnityEngine.Bounds ,value=" + val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <UnityEngine.Vector3>(L, 2) && translator.Assignable <UnityEngine.Vector3>(L, 3))
                {
                    UnityEngine.Vector3 center; translator.Get(L, 2, out center);
                    UnityEngine.Vector3 size; translator.Get(L, 3, out size);

                    UnityEngine.Bounds __cl_gen_ret = new UnityEngine.Bounds(center, size);
                    translator.PushUnityEngineBounds(L, __cl_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.Bounds constructor!"));
        }
Exemple #9
0
        public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Bounds val)
        {
            val = new UnityEngine.Bounds();
            int top = LuaAPI.lua_gettop(L);

            if (XUtils.LoadField(L, idx, "center"))
            {
                var center = val.center;
                translator.Get(L, top + 1, out center);
                val.center = center;
            }
            LuaAPI.lua_pop(L, 1);

            if (XUtils.LoadField(L, idx, "extents"))
            {
                var extents = val.extents;
                translator.Get(L, top + 1, out extents);
                val.extents = extents;
            }
            LuaAPI.lua_pop(L, 1);
        }
        static StackObject *Expand_18(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @amount = *(float *)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.Expand(@amount);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }
            public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                bool chunkHasChanges = chunk.DidChange(LocalToWorldTypeInfo, L2WChangeVersion);

                if (!chunkHasChanges)
                {
                    return; // early out if the chunk transforms haven't changed
                }
                NativeArray <LocalToWorld> transforms = chunk.GetNativeArray <LocalToWorld>(LocalToWorldTypeInfo);

                UnityEngine.Bounds bounds = new UnityEngine.Bounds();
                bounds.center = transforms[0].Position;
                for (int i = 1; i < transforms.Length; i++)
                {
                    bounds.Encapsulate(transforms[i].Position);
                }
                chunk.SetChunkComponentData(ChunkAABBTypeInfo, new ChunkAABB()
                {
                    Value = bounds.ToAABB()
                });
            }
        static int _m_GetBoundsLocal(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <UnityEngine.Vector3Int>(L, 2))
                {
                    UnityEngine.Vector3Int _cellPosition; translator.Get(L, 2, out _cellPosition);

                    UnityEngine.Bounds gen_ret = gen_to_be_invoked.GetBoundsLocal(_cellPosition);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <UnityEngine.Vector3>(L, 2) && translator.Assignable <UnityEngine.Vector3>(L, 3))
                {
                    UnityEngine.Vector3 _origin; translator.Get(L, 2, out _origin);
                    UnityEngine.Vector3 _size; translator.Get(L, 3, out _size);

                    UnityEngine.Bounds gen_ret = gen_to_be_invoked.GetBoundsLocal(_origin, _size);
                    translator.PushUnityEngineBounds(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.GridLayout.GetBoundsLocal!"));
        }
Exemple #13
0
        static int _m_CalculateBounds_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UnityEngine.Vector3[] positions = (UnityEngine.Vector3[])translator.GetObject(L, 1, typeof(UnityEngine.Vector3[]));
                    UnityEngine.Matrix4x4 transform; translator.Get(L, 2, out transform);

                    UnityEngine.Bounds __cl_gen_ret = UnityEngine.GeometryUtility.CalculateBounds(positions, transform);
                    translator.PushUnityEngineBounds(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static StackObject *set_max_12(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector3 @value = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.max = value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }
Exemple #15
0
        static int _m_GetBounds(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Game.ObjBase __cl_gen_to_be_invoked = (Game.ObjBase)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Bounds __cl_gen_ret = __cl_gen_to_be_invoked.GetBounds(  );
                    translator.PushUnityEngineBounds(L, __cl_gen_ret);



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


                Pathfinding.RecastMeshObj gen_to_be_invoked = (Pathfinding.RecastMeshObj)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Bounds gen_ret = gen_to_be_invoked.GetBounds(  );
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #17
0
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Bounds field)
        {
            field = default(UnityEngine.Bounds);

            var center = field.center;

            if (!UnPack(buff, offset, out center))
            {
                return(false);
            }
            field.center = center;

            var extents = field.extents;

            if (!UnPack(buff, offset + 12, out extents))
            {
                return(false);
            }
            field.extents = extents;

            return(true);
        }
Exemple #18
0
        static StackObject *Encapsulate_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Bounds @bounds = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.Encapsulate(@bounds);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }
Exemple #19
0
        static StackObject *Intersects_24(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Bounds bounds = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method;
            instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.Intersects(bounds);

            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
        static int _m_CalculateRelativeRectTransformBounds_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1 && translator.Assignable <UnityEngine.Transform>(L, 1))
                {
                    UnityEngine.Transform trans = (UnityEngine.Transform)translator.GetObject(L, 1, typeof(UnityEngine.Transform));

                    UnityEngine.Bounds __cl_gen_ret = UnityEngine.RectTransformUtility.CalculateRelativeRectTransformBounds(trans);
                    translator.PushUnityEngineBounds(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && translator.Assignable <UnityEngine.Transform>(L, 1) && translator.Assignable <UnityEngine.Transform>(L, 2))
                {
                    UnityEngine.Transform root  = (UnityEngine.Transform)translator.GetObject(L, 1, typeof(UnityEngine.Transform));
                    UnityEngine.Transform child = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform));

                    UnityEngine.Bounds __cl_gen_ret = UnityEngine.RectTransformUtility.CalculateRelativeRectTransformBounds(root, child);
                    translator.PushUnityEngineBounds(L, __cl_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.RectTransformUtility.CalculateRelativeRectTransformBounds!"));
        }
Exemple #21
0
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector3 size = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector3 center = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = new UnityEngine.Bounds(center, size);

            if (!isNewObj)
            {
                __ret--;
                WriteBackInstance(__domain, __ret, __mStack, ref result_of_this_method);
                return(__ret);
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemple #22
0
        static int _m_GetBounds_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.Vector3[] _points = (UnityEngine.Vector3[])translator.GetObject(L, 1, typeof(UnityEngine.Vector3[]));
                    UnityEngine.Matrix4x4 _matrix; translator.Get(L, 2, out _matrix);
                    float _minimumHeight = (float)LuaAPI.lua_tonumber(L, 3);

                    UnityEngine.Bounds gen_ret = Pathfinding.GraphUpdateShape.GetBounds(_points, _matrix, _minimumHeight);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #23
0
        int __CreateInstanceUnityEngineBounds(RealStatePtr L, int gen_param_count)
        {
            ObjectTranslator translator = this;

            if (gen_param_count == 3 && translator.Assignable <UnityEngine.Vector3>(L, 2) && translator.Assignable <UnityEngine.Vector3>(L, 3))
            {
                UnityEngine.Vector3 _center; translator.Get(L, 2, out _center);
                UnityEngine.Vector3 _size; translator.Get(L, 3, out _size);

                UnityEngine.Bounds gen_ret = new UnityEngine.Bounds(_center, _size);
                translator.PushUnityEngineBounds(L, gen_ret);

                return(1);
            }

            if (gen_param_count == 1)
            {
                translator.PushUnityEngineBounds(L, default(UnityEngine.Bounds));
                return(1);
            }


            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Bounds constructor!"));
        }
        static StackObject *SqrDistance_26(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector3 @point = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.SqrDistance(@point);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            __ret->ObjectType       = ObjectTypes.Float;
            *(float *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
        static int _m_InverseTransform(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    PF.GraphTransform  _self = (PF.GraphTransform)translator.GetObject(L, 1, typeof(PF.GraphTransform));
                    UnityEngine.Bounds _bounds; translator.Get(L, 2, out _bounds);

                    UnityEngine.Bounds gen_ret = Pathfinding.UnityHelper.InverseTransform(
                        _self,
                        _bounds);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 public static UnityEngine.Bounds BoundsField(UnityEngine.GUIContent label, UnityEngine.Bounds value, params UnityEngine.GUILayoutOption[] options)
 {
     return(UnityEditor.EditorGUILayout.BoundsField(label, value, options));
 }
Exemple #27
0
 public static UnityEngine.Bounds BoundsField(UnityEngine.Rect position, UnityEngine.GUIContent label, UnityEngine.Bounds value)
 {
     return(UnityEditor.EditorGUI.BoundsField(position, label, value));
 }
 public void GetNodesInBounds(System.Collections.Generic.List <Node> output, UnityEngine.Bounds bounds)
 {
     this.pathfindingEntity.GetComponent <PathfindingInstance>().pathfinding.GetNodesInBounds(output, bounds);
 }
 public static UnityEngine.Bounds BoundsField(System.String label, UnityEngine.Bounds value, params UnityEngine.GUILayoutOption[] options)
 {
     return(UnityEditor.EditorGUILayout.BoundsField(TranslationUtility.get(label), value, options));
 }
        static int _m_GetTileBoundsInGraphSpace(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 5 && translator.Assignable <PF.NavmeshBase>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5))
                {
                    PF.NavmeshBase _navmeshBase = (PF.NavmeshBase)translator.GetObject(L, 1, typeof(PF.NavmeshBase));
                    int            _x           = LuaAPI.xlua_tointeger(L, 2);
                    int            _z           = LuaAPI.xlua_tointeger(L, 3);
                    int            _width       = LuaAPI.xlua_tointeger(L, 4);
                    int            _depth       = LuaAPI.xlua_tointeger(L, 5);

                    UnityEngine.Bounds gen_ret = Pathfinding.UnityHelper.GetTileBoundsInGraphSpace(
                        _navmeshBase,
                        _x,
                        _z,
                        _width,
                        _depth);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && translator.Assignable <PF.NavmeshBase>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
                {
                    PF.NavmeshBase _navmeshBase = (PF.NavmeshBase)translator.GetObject(L, 1, typeof(PF.NavmeshBase));
                    int            _x           = LuaAPI.xlua_tointeger(L, 2);
                    int            _z           = LuaAPI.xlua_tointeger(L, 3);
                    int            _width       = LuaAPI.xlua_tointeger(L, 4);

                    UnityEngine.Bounds gen_ret = Pathfinding.UnityHelper.GetTileBoundsInGraphSpace(
                        _navmeshBase,
                        _x,
                        _z,
                        _width);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <PF.NavmeshBase>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    PF.NavmeshBase _navmeshBase = (PF.NavmeshBase)translator.GetObject(L, 1, typeof(PF.NavmeshBase));
                    int            _x           = LuaAPI.xlua_tointeger(L, 2);
                    int            _z           = LuaAPI.xlua_tointeger(L, 3);

                    UnityEngine.Bounds gen_ret = Pathfinding.UnityHelper.GetTileBoundsInGraphSpace(
                        _navmeshBase,
                        _x,
                        _z);
                    translator.PushUnityEngineBounds(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <PF.NavmeshBase>(L, 1) && translator.Assignable <PF.IntRect>(L, 2))
                {
                    PF.NavmeshBase _navmeshBase = (PF.NavmeshBase)translator.GetObject(L, 1, typeof(PF.NavmeshBase));
                    PF.IntRect     _rect; translator.Get(L, 2, out _rect);

                    UnityEngine.Bounds gen_ret = Pathfinding.UnityHelper.GetTileBoundsInGraphSpace(
                        _navmeshBase,
                        _rect);
                    translator.PushUnityEngineBounds(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 Pathfinding.UnityHelper.GetTileBoundsInGraphSpace!"));
        }
Exemple #31
0
        static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.Bounds instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Bounds[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }
 /// <summary>
 /// ת��-> UnityEngine.Bounds
 /// </summary>
 /// <returns></returns>
 public UnityEngine.Bounds ToUnityAABB()
 {
     UnityEngine.Bounds bd = new UnityEngine.Bounds(
         new UnityEngine.Vector3(this.Center.x,this.Center.y,this.Center.z),
         new UnityEngine.Vector3(this.Size.x,this.Size.y,this.Size.z)
         );
     return bd;
 }