您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
23 行
553 B
23 行
553 B
using System;
|
|
|
|
namespace Unity.UIWidgets.ui {
|
|
public class ArrayRef<T> {
|
|
public T[] array;
|
|
|
|
public int length;
|
|
|
|
public ArrayRef() {
|
|
this.array = Array.Empty<T>();
|
|
this.length = 0;
|
|
}
|
|
|
|
public void add(T item) {
|
|
if (this.length == this.array.Length) {
|
|
int newCapacity = this.array.Length == 0 ? 4 : this.array.Length * 2;
|
|
Array.Resize(ref this.array, newCapacity);
|
|
}
|
|
|
|
this.array[this.length++] = item;
|
|
}
|
|
}
|
|
}
|