Files
com.misaki.graph-view/Runtime/Models/Properties/ExposedProperty.cs
Misaki 7eec130b39 Added defualt graph properties inspector;
Added sticky note;

Changed the name of BaseNode to SlotContainerNode in case we need other type of nodes in the future;
2024-11-04 01:02:30 +09:00

44 lines
1.2 KiB
C#

using System;
namespace Misaki.GraphView
{
[Serializable]
public class ExposedProperty : IEquatable<ExposedProperty>
{
public string id = Guid.NewGuid().ToString();
public string propertyName;
public string propertyType;
public bool showInInspector = true;
public virtual object Value { get; set; }
public virtual Type GetValueType() => Value == null ? typeof(object) : Value.GetType();
public bool Equals(ExposedProperty other)
{
if (other is null)
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return id == other.id && propertyName == other.propertyName && propertyType == other.propertyType;
}
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((ExposedProperty)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(id, propertyName, propertyType);
}
}
}