Example #1
0
        public void OnClickedStart()
        {
                        #if VS_SHARE
            VSSHARE.DOHideScreenshotIcon();
                        #endif

            PlaySoundFX_Start();

            player.EnableShadows(false);

            player.DOActivate();

            Camera.main.transform.parent = null;

            var savePos = player.transform.position;

            player.transform.position = savePos + Vector3.up * 10;

                        #if AADOTWEEN
            player.transform.DOMove(savePos, 1)
            .SetEase(Ease.OutBounce)
            .OnComplete(() => {
                Camera.main.transform.parent = player.transform;
                DOPlayerMove();

                player.EnableShadows(true);
            });
                        #endif
        }
		void Awake()
		{
			GC.Collect();
			Time.fixedDeltaTime = 1f/60f;
			Time.maximumDeltaTime = 3 * Time.fixedDeltaTime;
			DesactivateUIFitter();
			self = this;
			SetInGameScoreOut();


			#if APPADVISORY_ADS && UNITY_ANDROID
			this.isAmazon = AdsManager.instance.adIds.isAmazon;
			#endif

			#if VS_SHARE
			VSSHARE vsshare = FindObjectOfType<VSSHARE>();
			vsshare.isAmazon = isAmazon;

			vsshare.iD_iOS = iD_iOS;

			vsshare.bundleIdAndroid = bundleIdAndroid;

			vsshare.amazonID = amazonID;

			vsshare.shareTextBeforeUrl = this.shareTextBeforeUrl;
			vsshare.shareTextBeforeAfter = this.shareTextBeforeAfter;
			#endif


		}
Example #3
0
        /// <summary>
        /// Method called by the UIController (have a look to the UIController GameObject editor, in the "On UI Anim Out End".
        /// </summary>
        public void DOStart()
        {
                        #if VS_SHARE
            VSSHARE.DOHideScreenshotIcon();
                        #endif

            InputTouch.OnTouched += OnTouched;

            if (dotUpBlue.position.x <= 0.01f && dotUpBlue.position.x >= -0.01f)
            {
                currentColorUp   = DotColor.Blue;
                currentColorDown = DotColor.Pink;
            }
            else
            {
                currentColorUp   = DotColor.Pink;
                currentColorDown = DotColor.Blue;
            }

            player.GetComponent <DotBase>().SetColor(currentColorUp);

            isStarted  = true;
            isGameOver = false;

            StopAllCoroutines();

            point = 0;

            player.DOMoveY(dotUpPink.position.y - decal, timeToMoveFromTopToBottom / 2f).SetEase(Ease.Linear).OnComplete(DOMovePlayer);
        }
        public void OnclickedPlay()
        {
            Application.targetFrameRate = 60;
            GC.Collect();
            Time.fixedDeltaTime   = 1f / 60f;
            Time.maximumDeltaTime = 3 * Time.fixedDeltaTime;

            success    = false;
            canShoot   = true;
            isGameOver = false;

            LaunchRotateCircle();

            foreach (SpriteRenderer s in allSprites)
            {
                s.color = BackgroundColor;
                                #if AADOTWEEN
                s.DOColor(DotColor, 0.3f)
                .SetEase(Ease.Linear);
                                #endif
            }

                        #if VS_SHARE
            VSSHARE.DOHideScreenshotIcon();
                        #endif
        }
Example #5
0
 public void OnSharePressed()
 {
     VSSHARE.self.useCustomShareText = true;
     VSSHARE.self.customShareText    = "#cytoid";
     VSSHARE.DOTakeScreenShot();
     VSSHARE.OnScreenshotTaken -= ShareScreenshot;
     VSSHARE.OnScreenshotTaken += ShareScreenshot;
 }
Example #6
0
        /// <summary>
        /// Method to shoot the first dot and moving the other. This method check if the list of dots to shoot is empty or not. If the list is empty, this method triggered the success for this level.
        /// </summary>
        void ShootDot(DotManager d)
        {
            playerCanShoot = false;

            StopCoroutine("PositioningDots");

            StopCoroutine("MoveStartPositionDot");

            d.GetComponent <Collider2D>().enabled = true;

            soundManager.PlaySoundBeep();

            Dots.Remove(d);

            PositioningDotsToShoot();

            d.GetComponent <Collider2D>().enabled = true;

            d.transform.position = new Vector3(0, -positionTouchBorder + (-0 - 2) * sizeDot, 0);

            d.transform.DOKill();

            d.transform.DOMoveY(-positionTouchBorder, 0.1f).SetEase(Ease.Linear)
            .OnUpdate(() => {
                playerCanShoot = false;
                if (isGameOver)
                {
                    DOTween.Kill(d.transform);
                }
            })
            .OnComplete(() => {
                d.ActivateLine();

                d.transform.parent = CircleBorder;

                playerCanShoot = true;

                if (Dots.Count == 0 && !isGameOver)
                {
                    isSuccess = true;
                }

                if (isSuccess && !isGameOver)
                {
                    AnimationCameraSuccess();
                }

                PositioningDotsToShoot();
            });

                        #if VS_SHARE
            VSSHARE.DOHideScreenshotIcon();
                        #endif
        }
