Exemplo n.º 1
0
 public void setCurrentSpritesKit(int id)
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     if (!billing.isUnlock() /*!data.isBuy*/)
     {
         if (id == 1)
         {
             OnBuyClick();
         }
         else
         {
             return;
         }
     }
     else
     {
         for (int i = 0; i < sets.Length; i++)
         {
             if (i == id)
             {
                 sets[i].setBgColor(chooseColor, chooseColorText);
                 sets[i].choose();
             }
             else
             {
                 sets[i].setBgColor(notChooseColor, notChooseColorText);
                 sets[i].deSelect();
             }
         }
         data.spritesId = id;
         data.save();
     }
 }
Exemplo n.º 2
0
    void addPoints(int points)
    {
        int pre   = 0;
        int after = 0;

        pre = currentScores / Config.pointsForTimer;

        currentScores += points;

        after = currentScores / Config.pointsForTimer;
        if (pre != after)
        {
            AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_refresh_add);
            currentTimeBreakers++;
            showTimeBreakers(true);
        }
        currentScoresView.text = currentScores.ToString();

        if (points > 0)
        {
            GameObject obj = Instantiate(flyingPointsPrefab, currentScoresView.gameObject.GetComponent <RectTransform> ().position, Quaternion.identity) as GameObject;
            obj.transform.SetParent(transform);
            obj.GetComponent <RectTransform> ().localScale = new Vector3(1f, 1f, 1f);
            obj.GetComponent <FlyingPoints> ().View(points, directionsForPoints[dirIndx]);

            dirIndx++;
            if (dirIndx >= directionsForPoints.Length)
            {
                dirIndx = 0;
            }
        }
    }
Exemplo n.º 3
0
 public void OnMainMenuClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     mainMenu.SetActive(true);
     options.SetActive(false);
     helpObj.SetActive(false);
 }
Exemplo n.º 4
0
 public void showLeaderBoard()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
             #if UNITY_IPHONE || UNITY_ANDROID
     UM_GameServiceManager.instance.ShowLeaderBoardsUI();
             #else
             #endif
 }
Exemplo n.º 5
0
 public void OnOptionsClick()
 {
     options.GetComponent <Options> ().Initialize();
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     mainMenu.SetActive(false);
     options.SetActive(true);
     helpObj.SetActive(false);
 }
Exemplo n.º 6
0
 public void OnRateClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
             #if UNITY_IPHONE
     Application.OpenURL("https://itunes.apple.com/us/app/alien-the-hardest-game/id1049621532?ls=1&mt=8");
             #else
     Application.OpenURL("https://play.google.com/store/apps/developer?id=Game+Star+Co.+Ltd");
             #endif
 }
Exemplo n.º 7
0
 public void runGame()
 {
     preGameView.SetActive(false);
     AppSoundManager.Get().PlayMusic(Music.Type.game);
     //Random.seed = seed;
     currentLvl          = 0;
     currentScores       = 0;
     currentTimeBreakers = 0;
     addPoints(0);
     restartGame();
 }
Exemplo n.º 8
0
 public void onGamePress()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click);
     loadScreen.SetActive(true);
     //GoTo.LoadMegaCity ();
     GoTo.LoadNewShop();
     //StartCoroutine (showIntersential ());
     AdMob_Manager.Instance.curTime = 0f;
     AdMob_Manager.Instance.hideBanner();
     //GoTo.LoadEnvironmentChoose();
 }
Exemplo n.º 9
0
 public void onPlayCLick(bool isTick = true)
 {
     if (isTick)
     {
         AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     }
     AppSoundManager.Get().StopMusic();
     GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().HideBaner();
     startGamePopup.SetActive(false);
     preGameView.SetActive(true);
     GetComponent <Animator> ().Play("PreGameAnim", 0, 0f);
 }
Exemplo n.º 10
0
    public void itemClick(Item itm)
    {
        if (!mStartedGameplay)
        {
            return;
        }

        if (itm.type == Item.Type.bad_spy)
        {
            Handheld.Vibrate();
            AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_monster_click);
            loseGame(false, itm.gameObject);
        }
        else if (itm.type == Item.Type.good)
        {
            AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_item_click);
            GameObject obj = Instantiate(flashPrefab, itm.gameObject.GetComponent <RectTransform>().position, Quaternion.identity) as GameObject;
            obj.transform.SetParent(transform);
            obj.GetComponent <RectTransform>().localScale = new Vector3(1f, 1f, 1f);

            if (preItemID == itm.goodTypeID)
            {
                streak++;
                if (streak >= 2)
                {
                    showStreak(itm, streak);
                }
            }
            else
            {
                if (streak >= 2)
                {
                    addPoints(calculatePointForStreak());
                }
                streak = 1;
            }

            preItemID = itm.goodTypeID;

            itm.fadeOut();
            foundItems += 1;
            if (foundItems >= itemsForFind)
            {
                if (streak >= 2)
                {
                    addPoints(calculatePointForStreak());
                    streak = 1;
                }
                StartCoroutine(winGame());
            }
        }
    }
