public override bool Equals(object obj) { if (obj == null) { return(!this.isValid); } if (obj is EventDelegate.Callback) { EventDelegate.Callback callback = obj as EventDelegate.Callback; if (callback.Equals(this.mCachedCallback)) { return(true); } MonoBehaviour monoBehaviour = callback.get_Target() as MonoBehaviour; return(this.mTarget == monoBehaviour && string.Equals(this.mMethodName, EventDelegate.GetMethodName(callback))); } else { if (obj is EventDelegate) { EventDelegate eventDelegate = obj as EventDelegate; return(this.mTarget == eventDelegate.mTarget && string.Equals(this.mMethodName, eventDelegate.mMethodName)); } return(false); } }
private void Set(EventDelegate.Callback call) { this.Clear(); if (call != null && EventDelegate.IsValid(call)) { this.mTarget = (call.get_Target() as MonoBehaviour); if (this.mTarget == null) { this.mRawDelegate = true; this.mCachedCallback = call; this.mMethodName = null; return; } this.mMethodName = EventDelegate.GetMethodName(call); this.mRawDelegate = false; } }