Exemple #1
0
        public int GetBlockWeight(Vector3 pos)
        {
            int blockId = m_blocks[(int)pos.x / m_blockSize][(int)pos.z / m_blockSize];

            UnityGameFramework.Runtime.Entity ent = GameEntry.Entity.GetEntity(blockId);
            Structure st = ent.Logic as Structure;

            return(st.Weight);
        }
        public void OnUnOccupy(object asset, string assetName, object userData, bool destroy)
        {
            UnityGameFramework.Runtime.Entity ent = userData as UnityGameFramework.Runtime.Entity;
            GameObject gb = ent.Handle as GameObject;

            if (gb)
            {
                gb.GetComponent <MeshRenderer>().material.mainTexture = (ent.Logic as Structure).OriginalTex;
            }
        }
        public void OnOccupy(object asset, string assetName, object userData, bool initialized)
        {
            UnityGameFramework.Runtime.Entity ent = userData as UnityGameFramework.Runtime.Entity;
            GameObject gb = ent.Handle as GameObject;

            if (gb)
            {
                gb.GetComponent <MeshRenderer>().material.mainTexture = asset as Texture;
            }
        }
        public void OccupyBehaviour(object asset, string assetName, object userdata, StructureBehaviourCallback callbacks)
        {
            UnityGameFramework.Runtime.Entity ent = userdata as UnityGameFramework.Runtime.Entity;
            Structure structLogic = ent.Logic as Structure;

            if (structLogic.Occupyed)
            {
                callbacks.occupyCallback(asset, assetName, userdata, false);
            }
            else
            {
                callbacks.unOccupyCallback(asset, assetName, userdata, false);
            }
        }
        static StackObject *get_Id_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, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityGameFramework.Runtime.Entity instance_of_this_method = (UnityGameFramework.Runtime.Entity) typeof(UnityGameFramework.Runtime.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Id;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
        public void RegisterStructure(UnityGameFramework.Runtime.Entity ent)
        {
            if ((ent.Logic as Structure).m_TypeId == 90002)
            {
                m_EnemyIds.Add(ent.Id);
            }

            string str = "structure";

            str += (m_StructureIds.Count + 1);
            (ent.Handle as GameObject).name = str;
            m_StructureIds.Add(ent.Id);

            Structure st = ent.Logic as Structure;

            st.Weight = UnityEngine.Random.Range(1, 5);
        }
        static StackObject *HideEntity_2(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, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @userData = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityGameFramework.Runtime.Entity @entity = (UnityGameFramework.Runtime.Entity) typeof(UnityGameFramework.Runtime.Entity).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityGameFramework.Runtime.EntityComponent instance_of_this_method = (UnityGameFramework.Runtime.EntityComponent) typeof(UnityGameFramework.Runtime.EntityComponent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.HideEntity(@entity, @userData);

            return(__ret);
        }
Exemple #8
0
        static int _m_PlaySound(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityGameFramework.Runtime.SoundComponent gen_to_be_invoked = (UnityGameFramework.Runtime.SoundComponent)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 4))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 4, typeof(GameFramework.Sound.PlaySoundParams));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _playSoundParams);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityGameFramework.Runtime.Entity>(L, 4))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    UnityGameFramework.Runtime.Entity _bindingEntity = (UnityGameFramework.Runtime.Entity)translator.GetObject(L, 4, typeof(UnityGameFramework.Runtime.Entity));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _bindingEntity);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Vector3>(L, 4))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    UnityEngine.Vector3 _worldPosition; translator.Get(L, 4, out _worldPosition);

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _worldPosition);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <object>(L, 4))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    object _userData       = translator.GetObject(L, 4, typeof(object));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _userData);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 5 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 6 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5) && translator.Assignable <object>(L, 6))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));
                    object _userData = translator.GetObject(L, 6, typeof(object));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams, _userData);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 6 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5) && translator.Assignable <UnityGameFramework.Runtime.Entity>(L, 6))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));
                    UnityGameFramework.Runtime.Entity   _bindingEntity   = (UnityGameFramework.Runtime.Entity)translator.GetObject(L, 6, typeof(UnityGameFramework.Runtime.Entity));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams, _bindingEntity);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 6 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5) && translator.Assignable <UnityEngine.Vector3>(L, 6))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));
                    UnityEngine.Vector3 _worldPosition; translator.Get(L, 6, out _worldPosition);

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams, _worldPosition);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 7 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5) && translator.Assignable <UnityGameFramework.Runtime.Entity>(L, 6) && translator.Assignable <object>(L, 7))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));
                    UnityGameFramework.Runtime.Entity   _bindingEntity   = (UnityGameFramework.Runtime.Entity)translator.GetObject(L, 6, typeof(UnityGameFramework.Runtime.Entity));
                    object _userData = translator.GetObject(L, 7, typeof(object));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams, _bindingEntity, _userData);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 7 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <GameFramework.Sound.PlaySoundParams>(L, 5) && translator.Assignable <UnityEngine.Vector3>(L, 6) && translator.Assignable <object>(L, 7))
                {
                    string _soundAssetName = LuaAPI.lua_tostring(L, 2);
                    string _soundGroupName = LuaAPI.lua_tostring(L, 3);
                    int    _priority       = LuaAPI.xlua_tointeger(L, 4);
                    GameFramework.Sound.PlaySoundParams _playSoundParams = (GameFramework.Sound.PlaySoundParams)translator.GetObject(L, 5, typeof(GameFramework.Sound.PlaySoundParams));
                    UnityEngine.Vector3 _worldPosition; translator.Get(L, 6, out _worldPosition);
                    object _userData = translator.GetObject(L, 7, typeof(object));

                    int gen_ret = gen_to_be_invoked.PlaySound(_soundAssetName, _soundGroupName, _priority, _playSoundParams, _worldPosition, _userData);
                    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 UnityGameFramework.Runtime.SoundComponent.PlaySound!"));
        }