/// <summary>
        /// 分配一个对象
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static VarString Alloc(string value)
        {
            //要从对象池获取
            VarString var = Alloc();

            var.Value = value;
            return(var);
        }
        public static VarString Alloc()
        {
            //要从对象池获取
            VarString var = GameEntry.Pool.DequeueVarObject <VarString>();

            var.Value = default(string);
            var.Retain();
            return(var);
        }
Example #3
0
        /// <summary>
        /// 加载数据表数据
        /// </summary>
        public void LoadData()
        {
            //1.获取数据表的buffer
            byte[] buffer = GameEntry.Resource.GetFileBuffer(string.Format("{0}/download/DataTable/{1}.bytes", GameEntry.Resource.LocalFilePath, DataTableName));

            //2.加载数据表数据
            using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
            {
                LoadList(ms);
            }

            //加载完成单个表,发布事件
            VarString dataName = VarString.Alloc(DataTableName);

            GameEntry.Event.CommonEvent.Dispatch(SysEventId.LoadOneDataTableComplete, dataName);
            dataName.Release();
        }