1
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user