From 9bd1e9618d7329e00f427514af540a1d0a96d367 Mon Sep 17 00:00:00 2001 From: amm266 Date: Fri, 26 Feb 2021 22:47:08 +0330 Subject: [PATCH] chat system and camera movement bug fix --- Assets/MoveCamera.cs | 2 +- Assets/Scripts/ChatManager.cs | 5 +++++ Assets/Scripts/UIManager.cs | 2 ++ ProjectSettings/EditorBuildSettings.asset | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Assets/MoveCamera.cs b/Assets/MoveCamera.cs index cf3f6f8..158541e 100644 --- a/Assets/MoveCamera.cs +++ b/Assets/MoveCamera.cs @@ -14,11 +14,11 @@ public class MoveCamera : MonoBehaviour public float maxSize; private int width; private int height; + [SerializeField] private Camera myCamera; void Awake() { - myCamera = GetComponent(); width = Screen.width; height = Screen.height; } diff --git a/Assets/Scripts/ChatManager.cs b/Assets/Scripts/ChatManager.cs index 41d8d32..b77c783 100644 --- a/Assets/Scripts/ChatManager.cs +++ b/Assets/Scripts/ChatManager.cs @@ -21,6 +21,11 @@ private void Awake() } private void Start() + { + ClearChatBoxes(); + } + + public void ClearChatBoxes() { LeftTextsCount = LeftTexts.Length; for (int i = 0; i < LeftTextsCount; i++) diff --git a/Assets/Scripts/UIManager.cs b/Assets/Scripts/UIManager.cs index 971f527..320d8e0 100644 --- a/Assets/Scripts/UIManager.cs +++ b/Assets/Scripts/UIManager.cs @@ -45,6 +45,7 @@ private void FixedUpdate() SetTurnText(CurrentTurn.ToString()); LastApplyTime = Time.time; Debug.Log(CurrentTurn); + ChatManager.Instance.ClearChatBoxes(); GameManager.ApplyLog(CurrentTurn); } } @@ -57,6 +58,7 @@ public void ApplyTurnButtonClicked() CurrentTurn = int.Parse(turnToGo); SetTurnText(turnToGo); LastApplyTime = Time.time; + ChatManager.Instance.ClearChatBoxes(); GameManager.ApplyLog(CurrentTurn); } diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 82ab0f5..6cdca16 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,6 +6,6 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: 2cda990e2423bbf4892e6590ba056729 + path: Assets/Scenes/MapScene.unity + guid: 4a9141ef9c4e5c94dab2305fc5450bd6 m_configObjects: {}