Skip to content

Commit

Permalink
MonoBehaviourProxy methods made virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
skibitsky committed Jun 16, 2020
1 parent 002ca11 commit 5d9c999
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Runtime/EventBus.Unity/MonoBehaviourProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ namespace Futuclass.EventBus.Unity
{
public class MonoBehaviourProxy : MonoBehaviour, IProxy
{
public ISubscription Subscription { get; private set; }
public ISubscription Subscription { get; protected set; }

private void Awake()
protected virtual void Awake()
{
Subscription = GlobalEventBus.Instance.RegisterSubscription(this);
}

private void OnEnable()
protected virtual void OnEnable()
{
if (Subscription != null)
Subscription.Active = true;
}

private void OnDisable()
protected virtual void OnDisable()
{
if (Subscription != null)
Subscription.Active = false;
}

private void OnDestroy()
protected virtual void OnDestroy()
{
Subscription.Dispose();
}
Expand Down

0 comments on commit 5d9c999

Please sign in to comment.