Example #7
0
        /// <summary>
        /// Animation when the player lose
        /// </summary>
        public void AnimationCameraGameOver()
        {
            if (isGameOver)
            {
                return;
            }

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif

            ShowAds();

            DOTween.KillAll();
            soundManager.PlaySoundFail();
            isGameOver = true;
            isGameOver = true;

            StopAllCoroutines();


            playerCanShoot = false;

            if (OnFailStart != null)
            {
                OnFailStart();
            }

            Color colorFrom = constant.BackgroundColor;
            Color colorTo   = constant.FailColor;

            float delay = 0.3f;


            Camera.main.backgroundColor = colorFrom;

            Camera.main.DOColor(colorTo, delay).OnComplete(() => {
                DOVirtual.DelayedCall(delay, () => {
                    if (OnFailComplete != null)
                    {
                        OnFailComplete();
                    }
                });
                Camera.main.DOColor(colorFrom, delay).SetDelay(delay).OnComplete(() => {
                    Camera.main.DOColor(colorFrom, delay).SetDelay(delay / 2).OnComplete(() => {
                    });
                });
            });



            Camera.main.transform.DOShakePosition(delay, 1, 10, 90, false);
        }
Example #8
0
 // Update is called once per frame
 void Update()
 {
     if (countdown == 0)
     {
         countdown = -1;
         VSSHARE.DOShareScreenshot("Look at my best score!");
     }
     else if (countdown > 0)
     {
         countdown--;
     }
 }
Example #9
0
    public void OnClickedButton()
    {
        bool canOpen = VSSHARE.DOOpenScreenshotButton();

        if (canOpen)
        {
            Debug.Log("succefully opened screenshot because one screenshot is available");
        }
        else
        {
            Debug.LogWarning("We can't open screenshot if no screenshot is available");
        }
    }
Example #10
0
        /// <summary>
        /// Animation when the player cleared the level
        /// </summary>
        public void AnimationCameraSuccess()
        {
            if (isGameOver)
            {
                return;
            }

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif

            ShowAds();

            ReportScoreToLeaderboard(this.LEVEL.levelNumber);

            playerCanShoot = false;
            soundManager.PlaySoundSuccess();
            isGameOver = true;


            if (OnSuccessStart != null)
            {
                OnSuccessStart();
            }

            Color colorFrom = constant.BackgroundColor;
            //Color colorFrom = constant.BackgroundColors[UnityEngine.Random.Range(0, constant.BackgroundColors.Length)];
            Color colorTo = constant.SuccessColor;


            float delay = 0.10f;

            Camera.main.backgroundColor = colorFrom;
            Camera.main.DOColor(colorTo, delay);

            CircleBorder.DOScale(Vector3.one * 2f, delay * 4).OnComplete(() => {
                CircleBorder.DOScale(Vector3.one, delay * 4).OnComplete(() => {
                    Camera.main.DOColor(colorFrom, delay);
                });

                if (OnSuccessComplete != null)
                {
                    OnSuccessComplete();
                }
            });
        }
Example #11
0
        /// <summary>
        /// Method to create the level
        /// </summary>
        public void CreateGame(int level)
        {
            ReportScoreToLeaderboard(level);

            playerCanShoot = false;
            isGameOver     = true;

            Application.targetFrameRate = 60;
            Time.timeScale = 1;


            GC.Collect();

            this.Level = level;


            StopAllCoroutines();

            //Camera.main.backgroundColor = constant.BackgroundColor;
            Camera.main.backgroundColor = constant.BackgroundColors[UnityEngine.Random.Range(0, constant.BackgroundColors.Length)];

            DespawnAll();

            Dots = new List <DotManager>();

            this.LEVEL = levelManager.GetLevel(Level);

            CircleBorder.localScale = new Vector3(1, 1, 1);

            CreateDotOnCircle();

            CreateListDots();

            PositioningDotsToShoot();

            LaunchRotateCircle();

            isSuccess      = false;
            isGameOver     = false;
            playerCanShoot = true;

                        #if VS_SHARE
            VSSHARE.DOOpenScreenshotButton();
                        #endif
        }
