private void GetSelectedInput() { //Debug.Log(PlayerSettingsScript.PlayerSettings.SelChoice); PlayerSettingsScript.InputChoices cur = PlayerSettingsScript.PlayerSettings.SelChoice; if (cur == PlayerSettingsScript.InputChoices.dpad) { SelInputTX.text = "Directional Pad"; } else if (cur == PlayerSettingsScript.InputChoices.swipe) { SelInputTX.text = "Swipe"; } else if (cur == PlayerSettingsScript.InputChoices.accel) { SelInputTX.text = "Joystick/Accelerometer"; } else if (cur == PlayerSettingsScript.InputChoices.keyboard) { SelInputTX.text = "Keyboard(WASD)"; } //If we get here, something is wrong else { Debug.Log("cannot get input from persistence"); } }
// Use this for initialization void Start() { gs = GameObject.Find("GameSave").GetComponent <GameSaveScr>(); gs.SaveGame(); PauseMenu = GameObject.Find("/PauseMenu").GetComponent <Canvas>(); PauseButton = PauseButton.GetComponent <Button>(); PauseMenu.enabled = false; Player = GameObject.Find("Player").GetComponent <PlayerScript>(); //c = GameObject.Find("/Controls").GetComponent<Canvas>(); cur = PlayerSettingsScript.PlayerSettings.SelChoice; Debug.Log("Level Init: control - " + cur); if (cur == PlayerSettingsScript.InputChoices.keyboard) { DPad_Cont.SetActive(true); Swipe_Cont.SetActive(false); Accel_Cont.SetActive(false); Up_B = Up_B.GetComponent <Button>(); Down_B = Down_B.GetComponent <Button>(); Left_B = Left_B.GetComponent <Button>(); Right_B = Right_B.GetComponent <Button>(); } if (cur == PlayerSettingsScript.InputChoices.dpad) { DPad_Cont.SetActive(true); Swipe_Cont.SetActive(false); Accel_Cont.SetActive(false); Up_B = Up_B.GetComponent <Button>(); Down_B = Down_B.GetComponent <Button>(); Left_B = Left_B.GetComponent <Button>(); Right_B = Right_B.GetComponent <Button>(); } else if (cur == PlayerSettingsScript.InputChoices.swipe) { DPad_Cont.SetActive(false); Swipe_Cont.SetActive(true); Accel_Cont.SetActive(false); //set up swipe arrow on canvas } else if (cur == PlayerSettingsScript.InputChoices.accel) { DPad_Cont.SetActive(false); Swipe_Cont.SetActive(false); Accel_Cont.SetActive(true); //set up joystick position display on canvas js_top = js_top.GetComponent <Image>(); } //Image stuff L1 = GameObject.Find("Life1").GetComponent <Image>(); L2 = GameObject.Find("Life2").GetComponent <Image>(); L3 = GameObject.Find("Life3").GetComponent <Image>(); L4 = GameObject.Find("Life4").GetComponent <Image>(); L5 = GameObject.Find("Life5").GetComponent <Image>(); }