示例#1
0
    void OnPress(bool isDown)
    {
        if (isDown == false)
        {
            AN_FirebaseAnalytics.LogEvent(gameObject.name);

            if (gameObject.name == "More")
            {
                Main.showMoreApps();
            }

            if (gameObject.name == "X" && (stars >= iPage.unlock[PlayerPrefs.GetInt("page")]))
            {
                if (PlayerPrefs.GetInt("page") < 1)
                {
                    iMap.MSG_1.SetActive(true);
                }
                else if (PlayerPrefs.GetInt("page") < 7)
                {
                    iMap.MSG_2.SetActive(true);
                }
                else
                {
                    iMap.MSG_3.SetActive(true);
                }
            }


            if (gameObject.name == "CloseBonus")
            {
                GameObject.Find("BonusInfo").SetActive(false);
            }

            if (gameObject.name == "WFW")
            {
                BonusInfo.SetActive(true);
            }


            if (gameObject.name == "GoolgePLay")
            {
#if UNITY_IOS
                Application.OpenURL("itms-apps://itunes.apple.com/app/id1496515813");
#endif


#if UNITY_ANDROID
                System.Uri uri        = new System.Uri("market://details?id=com.sayrex.wfw2");
                AN_Intent  viewIntent = new AN_Intent(AN_Intent.ACTION_VIEW, uri);
                AN_MainActivity.Instance.StartActivity(viewIntent);
#endif
            }



            if (gameObject.name == "Sharing")
            {
                SX.SendMessage("Sharing");
            }

            if (gameObject.name == "CloseMSG")
            {
                iMap.MSG_1.SetActive(false);
                iMap.MSG_2.SetActive(false);
                iMap.MSG_3.SetActive(false);
            }

            if (gameObject.name == "Map")
            {
                LoadScene(1);
            }
            if (gameObject.name == "Start")
            {
                PlayerPrefs.SetInt("page", 0);
                LoadScene(1);
            }

            if (gameObject.name == "Level" || gameObject.name == "Next")
            {
                LoadScene(2);
            }

            if (gameObject.name == "Panel_buy")
            {
                panel_buy_up();
            }

            if (gameObject.name == "Panel_buys")
            {
                panel_buy_ups();
            }

            if (gameObject.name == "Back")
            {
                LoadScene(0);
            }

            if (gameObject.name == "o_letters")
            {
                Main.Open_Letters();
            }

            if (gameObject.name == "o_words")
            {
                Main.Open_Word();
            }

            if (gameObject.name == "o_wordss")
            {
                Main.Open_Words();
            }

            if (gameObject.name == "AdsRevard")
            {
                GameObject.Find("SX").SendMessage("rewardedAdsShow");
            }

            if (gameObject.name == "Backspace" && Main.next > 0)
            {
                GameObject w = GameObject.Find("letter" + (Main.next - 1).ToString());;
                w.SendMessage("addLetters");
                //Main.check_next();
            }

            if (gameObject.name == "Page_right")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page--;
                if (page < 0)
                {
                    page = 0;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "pack1")
            {
                Main.onBuy("wfw2_p1");
            }
            if (gameObject.name == "pack2")
            {
                Main.onBuy("wfw2_p2");
            }
            if (gameObject.name == "pack3")
            {
                Main.onBuy("wfw2_p3");
            }
            if (gameObject.name == "pack4")
            {
                Main.onBuy("wfw2_p4");
            }
            if (gameObject.name == "pack5")
            {
                Main.onBuy("wfw2_p5");
            }
            if (gameObject.name == "buy_page")
            {
                Main.onBuy("page_" + PlayerPrefs.GetInt("page").ToString());
            }


            if (gameObject.name == "Page_left")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page++;
                if (page > 7)
                {
                    page = 7;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "FaceBook")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }

            if (gameObject.name == "Sayrex")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }


            if (gameObject.name == "GameCenter")
            {
                Main.onLeaderBoard();
            }

            if (gameObject.name == "ARCH")
            {
                Main.SX.GetComponent <SX_GameCenter>().showArchievements();
            }


            if (gameObject.name == "sound")
            {
                Debug.Log("Here");
                if (sound)
                {
                    PlayerPrefs.SetInt("sound", 1);
                    sound = false;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_off";
                    AudioListener.volume = 0;
                }
                else
                {
                    PlayerPrefs.SetInt("sound", 0);
                    sound = true;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_on";
                    AudioListener.volume = 1;
                }
            }
        }
    }
