Game Client Lee Hwanguk 2023. 5. 29. 03:37

# UI에 들어가는 Text 들을 전체적으로 수정중이다

이전 Text들은 size들도 제각각이고 눈에 잘 들어오지않으며 해상도 대응도 엉망이었다.

유니티 안에 시뮬레이터로 테스트를 해가며 가장 잘 보여지는 size와 font 를 정하고 변경했다.

 

#마을 상점 Text 변경

#던전 상점 소모 아이템 Tab Text변경

#Dice Text 변경

=> 좀 더 선명하고 눈에 잘들어온다 진작 변경할껄 싶다...

 

#Dice 연출 변경

만들어 놓은 연출이 효과가 너무 약하다는 느낌이 강하게 들었다.

그리고 연출이 보여지는 중 Go 버튼을 누르면 연출이 진행 중 주사위가 돌아가는 버그와

연출이 끊기지 않아 다른 방으로 넘어가도 맵에 연출이나오는 버그도 있었다.

 

Dice를 랜더링하고있는 DiceCam 에서 파티클을 랜더링하고있었는데 그렇게 하다보니 파티클이 Frame 안에서만 보여지고 연출이 약해지는 느낌이 있었다. 

파티클을 MainCam 에서 랜더링하게 만들어주고 MainCam에서 파티클이 생성되는 위치도 미리 정해주었다


버그들을 고치기 위해 로직들을 바꿨다. 

        // Diamond 등급 연출, Test
        else if (this.eRewardGrade == ErewardGrade.Gold || this.eRewardGrade == ErewardGrade.Diamond)
        {
            this.isRolling = true;
            Debug.LogFormat("{0}", this.eRewardGrade);
            Debug.LogFormat("<color=red>DoMove, isRolling: {0}</color>", this.isRolling);

            Sequence sequence = DOTween.Sequence();

            sequence.AppendCallback(() =>
            {
                StartCoroutine(this.uiDice.CantDiceBtnSetting());
            });

            sequence.Append(this.transform.DOMove(new Vector3(0, 1.5f, 0), 0.75f).SetEase(Ease.OutExpo));

            sequence.AppendCallback(() =>
            {
                StartCoroutine(DoShakeCoroutine()); //Shake 연출 코루틴 호출

            });

            sequence.AppendCallback(() => StartCoroutine(CoFireWorksParticle(fireWorksPos)));

            sequence.Append(this.transform.DOMove(new Vector3(0, 3f, 0), 0.75f).SetEase(Ease.OutExpo));

            sequence.Play();

        }

# DoTween을 많이 안써봐서 자료를 많이 찾아봐야헀다. onComplete로는 표현이 부족하다 느껴서 다른 방법을 찾아봤다

   Sequence sequence = DOTween.Sequence(); 로 DoTween을 할당 한 후 onComplete 대신

   AppendCallback 과 Append 로 제어하는 시도를 해봤다.  

  지금은 Diamond 등급이 결정되면 AppendCallback에서 StartCoroutine(this.uiDice.CantDiceBtnSetting()); 코루틴을 호출    해 연출이 보여지기 전에는 재도전을 할 수 없게 버튼을 비활성화 시켜줬다. 

  다소 복잡해 보이지만 Append와 AppendCallback의 반복이다. onComplete대 신 ApeendCallback을 쓰는 방식이다. 

 

    private IEnumerator CoFireWorksParticle(Vector3 fireWorksPosition)
    {
        this.fireWorksParticle.gameObject.SetActive(true);

        this.fireWorksParticle.transform.position = new Vector3(fireWorksPosition.x, fireWorksPosition.y, fireWorksPosition.z + 22f);
        this.fireWorksParticle.Play();

        yield return new WaitForSeconds(15f);

        this.isRolling = false;
        this.fireWorksParticle.Stop();
        this.fireWorksParticle.gameObject.SetActive(false);
    }
    private IEnumerator DoShakeCoroutine()
    {
        Vector3 originalPosition = this.transform.position;

        float shakeDuration = 2f;
        float shakeStrength = 0.1f;

        float elapsed = 0f;
        while (elapsed < shakeDuration)
        {
            Vector3 randomOffset = Random.insideUnitSphere * shakeStrength;
            this.transform.position = originalPosition + randomOffset;
            elapsed += Time.deltaTime;
            yield return null;
        }

        this.transform.position = originalPosition;
    }

# Dice 연출 (Test를 위해 Gold와 Diamond 등급에서 연출이 나오게 했다)

  => 100%만족스럽지는 않다. Glow효과를 추가하고 파티클도 좀 더 과하게 터트려보자