// Use this for initialization void Start() { //check if touch device isTouchDevice = CanUseTouch.canUseTouchM(); //Get local rotation Vector3 rot = transform.localRotation.eulerAngles; rotY = rot.y; rotX = rot.x; }
// Use this for initialization void Start() { //Set Player Health Static Variable playerHealth = 6;//6; //Can Use Touch canUseTouch = CanUseTouch.canUseTouchM(); //Get Player Ridgit Body rb = GetComponent <Rigidbody>(); //Get Player Animator animPlayer = GetComponent <Animator>(); //Rotation Setting Vector3 rot = transform.localRotation.eulerAngles; rotY = rot.y; }
// Use this for initialization void Start() { //Can Use Touch canUseTouch = CanUseTouch.canUseTouchM(); //Get All Touch Game Control playerLeft = GameObject.Find("Canvas/playerLeft"); playerRight = GameObject.Find("Canvas/playerRight"); //playerJump = GameObject.Find("Canvas/playerJump"); playerCamera = GameObject.Find("Canvas/playerCamera"); playerRun = GameObject.Find("Canvas/playerRun"); playerShoot = GameObject.Find("Canvas/playerShoot"); //Hide if not touch device if (!canUseTouch) { playerLeft.SetActive(false); playerRight.SetActive(false); //playerJump.SetActive(false); playerCamera.SetActive(false); playerRun.SetActive(false); playerShoot.SetActive(false); } //Back Button btnBack = GameObject.Find("Canvas/btnBack"); //Get Navigation button btnNav = GameObject.Find("Canvas/btnNav"); navObj = GameObject.Find("Stage/Arrows"); canShowNavigation(); //End Menu Items endMenu = GameObject.Find("Canvas/EndMenu"); txtGameResult = GameObject.Find("Canvas/EndMenu/txtGameResult").GetComponent <Text>(); imgStars = GameObject.Find("Canvas/EndMenu/imgStars").GetComponent <Image>(); btnMenu1 = GameObject.Find("Canvas/EndMenu/btnMenu1").GetComponent <Button>(); btnMenu2 = GameObject.Find("Canvas/EndMenu/btnMenu2").GetComponent <Button>(); endMenu.SetActive(false); }
// Use this for initialization void Start() { //Can Use Touch canUseTouch = CanUseTouch.canUseTouchM(); //Get All Touch Game Control playerLeft = GameObject.Find("Canvas/playerLeft"); playerRight = GameObject.Find("Canvas/playerRight"); //playerJump = GameObject.Find("Canvas/playerJump"); playerCamera = GameObject.Find("Canvas/playerCamera"); playerRun = GameObject.Find("Canvas/playerRun"); playerShoot = GameObject.Find("Canvas/playerShoot"); txtJump = GameObject.Find("Canvas/txtJump"); txtTurn = GameObject.Find("Canvas/txtTurn"); txtFire = GameObject.Find("Canvas/txtFire"); txtRun = GameObject.Find("Canvas/txtRun"); keyLeftRightTop = GameObject.Find("Canvas/keyLeftRightTop"); keySpaceBar = GameObject.Find("Canvas/keySpaceBar"); keyCamera = GameObject.Find("Canvas/keyCamera"); //Hide if not touch device if (canUseTouch) { keyLeftRightTop.SetActive(false); keySpaceBar.SetActive(false); keyCamera.SetActive(false); } else { playerLeft.SetActive(false); playerRight.SetActive(false); //playerJump.SetActive(false); playerCamera.SetActive(false); playerRun.SetActive(false); playerShoot.SetActive(false); txtJump.SetActive(false); txtTurn.SetActive(false); txtFire.SetActive(false); txtRun.SetActive(false); } //Get Forward Button btnForward = GameObject.Find("Canvas/btnForward").GetComponent <Button>(); //Get Forward Message txtSkip = GameObject.Find("Canvas/txtSkip").GetComponent <Text>(); //Get Back Button btnBack = GameObject.Find("Canvas/btnBack").GetComponent <Button>(); //Coming from main screen controls if (PlayerPrefs.GetString("FromMainScreenControls") == "yes") { PlayerPrefs.SetString("FromMainScreenControls", "no"); btnForward.gameObject.SetActive(false); txtSkip.gameObject.SetActive(false); } else { //Hide Back Button btnBack.gameObject.SetActive(false); //Invoke Next Blink Invoke("forwardImageBlink", 1.0f); } //Set How To Already Loaded if (PlayerPrefs.GetString("HowToAlreadyLoaded") == "") { PlayerPrefs.SetString("HowToAlreadyLoaded", "yes"); } }