예제 #1
0
        private void ArrowIndicate(IndicateDirection indicateDirection)
        {
            LeanTween.cancel(arrowImage.gameObject);
            LTDescr ltDescr;

            switch (indicateDirection)
            {
            case IndicateDirection.Up:
                ltDescr = LeanTween.moveLocalY(arrowImage.gameObject, -15, 0.5f);
                break;

            case IndicateDirection.Down:
                ltDescr = LeanTween.moveLocalY(arrowImage.gameObject, 15, 0.5f);
                break;

            case IndicateDirection.Left:
                ltDescr = LeanTween.moveLocalX(arrowImage.gameObject, 15, 0.5f);
                break;

            case IndicateDirection.Right:
                ltDescr = LeanTween.moveLocalX(arrowImage.gameObject, -15, 0.5f);
                break;

            default:
                return;
            }
            ltDescr.setIgnoreTimeScale(true);
            ltDescr.setLoopPingPong();
        }
예제 #2
0
        private void HandIndicate(IndicateDirection indicateDirection)
        {
            LeanTween.cancel(handImage.gameObject);
            LTDescr ltDescr;

            switch (indicateDirection)
            {
            case IndicateDirection.UpLeft:
            case IndicateDirection.UpRight:
                ltDescr = LeanTween.moveLocalY(handImage.gameObject, -15, 0.5f);
                ltDescr.setIgnoreTimeScale(true);
                ltDescr.setLoopPingPong();
                break;

            case IndicateDirection.DownLeft:
            case IndicateDirection.DownRight:
                ltDescr = LeanTween.moveLocalY(handImage.gameObject, 15, 0.5f);
                ltDescr.setIgnoreTimeScale(true);
                ltDescr.setLoopPingPong();
                break;

            default:
                break;
            }
        }
예제 #3
0
        private void StartIndicate()
        {
            SetTargetTransform();
            if (_tutorialStepData.showHandIndicator)
            {
                highlightGlowParticleSystem.Stop();
                highlightGlowParticleSystem.Play();

                IndicateDirection indicateDirection = (IndicateDirection)Enum.Parse(typeof(IndicateDirection), _tutorialStepData.handIndicateDirection);
                switch (indicateDirection)
                {
                case IndicateDirection.UpLeft:
                    handImage.transform.localScale = new Vector3(1, -1, 1);
                    break;

                case IndicateDirection.UpRight:
                    handImage.transform.localScale = new Vector3(-1, -1, 1);
                    break;

                case IndicateDirection.DownLeft:
                    handImage.transform.localScale = Vector3.one;
                    break;

                case IndicateDirection.DownRight:
                    handImage.transform.localScale = new Vector3(-1, 1, 1);
                    break;

                default:
                    break;
                }
                _handIndicateUITransform = UIMgr.instance.GetParticularUITransform(_tutorialStepData.handIndicateUIPath[0], _tutorialStepData.handIndicateUIPath[1]);
                handRoot.position        = new Vector3(_handIndicateUITransform.position.x, _handIndicateUITransform.position.y, handRoot.position.z);
                handRoot.localPosition  += _handRootOffset;
                HandIndicate(indicateDirection);
            }
            if (_tutorialStepData.showArrowIndicator)
            {
                IndicateDirection indicateDirection = (IndicateDirection)Enum.Parse(typeof(IndicateDirection), _tutorialStepData.arrowIndicateDirection);
                arrowImage.transform.localRotation = GetArrowLocalRotationByIndicateDirection(indicateDirection);
                _arrowIndicateUITransform          = UIMgr.instance.GetParticularUITransform(_tutorialStepData.arrowIndicateUIPath[0], _tutorialStepData.arrowIndicateUIPath[1]);
                arrowRoot.position       = new Vector3(_arrowIndicateUITransform.position.x, _arrowIndicateUITransform.position.y, arrowRoot.position.z);
                arrowRoot.localPosition += _arrowRootOffset;
                ArrowIndicate(indicateDirection);
            }
            handRoot.gameObject.SetActive(_tutorialStepData.showHandIndicator);
            arrowRoot.gameObject.SetActive(_tutorialStepData.showArrowIndicator);
        }
예제 #4
0
        private Quaternion GetArrowLocalRotationByIndicateDirection(IndicateDirection indicateDirection)
        {
            switch (indicateDirection)
            {
            case IndicateDirection.Up:
                return(Quaternion.Euler(new Vector3(0, 0, 90)));

            case IndicateDirection.Down:
                return(Quaternion.Euler(new Vector3(0, 0, 270)));

            case IndicateDirection.Left:
                return(Quaternion.Euler(Vector3.zero));

            case IndicateDirection.Right:
                return(Quaternion.Euler(new Vector3(0, 0, 180)));

            default:
                return(Quaternion.Euler(Vector3.zero));
            }
        }