generated from vrchat-community/template-package
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(error): Implement core of error reporting framework
- Loading branch information
1 parent
c7f43a1
commit 6cc58fb
Showing
37 changed files
with
1,084 additions
and
210 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#region | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Object = UnityEngine.Object; | ||
|
||
#endregion | ||
|
||
namespace nadena.dev.ndmf | ||
{ | ||
/// <summary> | ||
/// The ObjectReference class gives you a way to reference an object that may have been moved or destroyed since | ||
/// its initial creation. | ||
/// </summary> | ||
public sealed class ObjectReference | ||
{ | ||
private readonly Object _obj; | ||
private readonly string _path; | ||
private readonly Type _type; | ||
|
||
internal ObjectReference(Object obj, string path) | ||
{ | ||
_obj = obj; | ||
_path = path; | ||
_type = obj.GetType(); | ||
} | ||
|
||
public Object Object => _obj; | ||
public string Path => _path; | ||
public Type Type => _type; | ||
|
||
private bool Equals(ObjectReference other) | ||
{ | ||
return ReferenceEquals(_obj, other._obj); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return ReferenceEquals(this, obj) || obj is ObjectReference other && Equals(other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return RuntimeHelpers.GetHashCode(_obj); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.