示例#1
0
    public void Start()
    {
        removeAds = PlayerPrefs.GetInt("RemoveAds");
        if (removeAds != 1)
        {
            if (bannerAdsController == null)
            {
                DontDestroyOnLoad(gameObject);
                bannerAdsController = this;

                SetApplicationIds();
                RequestBanner();

                Debug.Log("Banner reklamı gösterildi");
            }
            else
            {
                Destroy(gameObject);
            }
        }
    }
示例#2
0
    void Start()
    {
        //TVOS Ads Control
#if UNITY_TVOS
        PlayerPrefs.SetInt("RemoveAds", 1);
#endif


        //PlayerPrefs.SetInt("RemoveAds", 1);
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        settingsMenu.GetComponent <RectTransform>().sizeDelta = gameObject.GetComponent <RectTransform>().sizeDelta;

        introductionMenu.GetComponent <RectTransform>().sizeDelta = gameObject.GetComponent <RectTransform>().sizeDelta;
        gameObject.transform.GetChild(5).gameObject.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = gameObject.GetComponent <RectTransform>().sizeDelta;

        tutorialMenu.GetComponent <RectTransform>().sizeDelta = gameObject.GetComponent <RectTransform>().sizeDelta;
        gameObject.transform.GetChild(6).gameObject.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = gameObject.GetComponent <RectTransform>().sizeDelta;


        //if (IsIPad() || isAdroidTablet())
        //    Screen.orientation = ScreenOrientation.Landscape;
        //else
        Screen.orientation = ScreenOrientation.Portrait;

        character           = GameObject.Find("Character");
        mic                 = character.GetComponent <AudioSource>();
        characterController = character.GetComponent <Assets.Scripts.CharacterController>();

        //mainGameUI = GameObject.Find("MainGameUI");

        ss = PlayerPrefs.GetFloat("Sensitive");
        if (ss != 0)
        {
            Assets.Scripts.CharacterController.sensitivity = ss;
        }
        else
        {
            ss = Assets.Scripts.CharacterController.sensitivity;
        }
        gameObject.transform.GetChild(4).gameObject.transform.GetChild(2).gameObject.GetComponent <Slider>().value = ss;

        gameScoreText      = gameObject.transform.GetChild(3).gameObject.transform.GetChild(0).gameObject.GetComponent <Text>();
        boardScoreText     = gameObject.transform.GetChild(1).gameObject.transform.GetChild(1).gameObject.transform.GetChild(1).gameObject.GetComponent <Text>();
        boardBestScoreText = gameObject.transform.GetChild(1).gameObject.transform.GetChild(1).gameObject.transform.GetChild(0).gameObject.GetComponent <Text>();
        newBestScoreImage  = gameObject.transform.GetChild(1).gameObject.transform.GetChild(1).gameObject.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent <Image>();

        removeAds        = PlayerPrefs.GetInt("RemoveAds");
        removeAdsButton1 = gameObject.transform.GetChild(1).gameObject.transform.GetChild(3).gameObject;
        removeAdsButton2 = gameObject.transform.GetChild(2).gameObject.transform.GetChild(2).gameObject;
        removeAdsButton3 = gameObject.transform.GetChild(4).gameObject.transform.GetChild(4).gameObject;


        if (firstGameMenu)
        {
            MenuGameOver();
        }
        else
        {
            currentMenu   = MenuStates.StartMenu;
            firstGameMenu = true;
        }
        score = 0;

        bannerAdsController = GameObject.FindGameObjectWithTag("BannerAds").GetComponent <BannerAdsController>();
        removeAdsY          = removeAdsButton1.transform.position.y;
        removeAdsX          = removeAdsButton1.transform.position.x;

        #if UNITY_ANDROID
        url = AndroidRatingURI.Replace("{0}", Application.identifier);
        #elif UNITY_IOS
        url = iOSRatingURI.Replace("{0}", iOSAppID);
        #endif
    }