From 41885dd0301b47137f0b4f6a6a3e2a3354a0563e Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 24 May 2021 21:58:21 -0400 Subject: Updated Readme, Selection and Scene --- Assets/Scripts/Selector.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/Selector.cs b/Assets/Scripts/Selector.cs index e59d3ea..9d2b3c6 100644 --- a/Assets/Scripts/Selector.cs +++ b/Assets/Scripts/Selector.cs @@ -5,8 +5,10 @@ using UnityEngine; public class Selector : MonoBehaviour { public GameObject physGun; + public GameObject cineCamera; private bool oneSelected = false; + private bool twoSelected = false; // Update is called once per frame void Update() { @@ -25,5 +27,24 @@ public class Selector : MonoBehaviour Debug.Log("PhysGun deselected"); } } + if (Input.GetKeyDown(KeyCode.Alpha2)) + { + if (twoSelected == false) + { + physGun.SetActive(true); + twoSelected = true; + if (oneSelected == true) + { + oneSelected = false; + } + Debug.Log("PhysGun selected"); + } + else + { + physGun.SetActive(false); + twoSelected = false; + Debug.Log("PhysGun deselected"); + } + } } } -- cgit v1.2.3