Exemple #1
0
    void SwitchMusic(int nextFocus)
    {
        MusicUIItem currentItem = musicUIItemList[focusIndex];
        MusicUIItem nextItem    = musicUIItemList[nextFocus];

        float updatedGroupPosition = -nextFocus * (itemWidth + itemSpacing);

        musicUIGroup.transform.DOPause();
        musicUIGroup.transform.DOLocalMoveX(updatedGroupPosition, swipeTransitionDuration, true).SetEase(Ease.OutQuad).OnComplete(() =>
        {
            Music nextMusic = nextItem.music;
            if (playMusicCoroutine != null)
            {
                StopCoroutine(playMusicCoroutine);
            }
            playMusicCoroutine      = StartCoroutine(LoadAsyncAndPlay(nextMusic));
            bannerBackground.sprite = nextItem.albumImage.sprite;
            bannerBackground.DOFade(backgroundAlpha, swipeTransitionDuration).SetEase(Ease.OutQuad);
        });

        currentItem.transform.DOScale(itemMinScale, swipeTransitionDuration).SetEase(Ease.OutQuad);
        nextItem.transform.DOScale(itemMaxScale, swipeTransitionDuration).SetEase(Ease.OutQuad);

        currentItem.textGroup.DOFade(0, swipeTransitionDuration).SetEase(Ease.OutQuad);
        nextItem.textGroup.DOFade(1, swipeTransitionDuration).SetEase(Ease.OutQuad);

        audio.DOFade(0, swipeTransitionDuration).SetEase(Ease.OutQuad);
        bannerBackground.DOFade(0, swipeTransitionDuration).SetEase(Ease.OutQuad);

        focusIndex = nextFocus;
    }
Exemple #2
0
    public void SetGameState(GAME_STATE state)
    {
        GAME_STATE prevState = state;

        gameState = state;
        switch (state)
        {
        case GAME_STATE.INTRO:
            introStartTime = Time.time;
            imgIntro.DOFade(1.0f, 0.0f);
            imgTutorial.DOFade(0.0f, 0.0f);

            //canvasGroupIntro.DOFade(1.0f, 0.5f);
            break;

        case GAME_STATE.TUTORIAL:
            imgIntro.DOFade(0.0f, 0.5f);
            imgTutorial.DOFade(1.0f, 0.5f);
            //canvasGroupIntro.DOFade(1.0f, 0.5f);
            break;

        case GAME_STATE.PLAYER_SELECTION:
            canvasGroupIntro.DOFade(0.0f, 0.5f);
            canvasGroupPlayerSelection.DOFade(1.0f, 0.5f);
            lastTimePlayerAdded = Time.time;
            //activePlayers = 0;
            //for(int i = 0; i < activePlayers; ++i)
            //{
            //    PlayerController player = players[i];
            //    player.Reset();
            //    player.initialized = false;
            //}
            break;

        case GAME_STATE.GAME:
            canvasGroupIntro.alpha = 0.0f;
            if (canvasGroupGameOver != null)
            {
                canvasGroupGameOver.alpha = 0.0f;
            }
            if (prevState == GAME_STATE.GAME_OVER)
            {
                if (canvasGroupGameOver != null)
                {
                    canvasGroupGameOver.DOFade(0.0f, 0.5f);
                }
            }
            InitGame();
            break;

        case GAME_STATE.GAME_OVER:
            if (canvasGroupGameOver != null)
            {
                canvasGroupGameOver.DOFade(1.0f, 0.5f);
            }
            gameOverStartTime = Time.time;
            break;
        }
    }
 public static void Fade(Image element, float fadeTo, float fadeAfter, float timeToFade)
 {
     DOTween.Sequence()
         .AppendInterval(fadeAfter)
         .Append(element.DOFade(fadeTo, timeToFade)
         .SetEase(Ease.InOutExpo));
 }
