Get it on Google Play


Wm뮤 :: '2020/08 글 목록

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

Recent Comment

Archive


2020. 8. 31. 01:47 나의 작은 정보들

 

2019.09.06

WD Green 480GB

77000원

 

 

 

2020.08.31

WD Green 480GB

75000원

WD Green 1TB

139000원

WD Blue 1TB

149000원

'나의 작은 정보들' 카테고리의 다른 글

건강검진  (0) 2020.12.03
간편식 후기모음  (0) 2020.08.25
코로나 자가격리자 지침서  (0) 2020.08.19
posted by 모카쨩
2020. 8. 25. 17:39 나의 작은 정보들

2020년

 

오뚜기 오삼불고기 덮밥: 맛있다. 데워먹지 않아도 된다. 가성비 좋다

오뚜기 제육덮밥 :  데워먹지 않아도 된다. 맛있다.

오뚜기 불닭마요 : 맛있다. 닭꼬치맛. 데우지 않아도 된다. 가성비 좋다. 단점은 야채건더기가 딱딱함. 소스갯수가 많아 넣는거도 귀찮고 쓰레기가 많이나온다 빡쳐

오뚜기 김치참치 덮밥 : 괜찮다. 풍부한 단백질, 훈제계란 부숴서 넣으면 맛있다.

오뚜기 쇠고기 전골밥 : 정말 맛있다. 단점은 당면이 있어서 라면처럼 물넣어서 끓여야한다. 개빡쳐. 

오뚜기 볼케이노 치밥 : 우웩, 열여덟

오뚜기 허니갈릭 치밥 : 먹을만하다. 별로 취향은 아님. 마늘맛

오뚜기 부대찌개밥 : 정말 맛있다. 햄도 생각보다 많음. 단점은 끓여먹어야한다. 필수는 아니지만 그러는게 좋음

'나의 작은 정보들' 카테고리의 다른 글

SSD 시세 추이  (0) 2020.08.31
코로나 자가격리자 지침서  (0) 2020.08.19
애드몹 PIN등록하기  (0) 2020.08.19
posted by 모카쨩
2020. 8. 25. 17:17 Unity/C#

v1

    public string GetMD5(byte[] data)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        byte[] hash = System.Security.Cryptography.MD5.Create().ComputeHash(data);
        foreach (byte b in hash)
        {
            sb.Append(b.ToString("X2"));
        }
        return sb.ToString();
    }

 

 

v2

public string GetMD5(byte[] data)
{
    byte[] bytes = System.Security.Cryptography.MD5.Create().ComputeHash(data);
    return System.BitConverter.ToString(bytes).Replace("-", "");
}

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

failed to connect to localhost port 80: Connection  (0) 2020.09.01
UnityWebRequest  (0) 2020.08.20
형변환 모음  (0) 2020.08.11
posted by 모카쨩
2020. 8. 20. 15:54 Unity/C#

파일을 다운로드

    public string url;
    public string fileName;
    public string fileType;
    IEnumerator DownloadFile()
    {
        string filePath= $"{Application.persistentDataPath}/{fileName}";
        if( (fileType != null)&& (fileType.Trim() != "") )
        {
            filePath += $".{fileType}";
        }
        UnityWebRequest unityWebRequest = UnityWebRequest.Get(url);
        yield return unityWebRequest.SendWebRequest();
        if (unityWebRequest.isNetworkError)
        {
            Debug.LogError(unityWebRequest.error);
        }
        else
        {
            File.WriteAllBytes(filePath, unityWebRequest.downloadHandler.data);
        }
    }

 

 

V2




    /// <summary>
    /// 다운 다되면 파일경로를 반환
    /// </summary>
    /// <param name="downloadlink"></param>
    /// <param name="filePath"></param>
    /// <returns></returns>
    IEnumerator DownloadFile(string downloadlink, string filePath)
    {
        Debug.Log($"Download:{downloadlink}");
        {
            DOWNLOAD_RETRY:;
            {
                var unityWebRequest = UnityWebRequest.Get(downloadlink);
                var operation = unityWebRequest.SendWebRequest();
                yield return new WaitUntil(() => operation.isDone);

                if (unityWebRequest.isNetworkError)
                {
                    Debug.LogError(unityWebRequest.error);
                    yield return new WaitForSeconds(3f);
                    goto DOWNLOAD_RETRY;
                }
                else
                {
                    Debug.Log(filePath);

                    var folderPath = System.IO.Path.GetDirectoryName(filePath);
                    Debug.Log(folderPath);
                    if (System.IO.Directory.Exists(folderPath) == false)//폴더가 없으면 생성
                    {
                        System.IO.Directory.CreateDirectory(folderPath);
                    }
                    System.IO.File.WriteAllBytes(filePath, unityWebRequest.downloadHandler.data);
                }
            }
        }
        yield return filePath;
    }

 

 

 

 

 

