Game Object Hash Code#
Game Object / Game Object Hash Code
Can Read
Cannot Write
Description#
Returns the Hash Code of a Game Object
Note
The Hash Code of a Game Object
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Game Object Hash Code")]
[Category("Game Object/Hash Code")]
[Description("Returns the Hash Code of a Game Object")]
[Image(typeof(IconCubeOutline), ColorTheme.Type.TextLight, typeof(BadgeHash))]
[Note("The Hash Code of a Game Object")]
[Serializable]
public class TypeNumberGameObjectHashCode : TypeNumber
{
[SerializeField] private GetGameObject m_GameObject = new GetGameObject();
public override double GetPreview(GameObject source)
{
GameObject gameObject = this.m_GameObject.GetPreview(source);
return gameObject != null ? gameObject.GetHashCode() : 0;
}
public override double Get(Args args)
{
GameObject gameObject = this.m_GameObject.Get(args);
return gameObject != null ? gameObject.GetHashCode() : 0;
}
public override string ToString()
{
return $"{this.m_GameObject} HashCode";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}