unity-atoms/Packages/Core/Runtime/Variables/GameObjectVariable.cs
2019-10-15 22:30:18 +02:00

19 lines
728 B
C#

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