This commit is contained in:
CortexCore
2023-11-15 23:55:06 +08:00
parent 5446067f91
commit 70247f0242
82 changed files with 3271 additions and 579 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