From 76a3fe2cb521e2edf10f742919c961309aa78265 Mon Sep 17 00:00:00 2001 From: RhenaudTheLukark Date: Thu, 18 Apr 2019 17:51:59 +0200 Subject: [PATCH] Hotfix: CYF Unity not working properly when playing the project in Linux and Mac --- Assets/Scripts/Battle/FightUI.cs | 2 +- Assets/Scripts/Battle/UIController.cs | 2 +- Assets/Scripts/Device/DisclaimerScript.cs | 4 ++-- Assets/Scripts/Device/Misc.cs | 2 +- Assets/Scripts/Lua/LuaScriptBinder.cs | 2 +- Assets/Scripts/Overworld/IntroManager.cs | 2 +- Assets/Scripts/Overworld/SpecialAnnouncementScript.cs | 2 +- Assets/Scripts/Overworld/Title.cs | 2 +- Assets/Scripts/Util/ControlPanel.cs | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/Battle/FightUI.cs b/Assets/Scripts/Battle/FightUI.cs index 922ebccbb..236999601 100644 --- a/Assets/Scripts/Battle/FightUI.cs +++ b/Assets/Scripts/Battle/FightUI.cs @@ -128,7 +128,7 @@ void Update() { Vector2 localEnePos = enemy.GetComponent().anchoredPosition; // get local position to do the shake enemy.GetComponent().anchoredPosition = new Vector2(localEnePos.x + shakeX[shakeIndex], localEnePos.y); - /*#if UNITY_STANDALONE_WIN || UNITY_EDITOR + /*#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (StaticInits.ENCOUNTER == "01 - Two monsters" && StaticInits.MODFOLDER == "Examples") Misc.MoveWindow(shakeX[shakeIndex] * 2, 0); #endif*/ diff --git a/Assets/Scripts/Battle/UIController.cs b/Assets/Scripts/Battle/UIController.cs index 3e7891fbd..f88dc5716 100644 --- a/Assets/Scripts/Battle/UIController.cs +++ b/Assets/Scripts/Battle/UIController.cs @@ -123,7 +123,7 @@ public static void EndBattle(bool fromGameOver = false) { Inventory.RemoveAddedItems(); GlobalControls.lastTitle = false; PlayerCharacter.instance.MaxHPShift = 0; - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; else Misc.WindowName = ControlPanel.instance.WindowBasisName; #endif diff --git a/Assets/Scripts/Device/DisclaimerScript.cs b/Assets/Scripts/Device/DisclaimerScript.cs index df0a53f3a..acde17d85 100644 --- a/Assets/Scripts/Device/DisclaimerScript.cs +++ b/Assets/Scripts/Device/DisclaimerScript.cs @@ -17,7 +17,7 @@ private void Start() { SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; else Misc.WindowName = ControlPanel.instance.WindowBasisName; #endif @@ -57,7 +57,7 @@ private void Start() { /// private void Update() { // try to hook on to the game window when the user interacts - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.O) || (Input.GetKeyDown(KeyCode.F4) // F4 || (Input.GetKeyDown(KeyCode.Return) diff --git a/Assets/Scripts/Device/Misc.cs b/Assets/Scripts/Device/Misc.cs index 96a5004b6..649bfce6e 100644 --- a/Assets/Scripts/Device/Misc.cs +++ b/Assets/Scripts/Device/Misc.cs @@ -58,7 +58,7 @@ public static void ResetCamera() { public static void DestroyWindow() { Application.Quit(); } - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN [DllImport("user32.dll")] private static extern int GetActiveWindow(); public static int window = GetActiveWindow(); diff --git a/Assets/Scripts/Lua/LuaScriptBinder.cs b/Assets/Scripts/Lua/LuaScriptBinder.cs index 9b2f23b26..bbae94a82 100644 --- a/Assets/Scripts/Lua/LuaScriptBinder.cs +++ b/Assets/Scripts/Lua/LuaScriptBinder.cs @@ -62,7 +62,7 @@ public static Script BoundScript(/*bool overworld = false*/) { script.Globals["isCYF"] = true; script.Globals["safe"] = ControlPanel.instance.Safe; - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN script.Globals["windows"] = true; #else script.Globals["windows"] = false; diff --git a/Assets/Scripts/Overworld/IntroManager.cs b/Assets/Scripts/Overworld/IntroManager.cs index e87fa59a8..96c6d2c2d 100644 --- a/Assets/Scripts/Overworld/IntroManager.cs +++ b/Assets/Scripts/Overworld/IntroManager.cs @@ -21,7 +21,7 @@ void Start () { SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; else Misc.WindowName = ControlPanel.instance.WindowBasisName; #endif diff --git a/Assets/Scripts/Overworld/SpecialAnnouncementScript.cs b/Assets/Scripts/Overworld/SpecialAnnouncementScript.cs index acd24b910..f5d0a5053 100644 --- a/Assets/Scripts/Overworld/SpecialAnnouncementScript.cs +++ b/Assets/Scripts/Overworld/SpecialAnnouncementScript.cs @@ -74,7 +74,7 @@ void Start () { SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; else Misc.WindowName = ControlPanel.instance.WindowBasisName; #endif diff --git a/Assets/Scripts/Overworld/Title.cs b/Assets/Scripts/Overworld/Title.cs index e20afb4fb..4f50cdd19 100644 --- a/Assets/Scripts/Overworld/Title.cs +++ b/Assets/Scripts/Overworld/Title.cs @@ -19,7 +19,7 @@ void Start () { SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; else Misc.WindowName = ControlPanel.instance.WindowBasisName; #endif diff --git a/Assets/Scripts/Util/ControlPanel.cs b/Assets/Scripts/Util/ControlPanel.cs index 73e907947..09fed44ed 100644 --- a/Assets/Scripts/Util/ControlPanel.cs +++ b/Assets/Scripts/Util/ControlPanel.cs @@ -16,7 +16,7 @@ [System.Serializable]public class ControlPanel { public string WinodwBsaisNmae = "Crate Your Frisk"; public bool FrameBasedMovement = false; public bool Safe = false; - #if UNITY_STANDALONE_WIN || UNITY_EDITOR + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN public bool windows = true; #else public bool windows = false;