示例#2
0
    void OnPress(bool isDown)
    {
        if (isDown == false)
        {
            AN_FirebaseAnalytics.LogEvent(gameObject.name);

            if (gameObject.name == "More")
            {
                Main.showMoreApps();
            }

            if (gameObject.name == "X" && (stars >= iPage.unlock[PlayerPrefs.GetInt("page")]))
            {
                if (PlayerPrefs.GetInt("page") < 1)
                {
                    iMap.MSG_1.SetActive(true);
                }
                else if (PlayerPrefs.GetInt("page") < 7)
                {
                    iMap.MSG_2.SetActive(true);
                }
                else
                {
                    iMap.MSG_3.SetActive(true);
                }
            }

            if (gameObject.name == "CloseMSG")
            {
                iMap.MSG_1.SetActive(false);
                iMap.MSG_2.SetActive(false);
                iMap.MSG_3.SetActive(false);
            }

            if (gameObject.name == "Map")
            {
                LoadScene(1);
            }
            if (gameObject.name == "Start")
            {
                PlayerPrefs.SetInt("page", 0);
                LoadScene(1);
            }

            if (gameObject.name == "Level" || gameObject.name == "Next")
            {
                LoadScene(2);
            }

            if (gameObject.name == "Panel_buy")
            {
                panel_buy_up();
            }

            if (gameObject.name == "Sharing")
            {
                SX.SendMessage("Sharing");
            }

            if (gameObject.name == "Panel_buys")
            {
                panel_buy_ups();
            }

            if (gameObject.name == "Back")
            {
                LoadScene(0);
            }

            if (gameObject.name == "o_letters")
            {
                Main.Open_Letters();
            }

            if (gameObject.name == "o_words")
            {
                Main.Open_Word();
            }

            if (gameObject.name == "o_wordss")
            {
                Main.Open_Words();
            }

            if (gameObject.name == "AdsRevard")
            {
                GameObject.Find("SX").SendMessage("rewardedAdsShow");
            }

            if (gameObject.name == "Backspace" && Main.next > 0)
            {
                GameObject w = GameObject.Find("letter" + (Main.next - 1).ToString());;
                w.SendMessage("addLetters");
                //Main.check_next();
            }

            if (gameObject.name == "Page_right")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page--;
                if (page < 0)
                {
                    page = 0;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "pack1")
            {
                Main.onBuy("wfw_p1");
            }
            if (gameObject.name == "pack2")
            {
                Main.onBuy("wfw_p2");
            }
            if (gameObject.name == "pack3")
            {
                Main.onBuy("wfw_p3");
            }
            if (gameObject.name == "pack4")
            {
                Main.onBuy("wfw_p4");
            }
            if (gameObject.name == "pack5")
            {
                Main.onBuy("wfw_p5");
            }
            if (gameObject.name == "buy_page")
            {
                Main.onBuy("page_" + PlayerPrefs.GetInt("page").ToString());
            }


            if (gameObject.name == "Page_left")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page++;
                if (page > 7)
                {
                    page = 7;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "FaceBook")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }

            if (gameObject.name == "Sayrex")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }


            if (gameObject.name == "GameCenter")
            {
                Main.onLeaderBoard();
            }

            if (gameObject.name == "ARCH")
            {
                Main.SX.GetComponent <SX_GameCenter>().showArchievements();
            }


            if (gameObject.name == "sound")
            {
                Debug.Log("Here");
                if (sound)
                {
                    PlayerPrefs.SetInt("sound", 1);
                    sound = false;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_off";
                    AudioListener.volume = 0;
                }
                else
                {
                    PlayerPrefs.SetInt("sound", 0);
                    sound = true;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_on";
                    AudioListener.volume = 1;
                }
            }
        }
    }