Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        mSSel           = (Sprite)Resources.Load <Sprite> ("ui/colour_btn_select");
        mSDsel          = (Sprite)Resources.Load <Sprite> ("ui/colour_btn");
        mSStarSel       = (Sprite)Resources.Load <Sprite> ("ui/star00");
        mSStarDel       = (Sprite)Resources.Load <Sprite> ("ui/star01");
        MusicClick      = gameObject.AddComponent <AudioSource> ();
        MusicClick.clip = (AudioClip)Resources.Load("sound/click");

        MusicBG      = gameObject.AddComponent <AudioSource> ();
        MusicBG.clip = (AudioClip)Resources.Load("sound/game_ui");
        MusicBG.loop = true;
        if (M.setSound)
        {
            MusicBG.Play();
        }

        M.Open();

        setLevel();
        setScreen(M.GameScreen);
        for (int i = 0; i < mFireBrigade.childCount; i++)
        {
            mFireBrigade.GetChild(i).gameObject.SetActive(i == M.PLAYER_NO);
        }
        transform.Find("Menu/Sound/off").gameObject.SetActive(!M.setSound);
        RequestInterstitial();

        if (www == null)
        {
                        #if UNITY_IPHONE
            www = new WWW("http://hututusoftwares.com/Link/iphone.html");
                        #elif UNITY_ANDROID
            www = new WWW("http://hututusoftwares.com/Link/android.html");
                        #endif
        }
    }
Esempio n. 2
0
    public void OnClickMenu(int val)
    {
        switch (val)
        {
        case 0:        //Rate
                        #if UNITY_IPHONE
            Application.OpenURL("https://itunes.apple.com/us/developer/yogesh-bangar/id1199008030");
                        #else
            Application.OpenURL("https://play.google.com/store/apps/details?id=" + Application.identifier);
                        #endif
            break;

        case 1:        //info
            Application.OpenURL("http://www.hututusoftwares.com/");
            break;

        case 2:        //facebook
            Application.OpenURL("https://www.facebook.com/hututusoftwares/");
            break;

        case 3:        //twiter
            Application.OpenURL("https://twitter.com/hututu_games");
            break;

        case 4:        //G+
            Application.OpenURL("https://plus.google.com/u/0/+Hututugames");
            break;

        case 5:
            Animator anim = transform.Find("Menu/popbut").GetComponent <Animator> ();
            anim.SetBool("isOpen", !anim.GetBool("isOpen"));
            break;

        case 6:        //More Games
#if ANDROID
            Application.OpenURL("https://play.google.com/store/apps/details?id=com.onedaygames24.game.trainsimulatordriver_2017");
#else
            Application.OpenURL("https://itunes.apple.com/us/developer/yogesh-bangar/id1199008030");
                        #endif
            break;

        case 7:        //Play
            setScreen(M.GAMESHOP);
            ShowInterstitial();
            break;

        case 8:        //LeaderBoard
            break;

        case 9:        //Setting
            transform.Find("Menu/SettingPopUp").GetComponent <Animator> ().SetBool("isOpen", true);
            break;

        case 10:        //Achivement
            break;

        case 11:        //Music
            break;

        case 12:        //Sound
            M.setSound = !M.setSound;
            transform.Find("Menu/Sound/off").gameObject.SetActive(!M.setSound);

            if (M.setSound)
            {
                MusicBG.Play();
            }
            else
            {
                MusicBG.Pause();
            }
            break;

        case 13:        //Steering
            break;

        case 14:        //Close
            transform.Find("Menu/SettingPopUp").GetComponent <Animator> ().SetBool("isOpen", false);
            break;

        case 15:        //Exit
            Debug.Log("Exit");
            setScreen(M.GAMEEXIT);
            break;
        }

        if (M.setSound)
        {
            MusicClick.Play();
        }
    }