public void Init(HUDSetting setting) { this.setting = setting; setting.atlas.InitLookUp(); batch_data = new HUDBatchData(); batch_data.BeginRequestSpace(); var sprite_batch_info = batch_data.RequestSpace(500, (int)EGraphicSize.ESmall); var text_batch_info = batch_data.RequestSpace(500, (int)EGraphicSize.ELarge); batch_data.EndRequestSpace(); sprite_batch = new HUDBatch(); BufferSlice slice = new BufferSlice(); slice.Init(batch_data, ref sprite_batch_info); sprite_batch.InitNew(batch_data, slice); batches.Add(sprite_batch); text_batch = new HUDBatch(); BufferSlice slice_text = new BufferSlice(); slice_text.Init(batch_data, ref text_batch_info); text_batch.InitNew(batch_data, slice_text); batches.Add(text_batch); font_uv_padding = TMPro.ShaderUtilities.GetPadding(setting.atlas_material, false, false); font_altas_width = setting.font.atlasWidth; font_altas_height = setting.font.atlasHeight; collection_mesh_job = new HUDCollectionMeshInfoJob(); collection_mesh_job.Init(batch_data); }
public void Init(HUDBatchData data, ref BufferInfo info) { buffer = data; this.info = info; transform_job_datas = new NativeBufferSlice <BuildTransformJobData>(buffer.build_transform_job_datas, info.offset, info.length, 1); quad_job_datas = new NativeBufferSlice <BuildPerQuadData>(buffer.build_quad_datas, info.quad_offset, info.quad_count * info.length, info.quad_count); vertex_datas = new NativeBufferSlice <Vertex>(buffer.vertex_datas, info.quad_offset * 4, info.quad_count * info.length * 4, info.quad_count * 4); }
public void Init(HUDBatchData data) { batch_data = data; transform_indices = new NativeBuffer <TransformIndex>(step_capacity, Allocator.Persistent); indeices_offset = new NativeBuffer <CollectionMeshInfoOffset>(step_capacity / 10, Allocator.Persistent); out_poices = new NativeBuffer <Vector3>(step_capacity * 60, Allocator.Persistent); out_uv0 = new NativeBuffer <Vector2>(step_capacity * 60, Allocator.Persistent); out_uv1 = new NativeBuffer <Vector2>(step_capacity * 60, Allocator.Persistent); out_colors = new NativeBuffer <Color32>(step_capacity * 60, Allocator.Persistent); out_indices = new NativeBuffer <int>(step_capacity * 60, Allocator.Persistent); }
public void InitNew(HUDBatchData buffer_data, BufferSlice buffer_info) { this.buffer_info = buffer_info; dirty_indices = new NativeBuffer <int>(30, Allocator.Persistent); }