Example #12
0
        void LevelCleared()
        {
            ShowAds();

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif

            PlaySoundSuccess();
            isGameOver = true;

            canShoot = false;


            DOColorSuccess(() => {
                RestartLevel(true);
            });
        }
Example #13
0
        /// <summary>
        /// Method called when the player loses. We will fade out all the in game elements(the 4 big dots, and the player ball) and restart the scene.
        /// </summary>
        void DOGameOver()
        {
            InputTouch.OnTouched -= OnTouched;

            FindObjectOfType <AppAdvisory.UI.UIController>().DOTakeScreenshotWithVerySimpleShare();

            isGameOver = true;
            isStarted  = false;

            PlaySoundLose();

            StopAllCoroutines();
            DOTween.KillAll();

            Utils.SetBest(point);
            Utils.SetLast(point);

            player.DOMoveY(Mathf.Sign(player.transform.position.y) * Mathf.Abs(dotUpPink.position.y - decal) * 3, timeToMoveFromTopToBottom * 2)
            .SetEase(Ease.Linear);

            textScore.DOFade(0f, timeToMoveFromTopToBottom * 1.5f);

            DOVirtual.Float(1f, 0f, timeToMoveFromTopToBottom * 1.5f, delegate(float value) {
                textScore.SetAlpha(value);
                DOAlphaDots(value);
            })
            .OnComplete(() => {
                SetInGameElementsActive(false);

                Utils.ReloadLevel();
            });

            ReportScoreToLeaderboard(point);

            FindObjectOfType <AppAdvisory.UI.UIController>().textLast.text = "LAST\n" + Utils.GetLast();
            FindObjectOfType <AppAdvisory.UI.UIController>().textBest.text = "BEST\n" + Utils.GetBest();

            ShowAds();

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif
        }
Example #14
0
        void GameOver()
        {
            ShowAds();

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif

            DOTween.KillAll();

            StopAllCoroutines();

            PlaySoundFail();

            isGameOver = true;

            canShoot = false;

            DOColorFail(() => {
                RestartLevel(false);
            });
        }
Example #15
0
        public void DOGameOver()
        {
            Util.SetLastScore(point);

            FindObjectOfType <UIController>().SetBestText(Util.GetBestScore());
            FindObjectOfType <UIController>().SetLastText(Util.GetLastScore());

            ShowAds();

                        #if VS_SHARE
            VSSHARE.DOTakeScreenShot();
                        #endif

                        #if APPADVISORY_LEADERBOARD
            LeaderboardManager.ReportScore(point);
                        #endif

            InputTouch.OnTouchedDown -= OnTouchedDown;

                        #if AADOTWEEN
            DOTween.KillAll();
                        #endif

            PlaySoundFX_DoorMiss();

                        #if AADOTWEEN
            Camera.main.DOOrthoSize(Camera.main.orthographicSize * 0.9f, 0.1f)
            .SetLoops(5, LoopType.Yoyo)
            .OnComplete(() => {
                Camera.main.DOOrthoSize(Camera.main.orthographicSize * 0.01f, 1f)
                .OnComplete(() => {
                    Util.ReloadLevel();
                });
            });
                        #endif
        }
Example #16
0
 void ShareScreenshot(Texture2D tex)
 {
     VSSHARE.DOShareScreenshot(VSSHARE.self.customShareText, ShareType.Native);
 }
Example #17
0
 public void DOTakeScreenshotWithVerySimpleShare()
 {
                 #if VS_SHARE
     VSSHARE.DOTakeScreenShot();
                 #endif
 }
Example #18
0
    void Update()
    {
        bool enabledIt = VSSHARE.haveScreenshotAvailable && VSSHARE.GetButtonShareState() == ButtonShareState.isClosed;

        button.interactable = enabledIt;
    }
Example #19
0
 public void OnButtonPress()
 {
     VSSHARE.DOTakeScreenShot();
     countdown = 5;
 }
Example #20
0
 public void HideVerySimpleShare()
 {
                 #if VS_SHARE
     VSSHARE.DOHideScreenshotIcon();
                 #endif
 }