generated from techno-dwarf-works/unity-package-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from techno-dwarf-works/feature/refactoring
Version 0.0.3
- Loading branch information
Showing
7 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Assets/BetterAttributes/Editor/Comparers/SelectImplementationTypeComparer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Better.Commons.Runtime.Comparers; | ||
|
||
namespace Better.Attributes.EditorAddons.Comparers | ||
{ | ||
public class SelectImplementationTypeComparer : BaseComparer<SelectImplementationTypeComparer, Type>, IEqualityComparer<Type> | ||
{ | ||
public bool Equals(Type x, Type y) | ||
{ | ||
if (ReferenceEquals(x, y)) return true; | ||
if (ReferenceEquals(x, null)) return false; | ||
if (ReferenceEquals(y, null)) return false; | ||
if (x.IsAssignableFrom(y) || x == y) return true; | ||
if ((y.IsInterface || y.IsAbstract) && x == typeof(Type)) return true; | ||
return x == typeof(Type); | ||
} | ||
|
||
public int GetHashCode(Type obj) | ||
{ | ||
return 0; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/BetterAttributes/Editor/Comparers/SelectImplementationTypeComparer.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.