A micro collection of unity3d utils for me and by me.
-
It contains heap
Note:
MinHeap<int[]> minHeap = new MinHeap<int[]>(Comparer<int[]>.Create((a, b) => { return a[0] - b[0];}));
it can work in .NET 4.8 but can't work in some Unity Editor
-
It can check daily function, such as daily login, daily bonus, daily puzzle
eg:
int CheckDaily(DateTime now, DateTime last)
bool IsNewDay(DateTime now, DateTime last)
-
It's about bit operation
eg:
int SetBit(this int A, int k, bool val)
bool GetBit(this int A, int k)
string ToBinaryString(this int A, char sep = ',')
-
It's extension based on LINQ
eg:
string ToOneLineString()
T RandomOne<T>()
T RandomSome<T>()
-
It can add buttons in Inspector panel in Unity3D with attribute.
eg:
public class Test : MonoBehaviour { [Button] public void PrintName() { Debug.Log(name); } }
-
It can rename the field which showed in Inspector panel.
eg:
public enum EColor { [Rename("红色")] A, [Rename("黄色")] B, [Rename("蓝色")] C } public class Test : MonoBehaviour { [Rename("年龄")] public int Age; [Rename("颜色")] [SerializeField] private EColor color; }