DownloadHandlerFile 방식 

메모리를 딱 필요한만큼만 쓴다. 위에는 2배사용

V3



    List<string> downloadList = new List<string>();
    IEnumerator DownloadFile(string downloadlink, string filePath)
    {
        downloadList.Add(downloadlink);

        DOWNLOADRETRY:;
        {
            UnityWebRequest unityWebRequest = UnityWebRequest.Get(downloadlink);
            unityWebRequest.downloadHandler = new DownloadHandlerFile(filePath);

            var operation = unityWebRequest.SendWebRequest();
            yield return new WaitUntil(() => operation.isDone);

            if (unityWebRequest.isNetworkError)
            {
                Debug.LogError(unityWebRequest.error);
                yield return new WaitForSeconds(1f);
                goto DOWNLOADRETRY;
            }
            else
            {
                Debug.Log(filePath);
            }
        }
        downloadList.Remove(downloadlink);
    }

 

V1~V2

더보기
    IEnumerator DownloadFile(string downloadlink, string filePath)
    {
        UnityWebRequest unityWebRequest = UnityWebRequest.Get(downloadlink);
        unityWebRequest.downloadHandler = new DownloadHandlerFile(filePath);
        var operation = unityWebRequest.SendWebRequest();
        while (!operation.isDone)
        {
            yield return new WaitForSeconds(0.01f);
        }
        if (unityWebRequest.isNetworkError)
        {
            Debug.LogError(unityWebRequest.error);
        }
        else
        {
            Debug.Log(filePath);
        }
    }

 

 

 

V2

List<String> DownloadList = new List<String>();
    IEnumerator DownloadFile(string downloadlink, string filePath)
    {
        UnityWebRequest unityWebRequest = UnityWebRequest.Get(downloadlink);
        unityWebRequest.downloadHandler = new DownloadHandlerFile(filePath);

        DownloadList.Add(downloadlink);
        DOWNLOADRETRY:;
        var operation = unityWebRequest.SendWebRequest();
        while (!operation.isDone)
        {
            yield return new WaitForSeconds(0.01f);
        }
        if (unityWebRequest.isNetworkError)
        {
            Debug.LogError(unityWebRequest.error);
            yield return new WaitForSeconds(1f);
            goto DOWNLOADRETRY;
        }
        else
        {
            Debug.Log(filePath);
        }
        DownloadList.RemoveAt(DownloadList.FindIndex(0, DownloadList.Count, x => x == downloadlink));
    }

 

 

 

 

 

 

HTML 다운로드

    public string urlSample= "https://wmmu.tistory.com/";
    IEnumerator DownloadHTML(string url)
    {
        UnityWebRequest unityWebRequest;
        unityWebRequest = UnityWebRequest.Get(url);
        yield return unityWebRequest.SendWebRequest();
        if (unityWebRequest.isNetworkError)
        {
            Debug.LogError(unityWebRequest.error);
        }
        else
        {
            Debug.Log(unityWebRequest.downloadHandler.text);
        }
    }

 

 

 

오디오 파일 로드

//전용 세이브 폴더 참조시에는
//$"file://{UnityEngine.Application.persistentDataPath}/Audio.mp3";
static AudioClip LoadAudioClip(string downloadLink)
{
    var fileName= downloadLink;
    if (System.IO.File.Exists(downloadLink))
    {
        downloadLink = $"file://{downloadLink}";
        fileName = System.IO.Path.GetFileNameWithoutExtension(downloadLink);
    }
    UnityWebRequest unityWebRequest = UnityWebRequestMultimedia.GetAudioClip(downloadLink, AudioType.UNKNOWN);

    var operation = unityWebRequest.SendWebRequest();
    while (!operation.isDone)
    {
        Thread.Sleep(1);
    }
    if (unityWebRequest.isNetworkError)
    {
        Debug.LogError(unityWebRequest.error);
    }
    else
    {
        //Debug.Log("LoadAudioClipSuccess");
    }
    var clip = DownloadHandlerAudioClip.GetContent(unityWebRequest);
    clip.name = fileName;
    return clip;
}

 

 

 

 

