Example #1
0
    // Use this for initialization
    void Start()
    {
        if (GameData.isComingFromStore && !GameData.isComingFromGameOverStore)
        {
            //On Main menu
//			Debug.Log("Create 2");
            BackGroundManager.Instance.SpwanBird();
        }

        canRestored = false;
        if (!logoPanel.gameObject.activeSelf)       // && !GameData.isTutorial)
        {
            logoPanel.gameObject.SetActive(true);
        }
        if (tutorialPanel.gameObject.activeSelf)
        {
            tutorialPanel.gameObject.SetActive(false);
        }

        if (tutorialReplay.gameObject.activeSelf)
        {
            tutorialReplay.gameObject.SetActive(false);
        }

        hintText.gameObject.SetActive(false);
        hintText2.gameObject.SetActive(false);

        if (homePanel.gameObject.activeSelf)
        {
            homePanel.gameObject.SetActive(false);
        }
        if (instructionPanel.gameObject.activeSelf)
        {
            instructionPanel.gameObject.SetActive(false);
        }
        if (hudPanel.gameObject.activeSelf)
        {
            hudPanel.gameObject.SetActive(false);
        }
        if (gameOverPanel.gameObject.activeSelf)
        {
            gameOverPanel.gameObject.SetActive(false);
        }
        revivePanel.SetActive(false);
        inAppPanel.gameObject.SetActive(false);
        gameScore = 0;

        GameData.isMusic      = PlayerPrefs.GetBool(Constants.KEY_MUSIC, true);
        GameData.reviveCount  = PlayerPrefs.GetInt(Constants.KEY_REVIVE_CNT, 0);
        GameData.lifeTimeEggs = PlayerPrefs.GetInt(Constants.KEY_LIFE_TIME_EGGS, 0);
        GameData.unlockCount  = PlayerPrefs.GetInt(Constants.KEY_UNLOCK_CNT, 0);

//		#if UNITY_IOS
//		// array of product ID's from iTunesConnect. MUST match exactly what you have there!
//		var productIdentifiers = new string[] {Constants.PRODUCT_ID};
//		StoreKitBinding.requestProductData( productIdentifiers );
//
//		#elif UNITY_ANDROID
//		var skus = new string[] {Constants.PRODUCT_ID};
//		GoogleIAB.queryInventory( skus );
//		#endif

        PlayerPrefs.SetInt(Constants.KEY_TOTAL_EGGS, Main.Instance.totalEggs);
        GameData.isComingFromStore         = false;
        GameData.isComingFromGameOverStore = false;

        HZIncentivizedAd.setDisplayListener(listener);
        HZIncentivizedAd.fetch();
                #if UNITY_IOS
        AppTrackerIOS.startSession("FPxjfDrMNNVRJ0REcLqwHL45mG1HEnII");
                #endif

        if (!Main.Instance.isNoAdsPurchased)
        {
            HZBannerShowOptions showOptions = new HZBannerShowOptions();
            showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM;
            HZBannerAd.ShowWithOptions(showOptions);
        }
    }
Example #2
0
    public void StarGame()
    {
        isReviveBreaked = false;

                #if UNITY_IOS
        AppTrackerIOS.loadModuleToCache("inapp");
                #endif
        HZIncentivizedAd.fetch();
        GameData.isComingFromGameOverStore = false;

        //Deactivate Home panel
        if (homePanel.gameObject.activeSelf)
        {
            homePanel.gameObject.SetActive(false);
        }

        if (logoPanel.gameObject.activeSelf)
        {
            logoPanel.gameObject.SetActive(false);
        }

        if (tutorialPanel.gameObject.activeSelf)
        {
            tutorialPanel.gameObject.SetActive(false);
        }

        if (tutorialReplay.gameObject.activeSelf)
        {
            tutorialReplay.gameObject.SetActive(false);
        }

        if (hintText.gameObject.activeSelf)
        {
            hintText.gameObject.SetActive(false);
        }
        hintText2.gameObject.SetActive(false);

        CancelInvoke("ActivateTutorial");

        GameData.isRetry = false;

        bestScore          = PlayerPrefs.GetInt(Constants.KEY_BEST, 0);
        bestScoreText.text = "" + bestScore;

        //Activate Game Hud panel
        ResetHud();
        if (!hudPanel.gameObject.activeSelf)
        {
//			int eggID = (int)BackGroundManager.Instance.GetThemeID();
            int eggId = 2;
            if (GameData.currentBirdId == 1 || GameData.currentBirdId == 3)
            {
                eggId = 3;
            }
            else if (GameData.currentBirdId == 2 || GameData.currentBirdId == 5)
            {
                eggId = 0;
            }
            else if (GameData.currentBirdId == 4 || GameData.currentBirdId == 6)
            {
                eggId = 5;
            }
            else if (GameData.currentBirdId == 9)
            {
                eggId = 4;
            }
            else if (GameData.currentBirdId == 7)
            {
                eggId = 1;
            }
            else if (GameData.currentBirdId == 8)
            {
                eggId = 2;
            }
            string eggName = "egg_" + eggId;
            if (eggIcon != null)
            {
                eggIcon.sprite = Resources.Load <Sprite> ("Textures/Game/Eggs/" + eggName) as Sprite;
            }
            if (eggIconGO != null)
            {
                eggIconGO.sprite = Resources.Load <Sprite> ("Textures/Game/Eggs/" + eggName) as Sprite;
            }
            if (eggSmall != null)
            {
                eggSmall.sprite = Resources.Load <Sprite> ("Textures/Game/Eggs/" + eggName) as Sprite;
            }
            if (rewardEggIcon != null)
            {
                rewardEggIcon.sprite = Resources.Load <Sprite> ("Textures/Game/Eggs/" + eggName) as Sprite;
            }
            if (eggBig != null)
            {
                eggBig.sprite = Resources.Load <Sprite> ("Textures/Game/Eggs/" + eggName) as Sprite;
            }
            hudPanel.gameObject.SetActive(true);
        }
    }
Example #3
0
 void Awake()
 {
     instence = this;
     HeyzapAds.start("4f2ead6c706a5286add45879429b0be5", HeyzapAds.FLAG_NO_OPTIONS);
     HZIncentivizedAd.fetch();
 }