Get it on Google Play


Wm뮤 :: '분류 전체보기' 카테고리의 글 목록 (52 Page)

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
전자과 게임프로그래머 (퇴사함)
2022.3.22f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


2021. 11. 16. 13:50

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 11. 15. 20:00 생명

 

해외에서는 기술발전이 없어서인지 관심이 줄고

국내는 미변동이고 연말이 될수록 관심이 높아진다 (나이먹어서)


노화기술 발전이 점점 더 지연될것이다

'생명' 카테고리의 다른 글

운동이 수명에 끼치는 영향들  (0) 2021.11.16
노화 유전자 찾기  (0) 2021.10.26
인공장기 아이디어 모음  (0) 2016.06.20
posted by 모카쨩
2021. 11. 15. 00:30

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 11. 12. 13:00

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 11. 6. 00:22 Unity/C#

 


    private int[,] _node_checker;
    private float[,] _worth_p_worth2 ;
    private Vector2 _now_pos;
    private int[,] _parent_dir ;
    private int map_wid = 1000;
    private float[] _check_pos_len;
    void Awake()
    {
        _worth_p_worth2 = new float[map_wid, map_wid];
        _node_checker = new int[map_wid, map_wid];
        _check_pos_len = new float[] { 1, 1.41421f, 1, 1.41421f, 1, 1.41421f, 1, 1.41421f };
        
        _parent_dir = new int[map_wid, map_wid];
        _now_pos = transform.position;
    }
    public int sc_8search(Vector2 pos)
    {//sc_8search(x,y);
        int _return = 0, _x = (int)pos.x, _y = (int)pos.y;
        int check_x, check_y, i, _t;


        for (i = 0; i < 8; i++)
        {
            check_x = _x + _check_pos_x[i];
            check_y = _y + _check_pos_y[i];
            if ((check_x < 0) || (check_x >= map_wid)
            || (check_y < 0) || (check_y >= map_wid))
            {
                continue;
            }

            if ((check_x == (int)move_point.x) && (check_y == (int)move_point.y))
            {
                _parent_dir[check_x, check_y] = i;
                return 2;
            }
            if (_node_checker[check_x, check_y] <= 0)
            {
                float f_t = _worth[_x, _y] + _check_pos_len[i];
                if (f_t < _worth[check_x, check_y])
                {
                    _worth[check_x, check_y] = f_t;
                    if (_worth2[check_x, check_y] == -4)
                    {
                        _worth2[check_x, check_y] = Vector2.Distance(new Vector2(check_x, check_y), move_point);
                    }
                    _worth_p_worth2[check_x, check_y] = _worth[check_x, check_y] + _worth2[check_x, check_y];

                    _parent_dir[check_x, check_y] = i;
                    _return = 1;
                }
                _node_checker[check_x, check_y] = -1;
            }
        }
        _node_checker[_x, _y] = 2;
        return _return;
    }
    public void a_star(Vector2 pos)
    {
        for (int k = 0; k < 10000; k++)
        {
            //if(sc_8search_len(_now_x,_now_y,8)==2)
            if (sc_8search(pos) == 2)
            {
                break;
            }
            bool _t = true;
            for (int i = 0; i < map_wid; i++)
            {
                for (int j = 0; j < map_wid; j++)
                {
                    if (_node_checker[i, j] == -1)
                    {
                        if (_t)
                        {
                            _now_pos.x = i;
                            _now_pos.y = j;
                            _t = false;
                        }
                        else
                        {
                            if (_worth_p_worth2[i, j] < _worth_p_worth2[(int)_now_pos.x, (int)_now_pos.y])
                            {
                                _now_pos.x = i;
                                _now_pos.y = j;
                            }
                        }
                    }
                }
            }
            //if (_t)
            {
                //break;
            }
        }
    }

 

 

너무 오래전에 짜서 개 난잡하게 되어있다... 후 언제 정리하지

구조가 거지같아서 그렇지 성능은 꽤나 최적화 되어있던걸로 기억한다

'Unity > C#' 카테고리의 다른 글

C# 메일  (0) 2021.11.18
유니티 기울기 관련  (0) 2021.10.23
유니티 RectTransform  (0) 2021.10.16
posted by 모카쨩
2021. 11. 4. 01:27 Unity

 

먼저 공유 옵션을 설정한다

슬프게도 전체공개가 아니면 안 되는듯 하다

 

 

 

 

코드는 하단 링크를 사용한다

https://github.com/ahzkwid/SpreadsheetDownloader/blob/main/Assets/Ahzkwid/SpreadsheetDownloader.cs

 

GitHub - ahzkwid/SpreadsheetDownloader: 구글스프레드시트 다운로더

