Ejemplo n.º 1
0
    /// <summary>
    /// 传送点
    /// </summary>
    /// <returns></returns>
    public static List <MiniMapPointInfo> GetInstanceAllTrasnspot(uint instance_id)
    {
        List <MiniMapPointInfo> map_point_infos = new List <MiniMapPointInfo>();
        var nep_data = xc.Dungeon.LevelManager.Instance.LoadLevelFileTemporary(SceneHelp.GetFirstStageId(instance_id));

        if (nep_data == null)
        {
            GameDebug.LogError("get nep_data failed,instance id: " + instance_id);
            return(map_point_infos);
        }

        var monstersData = nep_data.GetData <Neptune.Collider>().Data;

        foreach (var item in monstersData)
        {
            if (item.Value is Neptune.Collider)
            {
                Neptune.Collider tag = item.Value as Neptune.Collider;
                if (tag.Comment != null && tag.Comment.CompareTo("transfer") == 0)
                {
                    MiniMapPointInfo info = new MiniMapPointInfo();
                    info.Id        = tag.Id;
                    info.MapId     = instance_id;
                    info.Position  = tag.Position;
                    info.PointType = MiniMapPointType.Transfer;
                    map_point_infos.Add(info);
                }
            }
        }
        return(map_point_infos);
    }
Ejemplo n.º 2
0
        public ColliderObject CreateColliderObject(int id)
        {
            Neptune.Collider collider = Neptune.DataManager.Instance.Data.GetNode <Neptune.Collider>(id);
            if (collider == null)
            {
                GameDebug.LogError("Create collider object error, id " + id + " can not find!!!");
                return(null);
            }

            return(CreateColliderObject(collider));
        }
Ejemplo n.º 3
0
        static int _m_CreateColliderObject(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            xc.Dungeon.ColliderObjectManager __cl_gen_to_be_invoked = (xc.Dungeon.ColliderObjectManager)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int id = LuaAPI.xlua_tointeger(L, 2);

                    xc.Dungeon.ColliderObject __cl_gen_ret = __cl_gen_to_be_invoked.CreateColliderObject(id);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && translator.Assignable <Neptune.Collider>(L, 2))
                {
                    Neptune.Collider data = (Neptune.Collider)translator.GetObject(L, 2, typeof(Neptune.Collider));

                    xc.Dungeon.ColliderObject __cl_gen_ret = __cl_gen_to_be_invoked.CreateColliderObject(data);
                    translator.Push(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 xc.Dungeon.ColliderObjectManager.CreateColliderObject!"));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 创建区域
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public ColliderObject CreateColliderObject(Neptune.Collider data)
        {
            if (ColliderObjects.ContainsKey(data.Id) == true)
            {
                GameDebug.LogError("Create collider object error, id " + data.Id + " has already exist!!!");
                return(null);
            }

            // 已经触发过的的LifeTime是ONCE的触发器不再创建
            if (data.LifeTime == Neptune.Collider.ETypeLifeTime.ONCE && mTriggeredColliderObjectIds.Contains(data.Id) == true)
            {
                return(null);
            }

            // 前置任务未完成不创建
            if (data.PreMainTaskId > 0 && TaskHelper.MainTaskIsPassed(data.PreMainTaskId) == false)
            {
                return(null);
            }

            ColliderObject o = new ColliderObject(data);

            if (o != null)
            {
                //o.SetLocalPlayerRadius(Game.Instance.LocalPlayerRadius);
                if (ColliderObjects.ContainsKey(o.Id) == false)
                {
                    ColliderObjects.Add(o.Id, o);
                }
                else
                {
                    GameDebug.LogError("Add collider object error, id " + o.Id + " has already exist!!!");
                }
            }
            return(o);
        }