public void Paused() { if (Canvas.gameObject.activeInHierarchy == false) { Canvas.gameObject.SetActive(true); Time.timeScale = 0; Debug.Log("Cursors"); Cursor.visible = true; transform.GetComponent <PlayerController>().enabled = false; m4.GetComponent <Weapons>().enabled = false; Ak.GetComponent <Weapons>().enabled = false; MouseCam.GetComponent <MouseCam>().enabled = false; } else { Canvas.gameObject.SetActive(false); Time.timeScale = 1f; Cursor.visible = false; transform.GetComponent <PlayerController>().enabled = true; m4.GetComponent <Weapons>().enabled = true; Ak.GetComponent <Weapons>().enabled = true; MouseCam.GetComponent <MouseCam>().enabled = true; aimWeapon.GetComponent <AimWeapon>().enabled = true; } }
void OnEnable() { game = GameObject.FindWithTag("GameController").GetComponent <Game>(); player = GameObject.FindWithTag("Player").GetComponent <Player>(); mouseCam = GameObject.FindWithTag("Player").GetComponent <MouseCam>(); //inhabited = game.startObject; //inhabited.GetComponent<Activator>().OnStartLevel(); moveSelected = game.voidObject; /*if (game.vr == 1) * { * moveController = player.transform.GetChild(1).GetChild(1).gameObject; * } * else * { * moveController = player.gameObject; * mouseCam.OnInitialize(); * }*/ }
void OnEnable() { //Activate VR if available player = GameObject.FindWithTag("Player"); game = GameObject.FindWithTag("GameController").GetComponent <Game>(); movementControl = GameObject.FindWithTag("MoveControl").GetComponent <MovementControl>(); useControl = GameObject.FindWithTag("UseControl").GetComponent <UseControl>(); mouseCam = GameObject.FindWithTag("Player").GetComponent <MouseCam>(); if (game.vr == 1) { VRMovement = true; reticle.SetActive(false); } else { VRMovement = false; } inhabited = game.startObject; Debug.Log("Started at " + inhabited); inhabited.GetComponent <Activator>().OnStartLevel(); Debug.Log("VRMovement " + VRMovement); }
void Awake() { inst = this; // Setup singleton }