From e9aa381f20a17a752c3ef1a1e22e7ad5d4577355 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 1 Nov 2016 12:11:18 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Fixed=20Fungus=20ignores=20existing=20?= =?UTF-8?q?=E2=80=9CSayDialog=E2=80=9D=20and=20creates=20another=20one=20#?= =?UTF-8?q?555?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Fungus/Scripts/Components/SayDialog.cs | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Assets/Fungus/Scripts/Components/SayDialog.cs b/Assets/Fungus/Scripts/Components/SayDialog.cs index bea77588..548ff5f8 100644 --- a/Assets/Fungus/Scripts/Components/SayDialog.cs +++ b/Assets/Fungus/Scripts/Components/SayDialog.cs @@ -5,6 +5,7 @@ using UnityEngine; using UnityEngine.UI; using System; using System.Collections; +using System.Collections.Generic; namespace Fungus { @@ -54,7 +55,23 @@ namespace Fungus protected StringSubstituter stringSubstituter = new StringSubstituter(); - protected Writer GetWriter() + // Cache active Say Dialogs to avoid expensive scene search + protected static List activeSayDialogs = new List(); + + protected void Awake() + { + if (!activeSayDialogs.Contains(this)) + { + activeSayDialogs.Add(this); + } + } + + protected void OnDestroy() + { + activeSayDialogs.Remove(this); + } + + protected Writer GetWriter() { if (writer != null) { @@ -200,8 +217,14 @@ namespace Fungus { if (ActiveSayDialog == null) { - // Use first Say Dialog found in the scene (if any) - SayDialog sd = GameObject.FindObjectOfType(); + SayDialog sd = null; + + // Use first active Say Dialog in the scene (if any) + if (activeSayDialogs.Count > 0) + { + sd = activeSayDialogs[0]; + } + if (sd != null) { ActiveSayDialog = sd; From 80151e735174bfc7f5d2cf34c901fa29c2c4f2aa Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 1 Nov 2016 16:02:09 +0000 Subject: [PATCH 2/2] Updated project settings for Unity 5.4 --- ProjectSettings/ProjectSettings.asset | 11 ++++++++++- ProjectSettings/ProjectVersion.txt | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 20dab2a7..809131b3 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -123,6 +123,7 @@ PlayerSettings: iPhoneTargetOSVersion: 22 tvOSSdkVersion: 0 tvOSTargetOSVersion: 900 + tvOSRequireExtendedGameController: 0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -162,6 +163,7 @@ PlayerSettings: iOSLaunchScreeniPadCustomXibPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + appleDeveloperTeamID: AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -206,12 +208,15 @@ PlayerSettings: wiiUSystemHeapSize: 128 wiiUTVStartupScreen: {fileID: 0} wiiUGamePadStartupScreen: {fileID: 0} + wiiUDrcBufferDisabled: 0 wiiUProfilerLibPath: actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 + cameraUsageDescription: locationUsageDescription: + microphoneUsageDescription: XboxTitleId: XboxImageXexPath: XboxSpaPath: @@ -251,7 +256,8 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutResolution: 4 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -280,9 +286,12 @@ PlayerSettings: ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + ps4UseResolutionFallback: 0 + restrictedAudioUsageRights: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 3 ps4Audio3dVirtualSpeakerCount: 14 ps4attribCpuUsage: 0 ps4PatchPkgPath: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 96b25e7c..ae41cb69 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.4.1f1 +m_EditorVersion: 5.4.2f2 m_StandardAssetsVersion: 0