This commit is contained in:
CortexCore
2023-11-15 23:54:54 +08:00
parent ee3ecec6cb
commit 3c837a4a33
356 changed files with 73756 additions and 26493 deletions

View File

@@ -1,7 +1,39 @@
using System;
#if UNITY_64
using UnityEngine;
#endif
namespace BITKit
{
public class ConstantHash
{
public ConstantHash(object value)
{
#if UNITY_64
HashCode = Animator.StringToHash(value.ToString());
#else
HashCode = value.GetHashCode();
#endif
AsString = value.ToString();
}
public readonly int HashCode;
public readonly string AsString;
public static implicit operator string (ConstantHash self)
{
return self.AsString;
}
public static implicit operator int (ConstantHash self)
{
return self.HashCode;
}
public static implicit operator ConstantHash(string value)
{
return new ConstantHash(value);
}
public static implicit operator ConstantHash(int value)
{
return new ConstantHash(value);
}
}
public static partial class Constant
{
public partial struct Header