/// <summary> /// 设置一个数据对象,数据类型必须为DataType中任意一种 /// </summary> /// <param name="index">元素索引</param> /// <param name="offset">子元素偏移</param> /// <param name="dat">数据对象</param> public unsafe void SetData(int index, int offset, object dat) { int o = (index * m_size + offset) * 4; Int32 *a = (Int32 *)(ip + o); buffer.RemoveData(*a); *a = buffer.AddData(dat); }
public unsafe void SetData(int index, object dat) { if (index < 0) { return; } if (index >= element) { return; } int o = index * 4; Int32 *a = (Int32 *)(ip + o); buffer.RemoveData(*a); *a = buffer.AddData(dat); }
public unsafe void SetData(int index, object dat) { int o = index * 4; Int32 *a = (Int32 *)(ip + o); buffer.RemoveData(*a); *a = buffer.AddData(dat); }