From 5aa0dbb33decab3bc6e5eb5f9879ee4774dec386 Mon Sep 17 00:00:00 2001 From: alexiscatnip Date: Sun, 23 Jan 2022 00:17:51 +0800 Subject: [PATCH] Add support for Button in ButtonTriggerViewTransition.cs --- Assets/ButtonTriggerViewTransition.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Assets/ButtonTriggerViewTransition.cs b/Assets/ButtonTriggerViewTransition.cs index 3d5344d..f5baa7e 100644 --- a/Assets/ButtonTriggerViewTransition.cs +++ b/Assets/ButtonTriggerViewTransition.cs @@ -6,8 +6,10 @@ using Raindrop; using Raindrop.ServiceLocator; using Raindrop.Services; using UnityEngine; +using UnityEngine.UI; using Logger = OpenMetaverse.Logger; +// This component allows you to bring up the scene that the button is supposed to lead to. public class ButtonTriggerViewTransition : MonoBehaviour { public CanvasType canvasTypeToPush; @@ -16,7 +18,14 @@ public class ButtonTriggerViewTransition : MonoBehaviour { try { - this.GetComponent().OnClick.AddListener(OnClick); + if (this.GetComponent()) + { + this.GetComponent().OnClick.AddListener(OnClick); + } + if (this.GetComponent