구글스프레드시트 다운로더. Contribute to ahzkwid/SpreadsheetDownloader development by creating an account on GitHub.

github.com

 

 

만드느라 고생함

버튼으로 DownLoadStart함수를 실행하면 된다

다운로드 속도가 원체 빠른지라 별도 프로그레스는 안 넣음

 

 

key

 

 

 

sheetName

 

 

ㅅㄱ

'Unity' 카테고리의 다른 글

유니티 IAP  (0) 2021.11.12
유니티 오디오 믹서  (0) 2021.10.16
유니티 GPGS 연동  (0) 2021.10.07
posted by 모카쨩
2021. 11. 3. 21:40 사용설명서

 

 

 

 

 

 

 

한국어 <-> 일본어 전환 (로케일키)

Window + Space

 

일본어 <-> 영어 전환 (일영키)

Shift + Caps Lock

 

히라가나 <-> 가타카나 전환

Alt + Caps Lock

 

한자 변환

입력후 Space

 

가타카나 변환

입력후 F7

'사용설명서' 카테고리의 다른 글

마이리빙 무드 가습기 MOD-02 설명서  (0) 2022.01.17
미니 발펌프 사용설명서  (0) 2021.10.24
NP30K 사용설명서  (0) 2021.09.20
posted by 모카쨩
2021. 11. 3. 19:10 깃허브

 

 

 

 

-스크립트 충돌시

 

해당 스크립트를 열어서 병합 편집기를 연다

 

 

충돌난곳에 모두 체크표시를 한다

한개를 빼야한다면 해당코드에 체크해제를 누른다

 

 

병합 수락을 누른다

 

 

깃헙데스크톱에서 누른다

 

 

머지를 누른다

 

 

 

 

 

 

 

-씬 충돌시

 

-구버전

더보기

https://docs.unity3d.com/Manual/SmartMerge.html

 

Unity - Manual: Smart merge

Using external version control systems with Unity Smart merge Use the UnityYAMLMerge tool to merge sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments,

docs.unity3d.com

 

 

 

한쪽에서 스피어를 추가한후에 받는쪽에서 큐브를 추가하고 머지충돌이 난 상태다

 

1번

 

2번

 

 Abort merge를 눌러 빠져나간다

 

 

 

 

해당 프로젝트 폴더를 연다

 

 

 [merge]
        tool = unityyamlmerge

        [mergetool "unityyamlmerge"]
        trustExitCode = false
        cmd = 'C:\\Program Files\\Unity\\Editor\\Data\\Tools\\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

해당 위치에서 git config를 열어서 위 내용을 추가해준다

 

https://docs.unity3d.com/Manual/SmartMerge.html

여기에 원본코드가 있고 cmd에서 git config -E를 쳐서 수정해줘도 된다.

난 cmd가 안 익숙한 세대라서 그냥 메모장으로 했다

 

 

 

 

다시 pull을 시도해서 cmd를 연다

 

git mergetool --tool=unityyamlmerge

 를 입력한다

y를 쳐준다

쏼라쏼라 다 되었다

 

그리고 여기서 n을 누르거나 해서 파일이 꼬인상태에서 또 시도하면 위처럼 되는데

씬이 작살날수 있으므로 조심하자

 

잘 합쳐진 모습

 

아직 끝이 아니다

 

 

합칠때 사본을 생성하기 때문에 지워둔다.

 

머지한 내용을 푸시한다

 

 

 끝

 



 

-신버전 (2019이상?)

 

일단 급한불은 꺼졌다

하지만 합칠때마다 이 귀찮은짓을 할수는 없는노릇이다

 

자동화를 해보자

 

아래 링크를 참조했다

https://github.com/github-for-unity/Unity/issues/848

 

 

# Unity files
*.meta -text merge=unityamlmerge diff
*.unity -text merge=unityamlmerge diff
*.asset -text merge=unityamlmerge diff
*.prefab -text merge=unityamlmerge diff

어튜리뷰트를 사진처럼 설정해주고 커밋한다

그럼 이제 자기가 알아서 합쳐준다

 

 

하나씩 추가해서 또 머지해본 모습

 

 

 

 

 

나중에서야 안건데 위에 config설정은 구버전만 하는거고

요즘 버전은 어트리뷰트만 잘 넣어주면 자동으로 잘 된다...

 

수동머지도 git mergetool --tool=unityyamlmerge 만 쳐주면 잘 될듯 ㅡㅡ;

 

 

 

씬 머지는 만능이 아니므로 가급적 작업전에 미리 수정한다고 말하자

 

 

 

빌드세팅의 경우 머지시 오류나는 일이 잦으므로 .asset병합은 푸는게 나을지도

 

 

posted by 모카쨩

저사양 유저용 블로그 진입