캐시 테스트

    public string url;
    public string cookie;
    public string fileName;
    public string fileType;
    IEnumerator DownloadFile()
    {
        string filePath = $"{Application.persistentDataPath}/{fileName}";
        if ((fileType != null) && (fileType.Trim() != ""))
        {
            filePath += $".{fileType}";
        }
        UnityWebRequest unityWebRequest = UnityWebRequest.Get(url);
        if (string.IsNullOrWhiteSpace(cookie)==false)
        {
            unityWebRequest.SetRequestHeader("Cookie", cookie);
        }
        yield return unityWebRequest.SendWebRequest();
        if (unityWebRequest.isNetworkError)
        {
            Debug.LogError(unityWebRequest.error);
        }
        else
        {
            Debug.Log(unityWebRequest.downloadHandler.text);
            //File.WriteAllBytes(filePath, unityWebRequest.downloadHandler.data);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(DownloadFile());
    }

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

c# MD5  (0) 2020.08.25
형변환 모음  (0) 2020.08.11
유니티 씬 계열 함수 모음  (0) 2020.07.30
posted by 모카쨩
2020. 8. 19. 16:43 나의 작은 정보들

 

보건소에서 연락이 먼저온다

증상이 없다면 검사를 받지 못하지만 부서를 잘 찾아다녀보면 받을수 있다

세금으로 이루어지는거니까 꼭 필요한게 아니면 가급적 삼가자

 

 

보건소에서 연락이 끝나면 하루정도 기다리면 구청에서 연락이 온다

위생용품 갖다준다는 연락이랑 지원물품이랑 지원금중에 선택하라고 한다

물품은 미리 알아볼수 있는 모양이니까 구청같은데 잘 뒤져보자

 

 

 

격리가 끝나면 생활지원금 구청에서 받을수 있다 신분증이랑 통장 들고가야한다

 

 

'나의 작은 정보들' 카테고리의 다른 글

간편식 후기모음  (0) 2020.08.25
애드몹 PIN등록하기  (0) 2020.08.19
이사관련 잡담  (0) 2020.08.14
posted by 모카쨩
2020. 8. 19. 16:26 Unity

 

 

 

 

 

 

 

비주얼스튜디오 2019는 여기에 있다

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe

 

 

 

 

가 아니고 사실 이렇게 경로를 지정해주면 안되고 비주얼 스튜디오 인스톨러를 이용해서 한번 더 설치해주면 저기에 알아서 비주얼 스튜디오 커뮤니티라고 뜬다

 

 

 

 

 

 

 

 

'Unity' 카테고리의 다른 글

유니티 Mask  (0) 2020.09.24
유니티 콜라보레이트 클라우드  (0) 2020.08.10
This mesh uses 'Multiple Canvas Renderers' for correct rendering.  (0) 2020.08.05
posted by 모카쨩
2020. 8. 19. 13:06 나의 작은 정보들

애드몹에서는 아무리 찾아도 안 나온다 애드센스로 가야한다

무슨차이인지는 모르겠지만 암튼 홈페이지를 이상하게 만들어놔서 생기는 문제다

확인을 눌러야 등록이든 재발신이든 나온다

 

 

 

 

 

애드몹 결제수단 추가

 

기업은행 기준

 

영어로 써야함

 

'나의 작은 정보들' 카테고리의 다른 글

코로나 자가격리자 지침서  (0) 2020.08.19
이사관련 잡담  (0) 2020.08.14
구글 드라이브 파일스트림 설치방법  (0) 2020.07.10
posted by 모카쨩
2020. 8. 15. 17:43 공학기술

 

 

 

옵션->연결->테더링 및 모바일 핫스팟-> USB테더링 체크

 

그리고 인내심을 가지고 기다리면 된다. 연결되는데 시간이 꽤 걸린다.

기다리면 일반적인 유선 네트워크처럼 네트워크 연결이 된다

'공학기술' 카테고리의 다른 글

윈도우 이전작업  (0) 2020.09.03
프로그래밍 영어  (0) 2020.08.12
윈도우10 공유폴더 설정  (0) 2020.08.04
posted by 모카쨩

  • total
  • today
  • yesterday

Recent Post

저사양 유저용 블로그 진입