From 9391e69cfa03f8f6edc05e4d0797ecebb23c6090 Mon Sep 17 00:00:00 2001 From: Neil Sarkar Date: Thu, 30 Jul 2020 15:14:52 -0700 Subject: [PATCH] Fix stack overflow on grabbing Dispatcher from ChildView --- Runtime/Navigation/VioletButton.cs | 2 +- Runtime/StateMonoBehaviour.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/Navigation/VioletButton.cs b/Runtime/Navigation/VioletButton.cs index ef2af72..43862a2 100644 --- a/Runtime/Navigation/VioletButton.cs +++ b/Runtime/Navigation/VioletButton.cs @@ -9,7 +9,7 @@ namespace VioletUI { public class VioletButton : UnityEngine.UI.Button { public ScreenId visitScreen; - Navigator navigator; + protected Navigator navigator; protected override void Awake() { base.Awake(); navigator = gameObject.GetComponentInParent(); diff --git a/Runtime/StateMonoBehaviour.cs b/Runtime/StateMonoBehaviour.cs index 4fa6837..17624c9 100644 --- a/Runtime/StateMonoBehaviour.cs +++ b/Runtime/StateMonoBehaviour.cs @@ -36,13 +36,13 @@ public class View : View { public abstract class RepeatView : RepeatView { protected override TState State => Singleton?.State; protected override TState LastState => Singleton?.LastState; - protected override Dispatcher Dispatcher => Dispatcher; + protected override Dispatcher Dispatcher => Singleton?.Dispatcher; } public abstract class ChildView : ChildView { protected override TState State => Singleton?.State; protected override TState LastState => Singleton?.LastState; - protected override Dispatcher Dispatcher => Dispatcher; + protected override Dispatcher Dispatcher => Singleton?.Dispatcher; } void Awake() {