unity-atoms/Packages/Core/Runtime/Variables/GameObjectVariable.cs
2020-02-23 02:22:39 +01:00

19 lines
772 B
C#

using System;
using UnityEngine;
namespace UnityAtoms
{
/// <summary>
/// Variable of type `GameObject`. Inherits from `AtomVariable&lt;GameObject, GameObjectEvent, GameObjectGameObjectEvent, GameObjectGameObjectFunction&gt;`.
/// </summary>
[EditorIcon("atom-icon-lush")]
[CreateAssetMenu(menuName = "Unity Atoms/Variables/GameObject", fileName = "GameObjectVariable")]
public sealed class GameObjectVariable : AtomVariable<GameObject, GameObjectEvent, GameObjectGameObjectEvent, GameObjectGameObjectFunction>
{
protected override bool ValueEquals(GameObject other)
{
return (_value == null && other == null) || _value != null && other != null && _value.GetInstanceID() == other.GetInstanceID();
}
}
}