Exemplo n.º 1
0
 void OnJellyfishDrain()
 {
     pulse = DOTween.Sequence().Pause().SetLoops(loopCount);
     pulse.Append(image.DOColor(toColor, intervalOn).SetEase(easeOn));
     pulse.Append(image.DOColor(Color.black, intervalOff).SetEase(easeOff));
     pulse.Play();
 }
Exemplo n.º 2
0
	void Start()
	{
		Debug.Log("START");
		_seq = DOTween.Sequence().SetId("SEQ");
        _seq.Append(img.DOFade(1, 0.5f));
        _seq.AppendInterval(3f);
        _seq.Append(img.DOFade(0, 0.5f));
        _seq.AppendCallback(BalloonComplete);
        // _seq.OnComplete(BalloonComplete);
	}
Exemplo n.º 3
0
	IEnumerator startCor(float delay)
	{
		yield return new WaitForSeconds(delay);
		if ( sprite != null )
		{
			shineSequence = DOTween.Sequence();
			shineSequence.Append( sprite.DOFade( 1f , 1f ));
			shineSequence.Append( sprite.DOFade( 0.5f , 1f ).SetLoops( 99999 , LoopType.Yoyo ).SetEase(Ease.InOutCubic));
		}
		yield break;
		
	}
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        // land continue moving
        landSequence = DOTween.Sequence();

        landSequence.Append(transform.DOMoveX(transform.position.x - 0.48f, 0.5f).SetEase(Ease.Linear))
            .Append(transform.DOMoveX(transform.position.x, 0f).SetEase(Ease.Linear))
            .SetLoops(-1);
    }
Exemplo n.º 5
0
    // To flash the screen, just grab an empty Image component on an overlay canvas and tween its alpha in and out quickly
    public IEnumerator ScreenFlash(Color color, float duration, float fadeInTime, float fadeOutTime)
    {
        if (flashTween != null)
        {
            flashTween.Complete();
            yield return new WaitForEndOfFrame();
        }

        flashImage.color = color;

        flashTween = DOTween.Sequence().SetUpdate(UpdateType.Normal, true); // setting the update to unscaled time (the "true" here) allows us to flash during a hit pause
        flashTween.Append(flashImage.DOFade(1f, fadeInTime));
        flashTween.AppendInterval(duration);
        flashTween.Append(flashImage.DOFade(0f, fadeOutTime));
        yield return flashTween.WaitForCompletion();

        flashTween = null;
    }
	IEnumerator Start()
	{
		sequence = DOTween.Sequence();
		sequence.Append(target.DOMoveX(3, 3).SetRelative());
		sequence.Join(target.DOMoveY(3, 3).SetRelative());

		yield return new WaitForSeconds(1.5f);

		sequence.Kill(true);
	}
Exemplo n.º 7
0
    void GlitchTwitters()
    {
        glitchTw = DOTween.Sequence ();
        TweenCallback onComplete = RestartGlitch;

        glitchTw.Append (twitterAB.DOText (twAB, twGlitchTime, true, ScrambleMode.Lowercase).SetEase (Ease.Linear))
            .Append (twitterAP.DOText (twAP, twGlitchTime, true, ScrambleMode.Lowercase).SetEase (Ease.Linear))
                .AppendInterval (twGlitchDelay)
                .AppendCallback (onComplete);
    }
Exemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        seq = DOTween.Sequence();

        seq.Prepend(transform.DOLocalMove(new Vector3(0.0f,0.0f,8.0f),0.8f).SetEase(Ease.OutSine));        //中心点を経由
        seq.Join(transform.DOLocalRotate(Vector3.zero, 0.8f).SetEase(Ease.Linear));
        seq.Append(transform.DOLocalMove(new Vector3(10.0f, -24.0f,8.0f), 0.8f).SetEase(Ease.InSine));
        seq.Join(transform.DOLocalRotate(new Vector3(0.0f,0.0f,-179.0f), 0.8f).SetEase(Ease.Linear));
        //終了地点

        seq.Play();
    }
        /// <summary> Updates the current Value for this Progressor. Ignores the AnimateValue option if instantUpdate is passed as TRUE </summary>
        /// <param name="value"> The new current Value </param>
        /// <param name="instantUpdate"> If TRUE, the current Value will not get animated even if AnimateValue is set to TRUE </param>
        public void SetValue(float value, bool instantUpdate)
        {
//            m_previousValue = Value;
            value = ClampValueBetweenMinAndMax(value, m_wholeNumbers);
            if (Math.Abs(value - Value) < TOLERANCE)
            {
                return;
            }

            if (AnimateValue)
            {
                KillAnimation();
            }

            if (instantUpdate || !AnimateValue)
            {
                Value = value;
                return;
            }

            m_animationSequence.Append(GetAnimationTween(value, AnimationDuration, AnimationEase, AnimationIgnoresUnityTimescale))
            .Play();
        }
 private void runGameOverSequence()
 {
     _crossHair.SetActive(false);
     _fader.enabled = true;
     _fader.color   = new Color(0, 0, 0, 0);
     _sequence      = DOTween.Sequence();
     _sequence.AppendCallback(() => { _outroCamera.gameObject.SetActive(true); });
     _sequence.AppendInterval(2);
     _sequence.AppendCallback(() => { ShowSubtitles.Instance.ShowOutroSubtitles(); });
     _sequence.AppendInterval(10);
     _sequence.AppendCallback(() =>
     {
         _fire.transform.DOScaleY(0, 1);
         _fire.transform.DOMoveY(0.5f, 1);
     });
     _sequence.AppendInterval(1);
     _sequence.AppendCallback(() => { _fire.SetActive(false); });
     _sequence.AppendInterval(5);
     _sequence.AppendCallback(() => _fire.SetActive(false));
     _sequence.Append(_fader.DOColor(Color.black, 0));
     _sequence.AppendInterval(3);
     _sequence.AppendCallback(() => _gamedata.LoadGameOverScene());
 }
