블로그 이미지
Every unexpected event is a path to learning for you. blueasa

카테고리

분류 전체보기 (2779)
Unity3D (845)
Programming (475)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (185)
협업 (59)
3DS Max (3)
Game (12)
Utility (139)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (55)
Android (15)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

이번에 삼성 갤럭시 폴드6 해상도 대응 및 테스트가 필요한데 디바이스가 없어서 갑갑해 하던 중,

삼성에서 원격 테스트가 가능한 걸 알고 이번에 나름 잘 사용함.

새로운 모양의 삼성폰이 새로 나오게 되면 여길 활용하면 나름 괜찮은 것 같다.

 

   [참고 사항]

- 가입 시, 10 Credit을 주고, 매일 1회 무료로 10 Credit을 주는데, 30분 테스트에 2 Credit을 사용한다.

  (매일 접속해서 10 Credit 받기 출첵 해놓으면 좋을 것 같다.)

- 15분당 1 Credit이어서, 30분 2Credit을 사용하고 16분 이상 남았을 때 종료하려고 하면 1 Credit 회수 옵션이 뜨는데 체크하고 끄면 회수된다.

- 게임 설치는 웹 화면 위에 apk 파일을 드래그해서 올리면 설치  된다.

- 국가별로도 고를 수 있어서 해당 국가 테스트도 가능한 것 같다.

- CDN 패치는 그쪽 인터넷이 느린지 느릴때가 많은 것 같다. 패치는 없게 만들어서 테스트 하면 좋을 듯.

- Remote Test Lab을 끄거나 시간 만료로 종료되면 설치됐던 건 자동으로 Reset 시키는 것 같다(언인스톨 한다고 뻘짓할 필요는 없는 듯..)

- 갤럭시 Z 플립/폴드는 메뉴에서 접었다 폈다 하는 것도 테스트 된다.

 

 

[링크] https://developer.samsung.com/remote-test-lab

 

Remote Test Lab | Samsung Developers

The world runs on you.

developer.samsung.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.42f1

----

 

언젠가부터 에디터의 GameView에서 Resolution을 비율이 아닌 해상도를 선택(예:1920x1080 Landscape)하면 Scale 때문에 한화면에 다 보이지 않는 현상이 발생함.

그래서 Scale을 최소치로 내리는데, 문제는 Play를 실행하면 최소치로 내려놓은 Scale 값이 초기화되면서 화면이 다시 커진다.

그래서 Play 이후에 다시 Scale 값을 내리는 불편함이 생기는데..

원인 및 해결을 위해 찾다보니 아래 [참조]와 같은 내용이 있다.

 

[참조] https://discussions.unity.com/t/game-view-scale-wont-go-lower-than-1-3x-in-16-9-display-mode/922853/18

 

[참조] 글을 보면 GameView를 껐다 다시 키라고 하는데, 해보니 정말로 잘 된다.

그리고, Window 해상도 및 배율 관련 이야기도 나온다.

 

글 내용들과 해결책으로 유추해 봤을 때 현재 상태를 가정해보면 아래와 같을 거라 생각한다.

 

[가정] GameView의 Scale 관련 저장되는 값은 GameView가 최초 켜질 때 결정되고 로컬에 저장된다.

[가정] 에디터가 켜지는 건 GameView 켜지는 것과 무관한다.(위의 가정에서의 초기값 갱신이 안됨)

 

   [예상 플로우]

1) (최초 Unity가 켜지면서) 최초 GameView가 켜지고 초기값이 저장됨.

2) 모니터의 해상도나 배율이 변경됨.

3) Unity Editor를 새로 켜도 GameView가 새로 켜지는 건 아니라서 해상도/배율 관련 저장값이 갱신 안됨.

4) GameView에서 Resolution 값으로 해상도를 셋팅(예:1920x1080 Landscape)하고 Scale값을 최소로 내려서 화면에 Fit 되게 한 후에 Play 버튼을 눌러서 실행해도 Scale 값이 원래 값으로 되돌려짐.

----

5) GameView를 껐다가 새로 켬.

6) GameView Scale 값이 달라진 걸 볼 수 있음(초기값 재저장 된 듯)

 

 

  [결론]

Play 버튼을 눌렀을 때, GameView Scale 값이 설정한대로 고정안되고 변경된다면,

GameView를 껐다가 새로 키자.(Editor 껐다 키는거 아님)

반응형
Posted by blueasa
, |

Unity 2021.3.42f1

----

 

[참고]

[링크] https://blueasa.tistory.com/2853

 

위 링크의 내용을 한 번 해보고,

안되면 아래 스크립트를 사용해 보자.

