diff --git a/Assets/Scripts/GMScript.cs b/Assets/Scripts/GMScript.cs index a02fa8f..7c54d97 100644 --- a/Assets/Scripts/GMScript.cs +++ b/Assets/Scripts/GMScript.cs @@ -36,6 +36,7 @@ public class GMScript : MonoBehaviour public Sprite[] Symbols; + private bool cursorLock = false; private bool noRepeat = true; private bool shield = false; private bool enemyShield = false; @@ -147,11 +148,15 @@ public class GMScript : MonoBehaviour if(hit.collider.gameObject.tag == "Attack" && PartyMemberOrder[0] != null) { + cursorLock = true; + StartCoroutine(AttackParty(robotColour)); } else if (hit.collider.gameObject.tag == "Attack" && PartyMemberOrder[0] == null) { + cursorLock = true; + StartCoroutine(AttackStop()); } @@ -190,6 +195,19 @@ public class GMScript : MonoBehaviour } + if(cursorLock) + { + + Cursor.lockState = CursorLockMode.Locked; + Cursor.visible = false; + + } else { + + Cursor.lockState = CursorLockMode.None; + Cursor.visible = true; + + } + } void CheckParty(GameObject member) @@ -291,6 +309,7 @@ public class GMScript : MonoBehaviour yield return new WaitForSeconds(1); AttackStopSign.SetActive(false); + cursorLock = false; } @@ -843,6 +862,8 @@ public class GMScript : MonoBehaviour { yield return StartCoroutine(HitEffectEnemy(0, EnemyPartsColours[0])); } + + cursorLock = false; } void EnemyBuilder()