Exemplo n.º 11
0
 public void TweenPopUp()
 {
     if (isNeedPopUp)
     {
         if (!isInit)
         {
             isInit = true;
             t      = rectTrans.DOLocalMove(new Vector3(pTrans.x, pTrans.y + moveY, pTrans.z), moveTime).SetLoops(-1, LoopType.Yoyo);
             posSeq.Append(t);
         }
         t.Play();
     }
     else
     {
         isInit = false;
         if (t != null)
         {
             t.Kill();
         }
         posSeq.Kill();
         rectTrans.localPosition = pTrans;
     }
 }
Exemplo n.º 12
0
    void Update()
    {
        if (Application.isEditor && Input.GetKeyDown(InputKey))
        {
            if (ui == null)
            {
                ui = GameObject.FindGameObjectWithTag("UI");
            }

            ui.SetActive(false);
            MoveObject.gameObject.SetActive(true);
            float time = (EndPos.position - StartPos.position).magnitude / Speed;

            tween.Rewind();
            tween = DOTween.Sequence();

            MoveObject.transform.position = StartPos.position;
            tween.Append(MoveObject.transform.DOMove(EndPos.position, time).SetEase(EaseCurve));
            tween.AppendInterval(HoldTime);
            tween.AppendCallback(() => ui.SetActive(true));
            tween.AppendCallback(() => MoveObject.gameObject.SetActive(false));
        }
    }
Exemplo n.º 13
0
    private void StartAnimation()
    {
        if (animation != null)
        {
            animation.Kill();
        }

        thisTransform.position = waypoints[0];

        animation = DOTween.Sequence();
        var tweener = thisTransform.DOPath(waypoints, duration, PathType.Linear, PathMode.Full3D).SetEase(Ease.Linear);

        animation.Append(tweener);
        animation.AppendInterval(delay);
        animation.SetLoops(-1, LoopType.Restart);

        animation.OnStepComplete(delegate {
            // Hack to restart the animation without leaving a trail behind
            gameObject.SetActive(false);
            thisTransform.position = waypoints[0];
            gameObject.SetActive(true);
        });
    }
Exemplo n.º 14
0
    private void CloseStageSelect()
    {
        Sequence seq = DOTween.Sequence();

        // アニメーション追加
        seq.Append(stage_select_obj.transform.DOScaleY(0.0f, anime_time));

        seq.OnStart(() => {
            // アニメーション開始時によばれる
            Debug.Log("Animation Start");
        });

        seq.OnUpdate(() => {
            // 対象の値が変更される度によばれる
            Debug.Log("Animation Update");
        });

        seq.OnComplete(() => {
            Debug.Log("Animation End");
            seq.Complete();
            // アニメーションが終了時によばれる
        });
    }
Exemplo n.º 15
0
    public void Show()
    {
        var    rewardTypeName = reward.GetType().ToString();
        string rewName        = rewardTypeName.Remove(rewardTypeName.IndexOf("Reward"), "Reward".Length);

        gameObject.SetActive(true);
        rewardName.text  = rewName + ":";
        rewardValue.text = "+" + reward.Value.ToString();
        SetRandomColor();
        rt = transform.GetComponent <RectTransform>();

        transform.localScale = Vector3.zero;
        Sequence seq = DOTween.Sequence();

        seq.Append(transform.DOScale(Vector3.one, .25f).SetEase(Ease.OutExpo))
        .Append(rt.DOAnchorPosY(rt.anchoredPosition.y + 40f, 1.25f).SetEase(Ease.OutCirc))
        .Join(rt.DOAnchorPosX(rt.anchoredPosition.x + direction * 55f, 1.5f).SetEase(Ease.OutCirc))
        .Join(rt.DORotate(new Vector3(0, 0, -direction * 17f), 1f).SetEase(Ease.OutCubic))
        .Join(rewardName.DOFade(0, 2).SetEase(Ease.InExpo))
        .Join(rewardValue.DOFade(0, 2).SetEase(Ease.InExpo))
        .Join(transform.DOScale(Vector3.zero, 2.25f).SetEase(Ease.InOutQuint))
        .AppendCallback(() => Destroy(gameObject));
    }
Exemplo n.º 16
0
    public void StageSelect_Open()
    {
        Sequence seq = DOTween.Sequence();

        // アニメーション追加
        seq.Append(StageSelect_Image.transform.DOScaleY(0.95f, anime_time));

        seq.OnStart(() => {
            // アニメーション開始時によばれる
            //Debug.Log("Animation Start");
        });

        seq.OnUpdate(() => {
            // 対象の値が変更される度によばれる
            //Debug.Log("Animation Update");
        });

        seq.OnComplete(() => {
            //Debug.Log("Animation End");
            seq.Complete();
            // アニメーションが終了時によばれる
        });
    }
Exemplo n.º 17
0
    private void CloseSetting()
    {
        Sequence seq = DOTween.Sequence();

        // アニメーション追加
        seq.Append(closeTransform.DOScaleY(0.0f, _animtime));

        seq.OnStart(() => {
            // アニメーション開始時によばれる
            Debug.Log("Animation Start");
        });

        seq.OnUpdate(() => {
            // 対象の値が変更される度によばれる
            Debug.Log("Animation Update");
        });

        seq.OnComplete(() => {
            Debug.Log("Animation End");
            seq.Complete();
            // アニメーションが終了時によばれる
        });
    }
Exemplo n.º 18
0
        virtual public void Close(Action callback = null)
        {
            if (ScreenRoot == null)
            {
                return;
            }

            Sequence seq = DOTween.Sequence();

            seq.Append
            (
                ScreenRoot.transform.DOScale(Vector3.zero, SCALE_DURATION)
            ).Join(
                ScreenRoot.DOFade(FADE_OUT_VALUE, FADE_DURATION)
                ).OnComplete(() =>
            {
                ScreenRoot.gameObject.SetActive(false);
                if (callback != null)
                {
                    callback();
                }
            });
        }
    public void fault(bool isKeyDown)
    {
        perfectCount = 0;
        foreach (writeShow d in scoreValue.GetComponentsInChildren <writeShow>())
        {
            Destroy(d.gameObject);
        }
        //根据连击数改变颜色
        float h = (120 - 6 * perfectCount) > 0 ? 120 - 6 * perfectCount : 0;
        float s = 5 * perfectCount;
        float v = 50f;

        //scoreText.GetComponent<Text>().color = Color.HSVToRGB(h / 360f, s / 100f, v / 100f);

        //scoreText.GetComponent<Text>().text = (isKeyDown ? "误" : "弃");
        scoreText.Find("evaluate").GetComponent <Image>().sprite = Resources.Load <Sprite>(isKeyDown ? "UI source/premature" : "UI source/miss");
        scoreText.Find("evaluate").GetComponent <Image>().color  = new Color(1, 1, 1, 1);
        transform.position = new Vector3(tmp - GetComponent <RectTransform>().rect.size.x, transform.position.y, transform.position.z);
        Sequence flash = DOTween.Sequence();

        flash.Append(transform.DOMoveX(tmp, 0.1f))
        .Append(GetComponent <CanvasGroup>().DOFade(0f, 0.5f));
    }
Exemplo n.º 20
0
    void GunRotation()
    {
        if (IsActiveShooter)
        {
            foreach (var gun in GunTransform)
            {
                if (gun.isRotation)
                {
                    //float _rate = Mathf.Abs(gun.maxRotation - gun.minRotation) / gun.RotationRate;

                    Vector3 _DefaultAngle = gun.transform_gun.localRotation.eulerAngles;
                    _sequence = DOTween.Sequence();
                    _sequence.Append(gun.transform_gun.DORotate(new Vector3(0, 0, gun.maxRotation), RotationDuration(gun.transform_gun.localRotation.z, gun.maxRotation, gun.RotationRate))
                                     .SetEase(Ease.Linear))
                    .Append(gun.transform_gun.DORotate(new Vector3(0, 0, gun.minRotation), RotationDuration(gun.maxRotation, gun.minRotation, gun.RotationRate))
                            .SetEase(Ease.Linear))
                    .Append(gun.transform_gun.DORotate(_DefaultAngle, RotationDuration(gun.minRotation, _DefaultAngle.z, gun.RotationRate))
                            .SetEase(Ease.Linear));
                    _sequence.SetLoops(-1);
                }
            }
        }
    }
Exemplo n.º 21
0
        /// <summary>Tweens a SpriteRenderer's color using the given gradient
        /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
        /// Also stores the image as the tween's target so it can be used for filtered operations</summary>
        /// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
        public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
        {
            Sequence s = DG.Tweening.DOTween.Sequence();

            GradientColorKey[] colors = gradient.colorKeys;
            int len = colors.Length;

            for (int i = 0; i < len; ++i)
            {
                GradientColorKey c = colors[i];
                if (i == 0 && c.time <= 0)
                {
                    target.color = c.color;
                    continue;
                }
                float colorDuration = i == len - 1
                    ? duration - s.Duration(false) // Verifies that total duration is correct
                    : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
                s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
            }
            s.SetTarget(target);
            return(s);
        }
Exemplo n.º 22
0
    IEnumerator CoroutineIntroduction()
    {
        yield return(new WaitForSeconds(1.0f));

        // イントロダクションを徐々に表示させて、徐々に消滅させるDOTween Sequense
        sequenceImageIntroduction = DOTween.Sequence();
        sequenceImageIntroduction.Append(imageIntroduction.DOColor(new Color(1.0f, 1.0f, 1.0f, 1.0f), 3.0f));
        sequenceImageIntroduction.Append(imageIntroduction.DOColor(new Color(1.0f, 1.0f, 1.0f, 0.0f), 3.0f));

        yield return(new WaitForSeconds(6.0f));

        gameObjectPanelIntroduction.SetActive(false);
        gameObjectPanelTitle.SetActive(true);

        // タイトルを徐々に表示させるDOTween Sequense
        sequenceImageTitle = DOTween.Sequence();
        sequenceImageTitle.Append(imageTitle.DOColor(new Color(1.0f, 1.0f, 1.0f, 1.0f), 4.0f));


        yield return(new WaitForSeconds(4.0f));

        OnFinishIntroduction();
    }
Exemplo n.º 23
0
    public void HideStartScreenSubUI()
    {
        Log.Info("--- Start Sub UI");
        if (startScreenSubUISequence != null && startScreenSubUISequence.IsPlaying()) {
            startScreenSubUISequence.Complete();
        }

        var group = startScreenSubUI.DemandComponent<CanvasGroup>();
        group.interactable = false;

        startScreenSubUISequence = DOTween.Sequence();
        startScreenSubUISequence.Append(DOTween.To(
            () => group.alpha,
            x => group.alpha = x,
            0f,
            0.5f
            ));
        startScreenSubUISequence.OnComplete(() => {
            group.alpha = 0f;
            startScreenSubUI.SetActive(false);
        });
        IsStartScreenSubUIShow = false;
    }
Exemplo n.º 24
0
        public override void Out(Sequence sequence)
        {
            sequence.AppendCallback(() => _target.alpha = _finish);
            sequence.Append(_target.DOFade(_start, _duration).SetEase(_ease));
            sequence.AppendCallback(() =>
            {
                if (Mathf.Approximately(_target.alpha, 1))
                {
                    _target.interactable   = _isInteractableAfter;
                    _target.blocksRaycasts = _blockRaycastAfter;
                }
                else if (Mathf.Approximately(_target.alpha, 0))
                {
                    if (_target.gameObject.activeInHierarchy)
                    {
                        _target.gameObject.SetActive(false);
                    }

                    _target.interactable   = false;
                    _target.blocksRaycasts = false;
                }
            });
        }
Exemplo n.º 25
0
        private IEnumerator Showcoroutine(UserTaskTip data)
        {
            _data = data;

            if (data == null)
            {
                Destroy(gameObject);
                yield break;
            }

            var title       = data.title;
            var description = data.condition_description;

            Title.text       = title;
            Description.text = description;

            if (_tweener != null)
            {
                _tweener.Kill();
                _tweener = null;
            }

            Canvas.ForceUpdateCanvases();

            yield return(null);

            var height = DialogContent.sizeDelta.y;

            DialogContent.anchoredPosition = new Vector2(0, height);
            _tweener = DOTween.Sequence();
            _tweener.Append(DialogContent.DOAnchorPos(Vector2.zero, ShowTime))
            .AppendInterval(StayTime)
            .Append(DialogContent.DOAnchorPos(new Vector2(0, height), HideTime))
            .OnComplete(() => Destroy(gameObject));

            _tweener.Play();
        }
Exemplo n.º 26
0
        protected override void RenderDeal()
        {
            _oknum = 0;
            int count = 0;
            int i     = 0;

            if (_cards.Count == 13)
            {
                i     = 12;
                count = 1;
            }
            else
            {
                i     = _cards.Count - 4;
                count = 4;
            }
            for (; i < _cards.Count; i++)
            {
                Vector3 dst  = CalcPos(i);
                var     card = _cards[i];
                card.Go.transform.localPosition = dst;
                card.Go.transform.localRotation = Quaternion.AngleAxis(90.0f, Vector3.up) * Quaternion.AngleAxis(-115.0f, Vector3.right);
                Tween    t          = card.Go.transform.DOLocalRotateQuaternion(_backv, _dealcarddelta);
                Sequence mySequence = DOTween.Sequence();
                mySequence.Append(t)
                .AppendCallback(() => {
                    _oknum++;
                    if (_oknum >= count)
                    {
                        _oknum = 0;

                        Command cmd = new Command(MyEventCmd.EVENT_TAKEDEAL);
                        _ctx.Enqueue(cmd);
                    }
                });
            }
        }
Exemplo n.º 27
0
        public void Evolve()
        {
            int num     = (int)evolveValue.GetEvolveNum();
            int moveNum = 0;

            foreach (KeyValuePair <int, int> item in PointToMoveIndexConverter)
            {
                if (num > item.Key)
                {
                    moveNum = item.Value;
                    break;
                }
                else
                {
                    moveNum = 1;
                }
            }
            evolveIndex += moveNum;
            if (moveNum < 0)
            {
                moveNum = 0;
            }
            else if (moveNum > wools.Length - 1)
            {
                moveNum = wools.Length - 1;
            }
            Sequence sequence = DOTween.Sequence();

            sequence.Append(testWoolTransform.DOShakeScale(2, 0.6f, 10, 120, false))
            .Join(testWool.DOColor(TRANSARENT, 2))
            .Append(testWoolTransform.DOScale(SMALL, 0.1f))
            .AppendCallback(() => {
                testWool.sprite = wools[evolveIndex];
            })
            .Append(testWoolTransform.DOScale(NORMAL, 0.5f))
            .Join(testWool.DOColor(NORMAL_COLOR, 0.5f));
        }
Exemplo n.º 28
0
    public void ResultStart()
    {
        SoundManager.PlaySound(SoundID.Click);

        Debug.Log("リザルトオン");
        Sequence startSeq = DOTween.Sequence();

        startSeq.Append(
            m_panel_CanvasGroup.DOFade(0.5f, 1f)
            );

        Observable.Timer(TimeSpan.FromMilliseconds(1000))
        .Subscribe(_ => {
            m_typewriters[0].Play(m_texts[0], 30, null);
        })
        .AddTo(this);

        Observable.Timer(TimeSpan.FromMilliseconds(1300))
        .Subscribe(_ => {
            m_typewriters[1].Play(m_texts[1], 30, null);
        })
        .AddTo(this);

        Observable.Timer(TimeSpan.FromMilliseconds(2000))
        .Subscribe(_ => {
            m_typewriters[2].Play(m_texts[2], 3, null);
        })
        .AddTo(this);

        Observable.Timer(TimeSpan.FromMilliseconds(3500))
        .Subscribe(_ => {
            m_typewriters[3].Play(m_texts[3], 30, null);
            TextFlash();
            ready = true;
        })
        .AddTo(this);
    }
Exemplo n.º 29
0
    /// <summary>
    /// 设置星星收集的进度
    /// 30个是满的
    /// </summary>
    public void SetStarProgress(int addCount)
    {
        if (addCount == 0)
        {
            return;
        }
        PlayerDataManager.Instance.playerData.accumulativeStar += addCount;
        PlayerDataManager.Instance.JudeReachAchieve(7, PlayerDataManager.Instance.playerData.accumulativeStar);
        int mOldScore = starCount;
        int newScore  = starCount + addCount;

        starCount += addCount;
        Transform flyObj = Instantiate(fly, starSlider.transform.parent);

        flyObj.transform.localPosition = new Vector3(-195f, -312f, 1f);
        flyObj.localScale = Vector3.one;
        flyObj.DOLocalMove(starSlider.transform.localPosition, 0.5f).OnComplete(() => {
            Sequence mScoreSequence = DOTween.Sequence();
            mScoreSequence.Append(DOTween.To(delegate(float value) {
                var temp      = Mathf.Floor(value);
                starText.text = temp + "";
            }, mOldScore, newScore, 0.4f));
            Prefs.RewardStarCount += addCount;
            if (Prefs.RewardStarCount >= 30)
            {
                starlight.DOFade(1, 0.5f).SetLoops(-1, LoopType.Yoyo);
                starBtn.enabled = true;
            }
            float progress        = (float)Prefs.RewardStarCount / 30f;
            starSlider.fillAmount = progress > 1f ? 1f : progress;
            if (starSlider.fillAmount == 1)
            {
                starBtn.enabled = true;
            }
            Destroy(flyObj.gameObject);
        });
    }
Exemplo n.º 30
0
    void back(int actionNumber)
    {
        MusicManager.instance.PlayMusic();
        if (tween != null)
        {
            tween.SetLoops(0);
            tween.Complete();
            if (tween.target != null)
            {
                ((Transform)tween.target).rotation = Quaternion.identity;
                tween.Kill();
            }
        }
        Sequence mySequence = DOTween.Sequence();

        mySequence.Join(buttons[0].transform.DOScale(Vector3.zero, 0.3f).SetEase(Ease.InOutBack));
        mySequence.Join(buttons[1].transform.DOScale(Vector3.zero, 0.3f).SetEase(Ease.InOutBack));
        mySequence.Append(popup.transform.DOLocalMoveY(-1000, 0.5f).SetEase(Ease.InOutBack));
        mySequence.OnComplete(() => {
            switch (actionNumber)
            {
            case 1:  LoadingManager.scenename = "Main";
                SceneManager.LoadScene("Loading");
                break;

            case 2: gameObject.SetActive(false);
                LoadingManager.scenename = SceneManager.GetActiveScene().name;
                LoadingManager.isRetry   = true;
                SceneManager.LoadScene("Loading");
                break;

            case 3: gameObject.SetActive(false);
                PlayUIManager.instance.ResumeGame();
                break;
            }
        });
    }
Exemplo n.º 31
0
        private void CardPreview(bool isOpen)
        {
            if (isOpen)
            {
                _cardPreview      = Object.Instantiate(_cardPreviewOriginal.gameObject).transform;
                _cardPreview.name = "CardPreview";
                _cardPreview.gameObject.SetLayerRecursively(11);

                Sequence mySequence = DOTween.Sequence();
                mySequence.Append(_cardPreview.DORotate(new Vector3(-20, 30, -20), .2f));
                mySequence.Append(_cardPreview.DORotate(new Vector3(0, 0, 0), .4f));

                Sequence mySequence2 = DOTween.Sequence();
                mySequence2.Append(_cardPreview.DOMove(new Vector3(0, .3f, 5), .4f));
                mySequence2.Append(_cardPreview.DOMove(new Vector3(0, -0.3f, 5), .2f));

                Sequence mySequence3 = DOTween.Sequence();
                mySequence3.Append(_cardPreview.DOScale(new Vector3(1.1f, 1.1f, 1.1f), .4f));
                mySequence3.Append(_cardPreview.DOScale(new Vector3(1f, 1f, 1f), .2f));

                GameClient.Get <ICameraManager>().FadeIn(0.8f, 1);
            }
            else
            {
                GameClient.Get <ICameraManager>().FadeOut(null, 1);

                Sequence sequence = DOTween.Sequence();
                sequence.Append(_cardPreview.DOScale(_cardPreviewOriginal.localScale, .3f));
                sequence.Join(_cardPreview.DOMove(_cardPreviewOriginal.position, .3f));
                sequence.Join(_cardPreview.DORotate(_cardPreviewOriginal.eulerAngles, .3f));
                sequence.OnComplete(
                    () =>
                {
                    Object.Destroy(_cardPreview.gameObject);
                });
            }
        }
Exemplo n.º 32
0
    // 将筹码移动到对应的玩家上
    public void MoveToPlayer(RepeatedField <int> chips, RepeatedField <int> ps, List <GameObject> playerObjs, Func <int, int> GetPlayerPos)
    {
        bool isWinForSelf = false;

        gameObject.GetComponent <Image>().color = new Color(0, 0, 0, 0);
        chipCountObj.SetActive(false);
        for (int i = 0; i < ps.Count; i++)
        {
            if (ps[i] > 0)
            {
                int        chip      = ps[i];
                GameObject playerObj = playerObjs[GetPlayerPos(i)];
                for (int j = 0; j < chipFabs.Count; j++)
                {
                    GameObject chipFab = chipFabs[j];
                    Sequence   s       = DOTween.Sequence();
                    s.AppendInterval(j * 0.1f);
                    s.Append(chipFab.transform.DOMove(playerObj.transform.position, 0.5f));
                    s.AppendCallback(() =>
                    {
                        Destroy(chipFab);
                    });
                }
                if (chipCount - chip > 0)
                {
                    UpdateChips(chipCount - chip);
                }
                playerObj.GetComponent <PlayerControler>().Win(chips[i]);
                if (playerObj.GetComponent <PlayerControler>().PlayerInfo.Id == UserManager.Instance().userInfo.id)
                {
                    isWinForSelf = true;
                }
            }
        }
        // 播放音乐
        AudioUtil.Play(isWinForSelf?AudioUtil.Win: AudioUtil.Lose);
    }
Exemplo n.º 33
0
    public void focusMove(int targetLevel, bool forceMove = false)
    {
        if (active)
        {
            if (currentLevel != targetLevel || forceMove)
            {
                Debug.Log("ENTRAMOS LO PRIMERO " + currentLevel + " / " + targetLevel);
                if (forceMove)
                {
                    //transform.position = levelManager.levelTList[currentLevel].transform.position;
                    transform.DOMove(levelManager.levelTList[currentLevel].targetPoint.transform.position, 2f).SetEase(Ease.Linear);
                }
                else
                {
                    List <Transform> listaPosiciones = MakeRecorrido(targetLevel);
                    Sequence         moveSeq         = DOTween.Sequence();
                    moveFinished = false;
                    GetComponent <Animator>().SetBool("Walking", true);
                    for (int i = 0; i < listaPosiciones.Count; i++)
                    {
                        // Easing
                        Ease  moveEase = Ease.Linear;
                        float moveTime = .5f + listaPosiciones.Count * .25f;

                        moveSeq.Append(transform.DOMove(listaPosiciones[i].position, moveTime).SetEase(moveEase));
                    }
                    moveSeq.Play().OnComplete(() => {
                        Debug.Log("He terminao");
                        moveFinished = true;
                        GetComponent <Animator>().SetBool("Walking", false);
                    });

                    currentLevel = targetLevel;
                }
            }
        }
    }
    private IEnumerator PanelChanger(Tabs tabs)
    {
        PanelActivator();

        RectTransform tempRectTransform = new RectTransform();

        switch (tabs)
        {
        case Tabs.Main:
            tempRectTransform = _rectTransform_MainNavigation;
            break;

        case Tabs.Settings:
            tempRectTransform = _rectTransform_SettingsNavigation;
            break;

        case Tabs.User:
            tempRectTransform = _rectTransform_UserNavigation;
            break;

        default:
            tempRectTransform = new RectTransform();
            break;
        }

        Sequence navigationSequence = DOTween.Sequence();

        navigationSequence.Append(_rectTransform_NavigationParent.DOAnchorPosX(-tempRectTransform.anchoredPosition.x, 0.3f))
        .Append(_rectTransform_NavigationParent.DOAnchorPosY(-tempRectTransform.anchoredPosition.y, 0.3f));


        yield return(navigationSequence.WaitForCompletion());

        _userNavigation.SetActive(tabs == Tabs.User);
        _mainNavigation.SetActive(tabs == Tabs.Main);
        _settingsNavigation.SetActive(tabs == Tabs.Settings);
    }
Exemplo n.º 35
0
 // 发手牌
 public void DealHandCard(RepeatedField <CardInfo> cardInfos, string cardType)
 {
     // 设置是第一回合
     mButtonControler.SetIsRoundOne(true);
     waitting.SetActive(false);
     if (handcards.Count <= 0)
     {
         InitHandCard(cardInfos);
     }
     for (int i = 0; i < handcards.Count; i++)
     {
         GameObject hc   = handcards[i];
         GameObject card = hc.GetComponent <CardControler>().player.GetComponent <PlayerControler>().GetCardObject;
         Sequence   s    = DOTween.Sequence();
         s.Append(hc.transform.DOMove(card.transform.position, 0.2f));
         s.PrependInterval(i * 0.1f);
         if (i == handcards.Count - 1)
         {
             s.AppendCallback(() =>
             {
                 deck.SetActive(false);
                 // 旋转手牌
                 foreach (GameObject player in playerObjs)
                 {
                     if (selfInfo.Pos > 0)
                     {
                         player.GetComponent <PlayerControler>().SeeCard("player" + (maxCount / 2));
                     }
                     else
                     {
                         player.GetComponent <PlayerControler>().SeeCard("player");
                     }
                 }
             });
         }
     }
 }
Exemplo n.º 36
0
    private void Start()
    {
        Text t = _textGO.GetComponent <Text>();

        _points *= -1;
        if (_points > 0)
        {
            t.color = Color.green;
            t.text  = "+";
        }
        else
        {
            t.color = _textColor;
            t.text  = "";
        }
        t.text += _points.ToString();

        Vector3 randVect = Vector3.zero;

        if (_maxRandom != 0)
        {
            randVect = new Vector3(
                UnityEngine.Random.Range(-_maxRandom, _maxRandom),
                UnityEngine.Random.Range(-_maxRandom, _maxRandom),
                UnityEngine.Random.Range(-_maxRandom, _maxRandom));
        }
        transform.localPosition = CanvasManager.Instance.WorldToCanvas(_targetTrans.position + Offset + randVect);

        Sequence seq = DOTween.Sequence();

        seq.Append(_textGO.transform.DOLocalMoveY(_translateY, _sequenceTime))
        .Join(t.DOFade(0f, seq.Duration()))
        .OnComplete(() =>
        {
            Destroy(gameObject);
        });
    }
Exemplo n.º 37
0
    public void TriggerMessy(Collider2D collider, bool isCut)
    {
        if (!collider)
        {
            return;
        }
        RectTransform messy = collider.GetComponent <RectTransform>();

        if (true == isCut && false == _toolScissors.GetColliderTriggerState(collider))
        {
            _toolScissors.SetColliderTriggerState(collider, true);
            _toolGrower.SetColliderTriggerState(collider, false);
            collider.enabled = false;
            Vector2    pos      = messy.anchoredPosition;
            Quaternion rotate   = messy.localRotation;
            Sequence   sequence = DOTween.Sequence();
            sequence.Append(messy.DOAnchorPosY(pos.y - 500, 1.2f).SetEase(Ease.Linear));
            sequence.Join(messy.DOLocalRotate(new Vector3(0, 0, 100), 1.2f, RotateMode.Fast));
            sequence.OnComplete(() =>
            {
                messy.GetComponent <Image>().enabled = false;
                messy.localRotation    = rotate;
                messy.anchoredPosition = pos;
            });
        }
        else if (false == isCut && false == _toolGrower.GetColliderTriggerState(collider))
        {
            _toolScissors.SetColliderTriggerState(collider, false);
            _toolGrower.SetColliderTriggerState(collider, true);
            collider.enabled = false;
            Image image = messy.GetComponent <Image>();
            image.enabled = true;
            Color color = image.color;
            image.color = new Color(color.r, color.g, color.b, 0f);
            image.DOFade(1f, 0.3f).SetEase(Ease.Linear);
        }
    }
Exemplo n.º 38
0
    private IEnumerator DelayCreateCompCards()
    {
        yield return(new WaitForSeconds(0.1f));

        Dictionary <int, GameObject> dicInvisbileCards = GetRemainInvisibleCards();

        if (dicInvisbileCards != null && dicInvisbileCards.Count > 0)
        {
            CardCompare cardCompare = new CardCompare();
            List <int>  keys        = dicInvisbileCards.Keys.ToList();
            keys.Sort(cardCompare);
            foreach (int key in keys)
            {
                GameObject gObj = null;
                if (!dicInvisbileCards.TryGetValue(key, out gObj))
                {
                    continue;
                }
                Sequence seq      = Util.PlayRotation(gObj, 0.1f);
                Vector3  compCard = ComputerCardManager.GetInstance().GetPosCompCard();
                seq.Append(gObj.transform.DOMove(compCard, 0.3f));
                seq.OnComplete(() =>
                {
                    gObj.SetActive(false);
                    if (SoundManager.getInstance())
                    {
                        SoundManager.getInstance().PlaySound(SoundId.FLY);
                    }
                    if (ComputerCardManager.GetInstance() != null)
                    {
                        ComputerCardManager.GetInstance().OnCreateComCard(key);
                    }
                });
                yield return(new WaitForSeconds(0.5f));
            }
        }
    }
 public void InitSequence()
 {
     if (FloorList.Count == 0)
     {
         Debug.LogError("Floor count is 0:" + transform.name);
     }
     else if (IsAllNull())
     {
         Debug.LogError("Floor is All null:" + transform.name);
     }
     else
     {
         Debug.Log("InitSequence");
         FloorSequnce = DOTween.Sequence();
         for (int i = 0; i < FloorList.Count; i++)
         {
             var floor = FloorList[i];
             if (floor == null)
             {
                 continue;
             }
             Transform trans = floor.transform;
             float     YTemp = trans.localPosition.y + i * OffsetPerFloor;
             Tween     t     = floor.transform.DOLocalMoveY(YTemp, TweenTime);
             if (i == 0)
             {
                 FloorSequnce.Append(t);
             }
             else
             {
                 FloorSequnce.Join(t);
             }
         }
         FloorSequnce.SetAutoKill(false);
         FloorSequnce.Pause();
     }
 }
Exemplo n.º 40
0
    void NewSequence(LoopType loopType, bool flip)
    {
    	main.Rewind();
    	main.Kill();

    	Sequence innerS0 = DOTween.Sequence()
            .SetId("INNER")
            // .SetLoops(3, loopType)
            .OnStepComplete(()=>Debug.Log("INNER Step Complete"));
            // .Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        // innerS0.InsertCallback(0.25f, ()=> Callback("INNER"));

        Sequence innerS1 = DOTween.Sequence()
            .SetId("INNER INNER")
            // .SetLoops(3, loopType)
            .OnStepComplete(()=> Debug.Log("INNER INNER Step Complete"));
		innerS1.Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        innerS1.InsertCallback(0.25f, ()=> Callback("INNER INNER"));
        innerS0.Append(innerS1);
        innerS0.InsertCallback(0.25f, ()=> Callback("INNER"));

        main = DOTween.Sequence()
            .SetId("MAIN")
            .SetLoops(3, loopType)
            .SetAutoKill(false)
            .OnStepComplete(()=> Debug.Log("MAIN Step Complete"));
            // .Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        main.Append(innerS0);
        main.InsertCallback(0.25f, ()=> Callback("MAIN"));

        if (flip) {
        	main.Complete();
        	main.Flip();
        	main.PlayBackwards();
        }
    }
Exemplo n.º 41
0
    // Use this for initialization
    //開始時点ですべて設定する
    void Start()
    {
        //子テキストにアニメーション設定
        gameText = transform.FindChild("GameTextImage").GetComponent<Image>();
        startText = transform.FindChild("StartTextImage").GetComponent<Image>();

        sec = DOTween.Sequence();
        //所定の位置

        gameObject.transform.position = transform.parent.position;

        gameText.transform.localPosition = new Vector3(-outScreen + textWMargin, textHMargin, 0.0f);
        startText.transform.localPosition = new Vector3(-outScreen - textWMargin, -textHMargin, 0.0f);

        sec.Prepend(gameText.transform.DOLocalMoveX(-outScreen + textWMargin + 0.01f, 0.8f));
        //中心へ入ってくる

        sec.Append(gameText.transform.DOLocalMoveX(-textWMargin - textCenterWidth, tweenDuration / 4.0f));
        sec.Append(startText.transform.DOLocalMoveX(textWMargin - textCenterWidth, tweenDuration / 2.0f));

        //中心でちょっと待機する
        sec.Join(gameText.transform.DOLocalMoveX(-textWMargin + textCenterWidth, tweenDuration / 2.0f));
        sec.Append(startText.transform.DOLocalMoveX(textWMargin + textCenterWidth, tweenDuration / 4.0f));

        //画面外へ移動する
        sec.Join(gameText.transform.DOLocalMoveX(outScreen + textWMargin, tweenDuration / 4.0f));
        sec.Append(startText.transform.DOLocalMoveX(outScreen - textWMargin, tweenDuration / 4.0f)
            .OnComplete( () => {
                GameScene gameScene = transform.root.gameObject.GetComponent<AppliController>().GetCurrentScene().GetComponent<GameScene>();
                gameScene.gameController.nodeController.SetSlideAll(false); //ノードを操作可能状態に
                gameScene.gameUI.gameInfoCanvas.limitTime.eventRatio = 1.0f;    //時間が減るように
                Destroy(this.gameObject);
            }));

        sec.Play();
        /*        gameObject.transform.position = new Vector3( 0.0f,150.0f -textHMargin,0.0f);
                Vector3 vPos = new Vector3(-outScreen - textWMargin, -textHMargin, 0.0f);
                gameText.transform.DOLocalMoveX(-outScreen - textWMargin,tweenDuration / 4.0f).OnComplete(() =>
                {
                gameText.transform.localPosition = vPos;
                gameText.transform.DOLocalMoveX( - textWMargin - textCenterWidth, tweenDuration / 4.0f).SetEase(Ease.OutQuad)
                    .OnComplete(() => {
                        gameText.transform.DOLocalMoveX(-textWMargin + textCenterWidth, tweenDuration / 2.0f).SetEase(Ease.Linear)
                            .OnComplete(() =>
                            {
                                gameText.transform.DOLocalMoveX(outScreen - textWMargin, tweenDuration / 4.0f).SetEase(Ease.OutQuad)
                                    .OnComplete(() => {
                                        GameScene gameScene = transform.root.gameObject.GetComponent<AppliController>().GetCurrentScene().GetComponent<GameScene>();
                                        gameScene.gameController.nodeController.SetSlideAll(false); //ノードを操作可能状態に
                                        gameScene.gameUI.gameInfoCanvas.limitTime.eventRatio = 1.0f;    //時間が減るように
                                        Destroy(this.gameObject);
                                    });
                            });
                    });
                });
                vPos = new Vector3(-outScreen + textWMargin, +textHMargin, 0.0f);
                startText.transform.position = new Vector3(0.0f,150.0f + textHMargin,0.0f);
                startText.transform.localPosition = vPos;

                startText.transform.DOLocalMoveX(+textWMargin - textCenterWidth, tweenDuration / 4.0f).SetEase(Ease.OutQuad)
                    .OnComplete(() =>
                    {
                        startText.transform.DOLocalMoveX(textWMargin + textCenterWidth, tweenDuration / 2.0f).SetEase(Ease.Linear)
                            .OnComplete(() =>
                            {
                                startText.transform.DOLocalMoveX(outScreen + textWMargin, tweenDuration / 4.0f).SetEase(Ease.OutQuad);
                            });
                    });
        */
    }
Exemplo n.º 42
0
 public static void animScaleSeqAppend(ref Sequence seq, GameObject obj, float duration, Ease easeType, Vector3 animTo, float delay)
 {
     seq.Append(
         DOTween.To(()=> obj.transform.localScale, x=> obj.transform.localScale = x, animTo, duration).SetEase(easeType).SetUpdate(false).SetDelay(delay)
                );
 }
Exemplo n.º 43
0
    public void ShowGameplayScreenSubUI()
    {
        Log.Info("+++ Gameplay Sub UI");
        if (gameplayScreenSubUISequence != null && gameplayScreenSubUISequence.IsPlaying()) {
            gameplayScreenSubUISequence.Complete();
        }

        var group = gameplayScreenSubUI.DemandComponent<CanvasGroup>();
        group.interactable = true;

        gameplayScreenSubUISequence = DOTween.Sequence();
        gameplayScreenSubUISequence.Append(DOTween.To(
            () => group.alpha,
            x => group.alpha = x,
            1f,
            2f
        ));

        gameplayScreenSubUI.SetActive(true);
        IsGameplayScreenSubUIShow = true;
    }
Exemplo n.º 44
0
Arquivo: Move.cs Projeto: harjup/Xyz
    public void ShakeCamera()
    {
        if (_currentSequence != null && _currentSequence.IsPlaying())
        {
            _currentSequence.Complete();
        }

        _currentSequence = DOTween.Sequence();

        _currentSequence
            .Append(_camera.DOShakePosition(.25f))
            .OnComplete(() => { _cameraMove.ResetPosition(); })
            .Play();
    }