Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Main_Menu_02 : MonoBehaviour
- {
- public GameObject InstructionContainer;
- public GameObject Buttons;
- public GameObject AW;
- public GameObject Instruction;
- public GameObject Exit;
- public Texture Active;
- public Texture nonActive;
- public AudioClip SFX_select;
- // Update is called once per frame
- void Update ()
- {
- if (Input.touches.Length <=0)
- {
- this.guiTexture.texture = nonActive;
- }
- else
- {
- if(Input.touches.Length == 1)
- {
- if(this.guiTexture.HitTest(Input.GetTouch(0).position))
- {
- if(Input.GetTouch(0).phase == TouchPhase.Began)
- {
- audio.PlayOneShot(SFX_select);
- this.guiTexture.texture = Active;
- }
- if(Input.GetTouch(0).phase == TouchPhase.Ended)
- {
- if(this.gameObject == AW)
- Application.LoadLevel("LoadingAW");
- else if(this.gameObject == Instruction)
- {
- InstructionContainer.SetActive(true);
- Buttons.SetActive(false);
- }
- else if (this.gameObject == Exit)
- {
- Application.Quit();
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement