Exemple #1
0
 public void CompleteTween()
 {
     if (DOTween.instance != null)
     {
         DOTween.CompleteAll();
     }
 }
    public void OnClickHandle()
    {
        if (isMoveing)
        {
            return;
        }
        if (DOTween.TotalPlayingTweens() > 0)
        {
            DOTween.CompleteAll();
            DOTween.KillAll();
            return;
        }

        qy.config.StoryItem story = curDialogue.next;
        if (story != null)
        {
            ShowStory(story);
        }
        else
        {
            qy.config.QuestItem nextQuest = qy.GameMainManager.Instance.playerData.GetQuest();
            if (nextQuest.type == qy.config.QuestItem.QuestType.Ending)
            {
                qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UIEndingWindow, nextQuest);
            }
            else
            {
                qy.GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UITaskWindow, qy.GameMainManager.Instance.playerData);
            }
            qy.GameMainManager.Instance.weatherManager.StopAll();
            OnClickClose();
        }
    }
 void OnGUI()
 {
     if (GUILayout.Button("TogglePause"))
     {
         DOTween.TogglePauseAll();
     }
     if (GUILayout.Button("Restart"))
     {
         DOTween.RestartAll();
     }
     if (GUILayout.Button("Complete"))
     {
         DOTween.CompleteAll();
     }
     if (GUILayout.Button("Rewind"))
     {
         DOTween.RewindAll();
     }
     if (GUILayout.Button("Flip"))
     {
         DOTween.FlipAll();
     }
     if (GUILayout.Button("Kill And Complete"))
     {
         DOTween.KillAll(true);
     }
 }
Exemple #4
0
 public void Die()
 {
     animator.SetBool("Dead", true);
     GameManagerBase.Instance.Context.AddToInt("Lives", -1);
     DOTween.CompleteAll();
     rigidbody.velocity = Vector3.zero;
 }
    private void MonitorSwiping()
    {
        //check for screen swiping and update camera accordingly
        if (Input.touchCount > 0)
        {
            Touch touch = Input.GetTouch(0);

            Vector3 target = movingPanel.transform.localPosition;
            switch (touch.phase)
            {
            case TouchPhase.Began:
                startPos  = touch.position;
                lastPos   = touch.position;
                startTime = Time.time;
                break;

            case TouchPhase.Moved:
                //detect whether the finger initially moves far enough to count as a swipe movement
                if (Mathf.Abs(touch.position.y - startPos.y) > swipeThreshold)
                {
                    isAVerticalSwipe = true;
                }

                if (isAVerticalSwipe)
                {
                    float changeInY = touch.position.y - lastPos.y;
                    target.y += ((changeInY / Screen.height) * (worldGap * 1.5f));
                    if (target.y <= 0 && target.y >= -1 * (worldGap * LevelDataManager.manager.GetNumberOfWorlds()))
                    {
                        DOTween.CompleteAll();
                        movingPanel.transform.DOLocalMove(target, Time.deltaTime).Play();
                    }
                }

                lastPos = touch.position;
                break;

            case TouchPhase.Ended:
                if (isAVerticalSwipe)
                {
                    swipeSpeed = (((startPos.y - touch.position.y) / Screen.height) * (worldGap)) / (Time.time - startTime);
                    target.y  -= (swipeSpeed * 0.3f);
                    //Debug.Log (background.transform.localPosition + ", " + target);
                    //background.transform.DOLocalMove(target, 0.3f).Play ().OnKill (MoveScreenToWorld);
                    if (target.y <= 0 && target.y >= -1 * (worldGap * LevelDataManager.manager.GetNumberOfWorlds()))
                    {
                        CheckForClosestWorld(target.y);
                    }
                    MoveScreenToWorld(0);
                    isAVerticalSwipe = false;
                }
                break;
            }

            if (isAVerticalSwipe)
            {
                CheckForClosestWorldToCurrentPosition();
            }
        }
    }
Exemple #6
0
 // chest button function
 public void ChestButtonPressed(string upgrade)
 {
     if (upgrade == "ADD HEALTH")
     {
         _playerManager.AddLife(1);
     }
     else if (upgrade == "ADD JUMP")
     {
         _playerManager.AddJump();
     }
     else if (upgrade == "ADD SPEED")
     {
         _playerManager.AddSpeed();
     }
     else if (upgrade == "ADD ATTACK")
     {
         _playerManager.AddAttack();
     }
     DOTween.CompleteAll();
     Cursor.visible   = false;
     Cursor.lockState = CursorLockMode.Locked;
     _playerManager.EnableLookAndMovement(true);
     ActivatePanel(mainPanel);
     StartCoroutine(_currentInteractiveChest.CloseChest());
 }
    public void HideInfoFrame()
    {
        DOTween.CompleteAll();
        // isShowing = false;
        navigationManager.StopNavigation();
        navigationManager.StopHighlightFloor();

        // hideInfoSequence.Restart();
    }
Exemple #8
0
        public override void OnEnter()
        {
            int numberOfTweensCompleted = DOTween.CompleteAll(withCallbacks.Value);

            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Complete All - Completed " + numberOfTweensCompleted + " tweens");
            }
            Finish();
        }
Exemple #9
0
    IEnumerator Unpause()
    {
        DOTween.CompleteAll();
        DOTween.To(() => Time.timeScale, x => Time.timeScale = x, 1f, 0.25f).SetEase(Ease.OutCubic).SetUpdate(true);
        relicShowcase.GetComponent <CanvasGroup>().DOFade(0f, 0.25f).SetEase(Ease.OutCubic).SetUpdate(true);
        paused = false;
        yield return(new WaitForSeconds(0.1f));

        relicShowcase.SetActive(false);
    }
 private void PlayMotion()
 {
     DOTween.CompleteAll();
     WipeSubtitles();
     WipeLine();
     WipeRulers();
     WipeBG();
     Pivot.rotation = Quaternion.Euler(Rot.StartRotation);
     Pivot.DORotate(Rot.EndRotation, Rot.Duration).SetEase(Rot.EaseType);
 }
Exemple #11
0
 public void ResetPosition()
 {
     DOTween.CompleteAll();
     currLane = 0;
     rigidbody.DOMoveX(0, 0.5f, false);
     animator.SetBool("Dead", false);
     transform.localPosition = Vector3.zero;
     transform.localRotation = Quaternion.identity;
     rigidbody.velocity      = Vector3.zero;
 }
 public void PlayLevel(int levelID)
 {
     MainMenuController.controller.BlockBackButton();
     LevelManager.manager.SetCurrentLevel(currentLevel.GetLevelID());
     DOTween.CompleteAll();
     GameObject.FindObjectOfType <LevelLaunchSequence> ().PlayLevel();
     menuCameraController.shouldMonitorVerticalSwiping   = false;
     menuCameraController.shouldMonitorHorizontalSwiping = false;
     menuCameraController.transform.DOLocalRotate(currentScreen.transform.localEulerAngles + new Vector3(36, 0, 0), 1).Play();
 }
Exemple #13
0
 public void StartGame()
 {
     TurnOffAllScreens();
     if (currentScreen.screenType == ScreenType.EndGame)
     {
         DOTween.CompleteAll();
     }
     currentScreen = screenElements.Find(element => element.screenType == ScreenType.InGame);
     ActivateAllConnectedUI(currentScreen);
 }
        public override void OnEnter()
        {
            int numberOfTweensCompleted = DOTween.CompleteAll(withCallbacks.Value);

            if (debugThis.Value)
            {
                Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "]  State [" + State.Name + "] - DOTween Control Methods Complete All - SUCCESS! - Completed " + numberOfTweensCompleted + " tweens");
            }

            Finish();
        }
Exemple #15
0
    public static void QuestionAnimation(CanvasGroup front, CanvasGroup back)
    {
        DOTween.CompleteAll();
        var sequence = DOTween.Sequence();

        sequence.Append(front.DOFade(0f, AnimationSpeedDefault));
        sequence.Append(back.DOFade(1f, AnimationSpeedDefault));
        sequence.AppendInterval(5f);
        sequence.Append(back.DOFade(0f, AnimationSpeedDefault));
        sequence.Append(front.DOFade(1f, AnimationSpeedDefault));
        sequence.Play();
    }
Exemple #16
0
 public virtual void Play(bool IsForward)
 {
     DOTween.CompleteAll();
     if (IsForward)
     {
         Invoke("PlayForwardDelay", delay);
     }
     else
     {
         Invoke("PlayReverseDelay", delay);
     }
 }
    private void OnDown()
    {
        if (!wheelActive)
        {
            return;
        }

        // Set velocity to zero.
        dx = 0f;

        // Complete active tweens for the transform.
        backgroundMat.DOComplete();
        DOTween.CompleteAll();
    }
Exemple #18
0
 private void EndFreeze()
 {
     DOTween.CompleteAll();
     DOTween.To(() => vol.weight, x => vol.weight               = x, 0f, 1.5f).SetUpdate(true);
     DOTween.To(() => Time.timeScale, x => Time.timeScale       = x, 1f, 1.5f).SetUpdate(true);
     uiText.ForEach(t => DOTween.To(() => t.alpha, x => t.alpha = x, 0f, 1.5f).SetUpdate(true));
     uiSprite.ForEach(t => t.DOFade(0f, 1.5f).SetUpdate(true));
     vid.DOFade(0f, 1.5f).SetUpdate(true);
     vid.GetComponent <VideoPlayer>().Stop();
     timeSlowed  = false;
     invulnTimer = invulnTime;
     flashingCor = StartCoroutine(FlashInvuln());
     GetComponent <Collider>().enabled = false;
 }
 /// <summary>
 /// 可供隐藏显示效果使用。
 /// </summary>
 /// <param name="delay"></param>
 public void Hide(float delay)
 {
     //	Debug.Log ("hide"+gameObject.name);
     DOTween.CompleteAll();
     if (isEffectEnable)
     {
         int num = hide.Length;
         for (int i = 0; i < num; ++i)
         {
             hide[i].delay = delay;
             TweenPlay(hide[i]);
         }
     }
 }
Exemple #20
0
    public void GoBack(GameObject to)
    {
        // clear all tweens
        DOTween.CompleteAll();

        // reset position
        to.GetComponent <RectTransform>().anchoredPosition = new Vector2(0f, 0f);

        // set enabled
        TogglePanels(gameObject, to);

        // show/hide
        ShowPanel(gameObject, false);
        ShowPanel(to, true);
    }
    IEnumerator Start()
    {
        DOTween.Init(true);

        for (int i = 0; i < 100; ++i)
        {
            GameObject go = Instantiate(prefab);
            go.transform.DOMoveX(2, 4);
        }

        yield return(new WaitForSeconds(2));

        Debug.Log("Complete all");
        DOTween.CompleteAll();
    }
Exemple #22
0
    public static void SwitchFromTo(CanvasGroup fromCG, CanvasGroup toCG)
    {
        DOTween.CompleteAll();

        var switching = DOTween.Sequence();

        switching.Append(fromCG.DOFade(0f, AnimationSpeedDefault / 2));
        switching.Append(toCG.DOFade(1f, AnimationSpeedDefault / 2));

        switching.OnStart(() =>
        {
            fromCG.blocksRaycasts = false;
            toCG.blocksRaycasts   = true;
        });

        switching.Play();
    }
    /// <summary>
    /// 设置选中状态或者点击去掉选中
    /// </summary>
    public void SetSelected()
    {
        DOTween.CompleteAll();
        if (isEffectEnable)
        {
            if (useClickRestore)
            {
                if (!isSelected)
                { //选中
                  //			Debug.Log ("setselected "+gameObject.name);
                    int num = selected.Length;
                    for (int i = 0; i < num; ++i)
                    {
                        TweenPlay(selected[i]);
                    }
                }
                else
                {//取消选中
                 //			Debug.Log ("set反选 "+gameObject.name);

                    int num = pressOver.Length;
                    for (int i = 0; i < num; ++i)
                    {
                        TweenPlay(pressOver[i]);
                    }
                }
                isSelected = !isSelected;
            }
            else
            {
                if (isSelected)
                {
                    return;
                }
                //	Debug.Log ("setSelwect "+gameObject.name);

                isSelected = true;
                int num = selected.Length;
                for (int i = 0; i < num; ++i)
                {
                    TweenPlay(selected[i]);
                }
            }
        }
    }
Exemple #24
0
    public IEnumerator ShuffleCards()
    {
        yield return(new WaitForSeconds(1f));

        isAnimating = true;
        DOTween.CompleteAll();
        List <Vector3> positions = new List <Vector3>(cardPositions.ToArray());
        List <Card>    tempCards = new List <Card>(cards.ToArray());
        int            rand      = 0;

        foreach (Card c in tempCards)
        {
            rand = UnityEngine.Random.Range(0, positions.Count);
            c.rTransform.localPosition = positions[rand];
            positions.Remove(positions[rand]);
        }
        isAnimating = false;
    }
Exemple #25
0
    public void undoAction()
    {
        AudioPlayer.Stop();
        StopAllCoroutines();
        AudioPlayer.PlayClip(AudioPlayer.AudioClipEnum.CLICK);
        DOTween.CompleteAll(true);
        Dictionary <int, float> times = new Dictionary <int, float>();

        foreach (Player p in PlayerList.Players)
        {
            times[p.Position] = p.ActingTime;
        }
        Timeline.theTimeline.undo();
        foreach (var kvp in times)
        {
            PlayerList.playerAtPosition(kvp.Key).ActingTime = kvp.Value;
        }
    }
Exemple #26
0
        //		IEnumerator CheckSidesForCollision (float seconds)
        //		{
        //				yield return new WaitForSeconds (seconds);
        //				Debug.Log ("Checking for dice sides");
        //				if (rigidbody.velocity.magnitude == 0) {
        //						if (touchingSide == null) {
        //								StopAllCoroutines ();
        //								StartCoroutine (CheckSidesForCollision (7f));
        //						}
        //				} else {
        //						StopAllCoroutines ();
        //						StartCoroutine (CheckSidesForCollision (5f));
        //				}
        //		}

        //		IEnumerator CheckSidesForCollision (float seconds)
        //		{
        //				yield return new WaitForSeconds (seconds);
        //				if (rigidbody.velocity.magnitude == 0) {
        //						if (touchingSide != null && Vector3.Dot (touchingSide.transform.forward, floor.up) <= -.99f)
        //								foreach (DiceSide side in sides) {
        //										if (Vector3.Dot (side.transform.forward, floor.up) >= .99f)
        //												upSide = side;
        //								}
        //						else {
        //								//Debug.Log (Vector3.Dot (touchingSide.transform.forward, floor.transform.up));
        //								ShootUp ();
        //								touchingSide = null;
        //								StopCoroutine (CheckSidesForCollision (7f));
        //								StartCoroutine (CheckSidesForCollision (7f));
        //						}
        //				}
        //		}

        public void Roll()
        {
            if (isDead)
            {
                return;
            }

            DOTween.CompleteAll();

            transform.position     = startingPosition;
            touchingSide           = null;
            upSide                 = null;
            collisionCheck.enabled = true;
            GetComponent <RandomRotation>().enabled = true;
            //				touchingSide = null;
            //				upSide = null;
            //				StopCoroutine (CheckSidesForCollision (7f));
            //				StartCoroutine (CheckSidesForCollision (7f));
        }
Exemple #27
0
 void SettingsOut()
 {
     DOTween.CompleteAll();
     foreach (var item in topItems)
     {
         item.transform.DOMoveX(item.transform.position.x - 30, 4.0f);
     }
     foreach (var item in bottomItems)
     {
         item.transform.DOMoveX(item.transform.position.x - 30, 4.0f);
     }
     foreach (var item in aliens)
     {
         item.transform.DOMoveX(item.transform.position.x - 30, 4.0f);
     }
     foreach (var item in settings)
     {
         item.transform.DOMoveX(item.transform.position.x - 30, 4.0f);
     }
 }
Exemple #28
0
    void PrepareGame()
    {
        if (DOTween.instance != null)
        {
            DOTween.CompleteAll();
        }

        StopAllCoroutines();

        pauseButtonObj.SetActive(true);
        CleanHandCard();
        CleanFieldCard();

        limitTime = timeCount;

        madeNum       = 0;
        noCorrectTime = 0;

        MoveToGame();
    }
Exemple #29
0
    public void PlayMotion()
    {
        DOTween.CompleteAll();
        CameraPivot.rotation = Quaternion.Euler(StartRotation);
        CameraPivot.DORotate(EndRotation, RotationTime).SetEase(CameraRotEase);
        Camera.main.DOFieldOfView(1f, RotationTime).From().SetEase(CameraRotEase);

        var mySeq = DOTween.Sequence();

        // Starts fully transparent
        foreach (TextWipeData subtitle in Subtitles)
        {
            subtitle.UIText.text  = subtitle.FinalText;
            subtitle.UIText.color = new Color(subtitle.FinalColor.r,
                                              subtitle.FinalColor.g, subtitle.FinalColor.b, 0f);
            SeqInsert(ref mySeq, subtitle);
        }

        SetSlicesFill(mySeq);
    }
    public void ShowInfoFrame()
    {
        DOTween.CompleteAll();
        // UIManager.HideAllRoomInfo();

        // isShowing = true;


        // //turn off icon
        // iconFrame.gameObject.SetActive(false);

        // // turn on info
        // frame.gameObject.SetActive(true);
        // transform.SetAsLastSibling();

        // showInfoSequence.Restart();

        navigationManager.ShowNavigation(roomID);
        navigationManager.ShowHighlightFloor(roomID, iconColor);
    }