Exemplo n.º 11
0
    public void loseGame(bool isTime = false, GameObject obj = null)
    {
        if (!mStartedGameplay)
        {
            return;
        }

        AppSoundManager.Get().StopMusic();
        if (data.highScore < currentScores)
        {
            data.highScore = currentScores;
            data.save();
            UM_GameServiceManager.instance.SubmitScore(leaderBoardId, (int)currentScores);
        }
        if (currentScores > 5000)
        {
            UM_AdManager.instance.StartInterstitialAd();
        }
        mStartedGameplay = false;

        if (isTime)
        {
            AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_time_over);
            gameOverViewTime.SetActive(true);

            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].GetComponent <Item>().type != Item.Type.good)
                {
                    //objPool.push(items[i]);
                    items[i].GetComponent <Item>().hideItem();
                }
            }

            StartCoroutine(onGameOver());
        }
        else
        {
            for (int i = 0; i < items.Count; i++)
            {
                if (items[i] != obj)
                {
                    //objPool.push(items[i]);
                    items[i].GetComponent <Item>().hideItem();
                }
            }
            StartCoroutine(gameOverByClick());
        }
    }
Exemplo n.º 12
0
    public void  OnMusicTick()
    {
        data.music = !data.music;
        data.save();

        AppSoundManager.MuteSfx   = !data.music;
        AppSoundManager.MuteMusic = !data.music;
        AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);

//		if(data.music)
//			AppSoundManager.Get ().PlayMusic(Music.Type.game);
//		else
//			AppSoundManager.Get ().StopMusic ();

        setMusicImg();
    }
Exemplo n.º 13
0
    public void loseGame(bool isTime = false, GameObject obj = null)
    {
        if (!mStartedGameplay)
        {
            return;
        }

        AppSoundManager.Get().StopMusic();
        if (data.highScore < currentScores)
        {
            data.highScore = currentScores;
            data.save();
        }
        mStartedGameplay = false;

        if (isTime)
        {
            AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_time_over);
            gameOverViewTime.SetActive(true);

            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].GetComponent <Item>().type != Item.Type.good)
                {
                    //objPool.push(items[i]);
                    items[i].GetComponent <Item>().hideItem();
                }
            }

            StartCoroutine(onGameOver());
        }
        else
        {
            for (int i = 0; i < items.Count; i++)
            {
                if (items[i] != obj)
                {
                    //objPool.push(items[i]);
                    items[i].GetComponent <Item>().hideItem();
                }
            }
            StartCoroutine(gameOverByClick());
        }

        PlayGamesPlatform.Instance.ReportScore(data.highScore, Config.borderId, (bool succes) => {});
    }
Exemplo n.º 14
0
    public void onTimeClick()
    {
        if (currentTimeBreakers <= 0)
        {
            return;
        }

        AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_refresh_click);
        currentTimeBreakers -= 1;
        int count = items.Count;

        for (int i = 0; i < count; i++)
        {
            items[i].GetComponent <Item>().resetTime();
        }

        showTimeBreakers();
        timeBreakerAnimator.Play("useTimeBreakerPoints", 0, 0f);
    }
Exemplo n.º 15
0
 public void OnBtnPress()
 {
     state = !state;
     if (type == Type.MUSIC)
     {
         if (state)
         {
             Debug.Log("Music On");
             setOnImg();
             AppSoundManager.MuteMusic = false;
             GameData.Get().music = true;
             GameData.Get().save();
         }
         else
         {
             setOffImg();
             Debug.Log("Music OFF");
             AppSoundManager.MuteMusic = true;
             GameData.Get().music = false;
             GameData.Get().save();
         }
     }
     else
     {
         if (state)
         {
             setOnImg();
             Debug.Log("SFX On");
             AppSoundManager.MuteSfx = false;
             GameData.Get().sfx = true;
             GameData.Get().save();
         }
         else
         {
             setOffImg();
             Debug.Log("SFX OFF");
             AppSoundManager.MuteSfx = true;
             GameData.Get().sfx = false;
             GameData.Get().save();
         }
     }
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click);
 }
