public T this[int index] { //实现索引器的get方法 get { if (!IsValidIndex(index)) { throw new IndexOutOfRangeException(); } return(UObject.WrapObject <T>(Marshal.ReadIntPtr(FScriptArray.GetData(ref InterArray) + IntPtr.Size * index))); } //实现索引器的set方法 set { if (!IsValidIndex(index)) { throw new IndexOutOfRangeException(); } Marshal.WriteIntPtr(FScriptArray.GetData(ref InterArray) + IntPtr.Size * index, value != null? value._this.Get():IntPtr.Zero); } }
public T this[int index] { //实现索引器的get方法 get { if (!IsValidIndex(index)) { throw new IndexOutOfRangeException(); } return((T)Marshal.PtrToStructure(FScriptArray.GetData(ref InterArray) + Marshal.SizeOf(typeof(T)) * index, typeof(T))); } //实现索引器的set方法 set { if (!IsValidIndex(index)) { throw new IndexOutOfRangeException(); } Marshal.StructureToPtr(value, FScriptArray.GetData(ref InterArray) + Marshal.SizeOf(typeof(T)) * index, false); } }
public static extern void Empty(ref FScriptArray _this, int Slack, int NumBytesPerElement);
public static extern int AddZerod(ref FScriptArray _this, int Count, int NumBytesPerElement);
public static extern void Shrink(ref FScriptArray _this, int NumBytesPerElement);
public void Empty(int Slack) { FScriptArray.Empty(ref InterArray, Slack, IntPtr.Size); }
public void Remove(int Index, int Count) { FScriptArray.Remove(ref InterArray, Index, Count, IntPtr.Size); }
public int AddZerod(int Count) { return(FScriptArray.AddZerod(ref InterArray, Count, IntPtr.Size)); }
public void Shrink() { FScriptArray.Shrink(ref InterArray, IntPtr.Size); }
public static extern void Remove(ref FScriptArray _this, int Index, int Count, int NumBytesPerElement);
public void Insert(int Index, int Count) { FScriptArray.Insert(ref InterArray, Index, Count, Marshal.SizeOf(typeof(T))); }
public static extern void InsertZeroed(ref FScriptArray _this, int Index, int Count, int NumBytesPerElement);
public TObjectArray(FScriptArray ScriptArray) { InterArray = ScriptArray; }
public void Remove(int Index, int Count) { FScriptArray.Remove(ref InterArray, Index, Count, Marshal.SizeOf(typeof(T))); }
public void Empty(int Slack) { FScriptArray.Empty(ref InterArray, Slack, Marshal.SizeOf(typeof(T))); }
public void Shrink() { FScriptArray.Shrink(ref InterArray, Marshal.SizeOf(typeof(T))); }
public int AddZerod(int Count) { return(FScriptArray.AddZerod(ref InterArray, Count, Marshal.SizeOf(typeof(T)))); }
public static extern IntPtr GetData(ref FScriptArray _this);
public TStructArray(FScriptArray ScriptArray) { InterArray = ScriptArray; }
public void Insert(int Index, int Count) { FScriptArray.Insert(ref InterArray, Index, Count, IntPtr.Size); }