Exemple #4
0
    static int DOFade(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <UnityEngine.UI.Image, float, float>(L, 1))
            {
                UnityEngine.UI.Image obj = (UnityEngine.UI.Image)ToLua.ToObject(L, 1);
                float arg0            = (float)LuaDLL.lua_tonumber(L, 2);
                float arg1            = (float)LuaDLL.lua_tonumber(L, 3);
                DG.Tweening.Tweener o = obj.DOFade(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.UI.Graphic, float, float>(L, 1))
            {
                UnityEngine.UI.Image obj = (UnityEngine.UI.Image)ToLua.ToObject(L, 1);
                float arg0            = (float)LuaDLL.lua_tonumber(L, 2);
                float arg1            = (float)LuaDLL.lua_tonumber(L, 3);
                DG.Tweening.Tweener o = obj.DOFade(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.UI.Image.DOFade"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemple #5
0
 static int QPYX_DOFade_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.UI.Graphic, float, float>(L_YXQP, 1))
         {
             UnityEngine.UI.Image QPYX_obj_YXQP = (UnityEngine.UI.Image)ToLua.ToObject(L_YXQP, 1);
             float QPYX_arg0_YXQP            = (float)LuaDLL.lua_tonumber(L_YXQP, 2);
             float QPYX_arg1_YXQP            = (float)LuaDLL.lua_tonumber(L_YXQP, 3);
             DG.Tweening.Tweener QPYX_o_YXQP = QPYX_obj_YXQP.DOFade(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
             ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.UI.Image, float, float>(L_YXQP, 1))
         {
             UnityEngine.UI.Image QPYX_obj_YXQP = (UnityEngine.UI.Image)ToLua.ToObject(L_YXQP, 1);
             float QPYX_arg0_YXQP            = (float)LuaDLL.lua_tonumber(L_YXQP, 2);
             float QPYX_arg1_YXQP            = (float)LuaDLL.lua_tonumber(L_YXQP, 3);
             DG.Tweening.Tweener QPYX_o_YXQP = QPYX_obj_YXQP.DOFade(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
             ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.UI.Image.DOFade"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #6
0
    public static void AnimIn(UnityEngine.UI.Image background, RectTransform popup)
    {
        background.color    = new Vector4(0, 0, 0, 0);
        popup.localPosition = new Vector3(0, -(Screen.height + 300), 0);

        background.DOFade(0.8f, 1);
        popup.DOAnchorPosY(0, 1);
    }
Exemple #7
0
 public static void AnimIn(UnityEngine.UI.Image background)
 {
     if (background != null)
     {
         background.color = new Vector4(0, 0, 0, 0);
         background.DOFade(0.8f, 1);
     }
 }
Exemple #8
0
 public static void AnimOut(UnityEngine.UI.Image background, RectTransform popup, GameObject prefab)
 {
     background.DOFade(0, 1);
     popup.DOAnchorPosY(-(Screen.height + 300), 1).OnComplete(() =>
     {
         Destroy(prefab);
     });
 }
Exemple #9
0
    // Start is called before the first frame update
    void Start()
    {
        var sequence = DOTween.Sequence();

        sequence.Append(transform.DOScale(new Vector3(1f, 1f, 1f), 1.5f));
        sequence.Append(image.DOFade(endValue: 0f, duration: 1f));
        sequence.Play();
    }
Exemple #10
0
 void QuestionColorTweens()
 {
     QuestionDisplay.BackgroundActive(true);
     QuestionDisplay.Background.color = QuestionBackgroundColor;
     Background.DOColor(Color.black, 2f).SetDelay(.3f);
     Background.DOFade(0f, 2f).SetDelay(.3f);
     QuestionDisplay.Text.DOColor(QuestionTextColor, 1f).SetDelay(.3f);
     for (int i = 0; i < Buttons.Count; i++)
     {
         Buttons[i].Text.color = Color.white;
         //Buttons[i].Cgroup.DOFade(0f, .3f);
     }
 }
 static int DOFade(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.UI.Image obj = (UnityEngine.UI.Image)ToLua.CheckObject(L, 1, typeof(UnityEngine.UI.Image));
         float arg0            = (float)LuaDLL.luaL_checknumber(L, 2);
         float arg1            = (float)LuaDLL.luaL_checknumber(L, 3);
         DG.Tweening.Tweener o = obj.DOFade(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #12
0
        public override void Show()
        {
            backgroundCamera.enabled = true;
            background.color         = new Color(1f, 1f, 1f, 0);

            Sequence sequence = DOTween.Sequence();

            sequence.Append(background.DOFade(1f, 1f));
            title.transform.localScale = Vector3.zero;
            sequence.Append(title.transform.DOScale(Vector3.one, 0.4f).SetEase(Ease.OutBack));
            level.transform.localScale = new Vector3(0, 1f, 1f);
            sequence.Append(level.transform.DOScale(Vector3.one, 0.4f).SetEase(Ease.OutBack));
            sequence.AppendInterval(1f);
            goTovillageGroup.alpha = 0;
            sequence.Append(goTovillageGroup.DOFade(1f, 1f));
            sequence.AppendCallback(DisableAR);
            sequence.Play();



            base.Show();
        }
Exemple #13
0
 public static void AnimOut(UnityEngine.UI.Image background)
 {
     background.DOFade(0, 1);
 }