Exemplo n.º 16
0
    public void showScreenBetweenLvl()
    {
        if (streakInGame < 7)
        {
            return;
        }

        betweenLvlvAnimator.gameObject.SetActive(true);

        AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_streak);
        if (streakInGame >= 7 && streakInGame < 9)
        {
            betweenLvlvAnimator.Play("good", 0, 0f);
        }
        else if (streakInGame >= 9 && streakInGame < 11)
        {
            betweenLvlvAnimator.Play("perfect", 0, 0f);
        }
        else if (streakInGame >= 11)
        {
            betweenLvlvAnimator.Play("exelent", 0, 0f);
        }
    }
Exemplo n.º 17
0
 public void OnPlayClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     UM_AdManager.instance.HideBanner(bannerId1);
     GoTo.LoadGame();
 }
Exemplo n.º 18
0
 public void OnRateClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     UniRate.Instance.PromptIfNetworkAvailable();
 }
Exemplo n.º 19
0
 public void OnHighScoreClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     PlayGamesPlatform.Instance.ShowLeaderboardUI(Config.borderId);
 }
Exemplo n.º 20
0
 public void OnPlayClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().HideBaner();
     GoTo.LoadGame();
 }
Exemplo n.º 21
0
 public void OnExitClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     Application.Quit();
     Debug.Log("exit");
 }
Exemplo n.º 22
0
 public void OnBuyClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
 }
Exemplo n.º 23
0
 public void OnBuyClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     billing.unlockKit(onBuy);
 }
Exemplo n.º 24
0
    public void switchCamera()
    {
        AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click);
        var BikeScript = (BikeControl)target.GetComponent <BikeControl>();

        camera.fieldOfView = Mathf.Clamp(BikeScript.speed / 10.0f + 60.0f, 60, 90.0f);

        if (BikeScript.curTorque == BikeScript.bikeSetting.shiftPower)
        {
            //transform.GetComponent<MotionBlur>().blurAmount = Mathf.Lerp(transform.GetComponent<MotionBlur>().blurAmount, 1.0f, Time.deltaTime * 5);
        }
        else
        {
            //transform.GetComponent<MotionBlur>().blurAmount = Mathf.Lerp(transform.GetComponent<MotionBlur>().blurAmount, 0.0f, Time.deltaTime);
        }
        Switch++;
        if (Switch > cameraSwitchView.Length)
        {
            Switch = 0;
        }
        if (Switch == 0)
        {
            if (BikeScript.currentGear == 0 && BikeScript.speed > 2)
            {
                backAngle = 180;
            }
            else
            {
                backAngle = 0;
            }


            float yAngle = Mathf.SmoothDampAngle(transform.eulerAngles.y,
                                                 target.eulerAngles.y + backAngle, ref yVelocity, smooth);

            /*
             * float xAngle = Mathf.SmoothDampAngle(transform.eulerAngles.x,
             * target.eulerAngles.x + Angle, ref xVelocity, smooth);
             */


            // Position at the target
            Vector3 position = target.position;
            // Then offset by distance behind the new angle
            position += Quaternion.Euler(0, yAngle, 0) * new Vector3(0, 0, -distance);
            // Apply the position
            //  transform.position = position;

            // Look at the target
            transform.eulerAngles = new Vector3(Angle, yAngle, 0);

            var direction      = transform.rotation * -Vector3.forward;
            var targetDistance = AdjustLineOfSight(target.position + new Vector3(0, haight, 0), direction);



            transform.position = target.position + new Vector3(0, haight, 0) + direction * targetDistance;
        }
        else
        {
            transform.position = cameraSwitchView[Switch - 1].position;
            transform.rotation = Quaternion.Lerp(transform.rotation, cameraSwitchView[Switch - 1].rotation, Time.deltaTime * 10.0f);
        }
    }
Exemplo n.º 25
0
 public void onGamePress()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click);
     loadScreen.SetActive(true);
     GoTo.LoadEnvironmentChoose();
 }
Exemplo n.º 26
0
 public void onMenuClick()
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().ShowBaner();
     GoTo.LoadMenu();
 }
Exemplo n.º 27
0
    public void onMenuClick()
    {
        AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);

        GoTo.LoadMenu();
    }
Exemplo n.º 28
0
 public void setCurrentSpritesKit(int id)
 {
     AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click);
     data.spritesId = id;
     data.save();
 }