Skip to content

Commit

Permalink
Added direct System.Type check for ComponentType
Browse files Browse the repository at this point in the history
  • Loading branch information
WooshiiDev committed Jul 22, 2023
1 parent 1e663ee commit 359fd50
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HierarchyDecorator/Scripts/Editor/Data/Types/ComponentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,20 @@ public override string ToString()

public override bool Equals(object obj)
{
ComponentType other = obj as ComponentType;
if (obj is ComponentType component)
{
return Type == component.Type;
}

if (other == null)
if (obj is Type type)
{
return false;
return Type == type;
}

return name.Equals(other.name);
return false;
}


public override int GetHashCode()
{
int hashCode = 1280150957;
Expand Down

0 comments on commit 359fd50

Please sign in to comment.