----

 

에디터의 GameView에서 Resolution을 비율이 아닌 해상도를 선택(예:1920x1080 Landscape)하면 Scale 때문에 한화면에 다 보이지 않는다.

그래서 Scale을 최소치로 내리는데, 문제는 Play를 실행하면 최소치로 내려놓은 Scale 값이 초기화되면서 화면이 다시 커진다.

그래서 Play 이후에 다시 Scale 값을 내리는 불편함이 생기는데, 찾아보니 같은 불편을 느끼는 사람이 많은 것 같다.

아래와 같은 스크립트를 만들어놨길래 써보니 꽤 마음에 든다.

 

아래 스크립트를 Editor 폴더에 넣어주기만 하면 된다.

using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;

[InitializeOnLoad]
public static class FixResolutionScale
{
    static FixResolutionScale()
    {
        EditorApplication.playModeStateChanged += OnPlayStateChanged;
        SetGameViewScale();
    }

    private static void OnPlayStateChanged(PlayModeStateChange playModeStateChange)
    {
        SetGameViewScale();
    }

    private static void SetGameViewScale()
    {
        Type gameViewType = GetGameViewType();
        EditorWindow gameViewWindow = GetGameViewWindow(gameViewType);

        if (gameViewWindow == null)
        {
            Debug.LogError("GameView is null!");
            return;
        }

        var defScaleField = gameViewType.GetField("m_defaultScale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

        //whatever scale you want when you click on play
        float defaultScale = 0.1f;

        var areaField = gameViewType.GetField("m_ZoomArea", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
        var areaObj = areaField.GetValue(gameViewWindow);

        var scaleField = areaObj.GetType().GetField("m_Scale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
        scaleField.SetValue(areaObj, new Vector2(defaultScale, defaultScale));
    }

    private static Type GetGameViewType()
    {
        Assembly unityEditorAssembly = typeof(EditorWindow).Assembly;
        Type gameViewType = unityEditorAssembly.GetType("UnityEditor.GameView");
        return gameViewType;
    }

    private static EditorWindow GetGameViewWindow(Type gameViewType)
    {
        Object[] obj = Resources.FindObjectsOfTypeAll(gameViewType);
        if (obj.Length > 0)
        {
            return obj[0] as EditorWindow;
        }
        return null;
    }
}

 

 

 

[출처] https://discussions.unity.com/t/game-view-scale-on-compilation-play/217998

 

반응형
Posted by blueasa
, |

UITexture UV Animation

Unity3D/NGUI / 2024. 9. 5. 13:03

Unity 2021.3.43f1

NGUI 2023.08.01

----

 

NGUI에서 UV Animation을 하기 위해 UV를 제어 할 수 있는 UITexture를 활용한 애니메이션 스크립트

 

using UnityEngine;
using System.Collections;


public class UITexture_UVAnimation : MonoBehaviour
{
    [SerializeField] private UITexture m_textureTarget = null;
    [SerializeField] private Vector2 m_v2AnimationRate = new Vector2(1f, 0f);
    private Coroutine m_coUVAnimation = null;
    private Rect m_rect;
    private float m_fDeltaTime = 0f;


    void OnEnable()
    {
        if (null == m_textureTarget)
        {
            m_textureTarget = GetComponent<UITexture>();
        }

        RunUVAnimation();
    }

    void OnDisable()
    {
        StopAllCoroutines();
    }

    void RunUVAnimation()
    {
        if (null != m_textureTarget)
        {
            if (null != m_coUVAnimation)
            {
                StopCoroutine(m_coUVAnimation);
                m_coUVAnimation = null;
            }

            m_coUVAnimation = StartCoroutine("CoUpdateUVAnimation");
        }
    }

    IEnumerator CoUpdateUVAnimation()
    {
        while (true)
        {
            m_rect = m_textureTarget.uvRect;
            m_fDeltaTime = Time.deltaTime;
            if (0f != m_v2AnimationRate.x)
            {
                m_rect.x += m_v2AnimationRate.x * m_fDeltaTime;
            }

            if (0 != m_v2AnimationRate.y)
            {
                m_rect.y += m_v2AnimationRate.y * m_fDeltaTime;
            }

            m_textureTarget.uvRect = m_rect;

            yield return null;
        }
    }
}

 

 

[참조] https://www.tasharen.com/forum/index.php?topic=8232.0

 

Scrolling UV Animation

OK, thank you for the support, It was the script writing part that i needed to avoid << smelly artist doesn't understand the use of public and private stuff... I'll have to get help after the weekend then. Thanks anyway

www.tasharen.com

 

반응형
Posted by blueasa
, |