해당 오브젝트 하위의 이미지등이 rect 안에서만 보임
alpha값은 1/255 이상이여야 하고 0이면 안됨
적용이 잘 안 된다면 Mask컴포넌트를 지웠다가 재할당 할것
'Unity' 카테고리의 다른 글
TTS (0) | 2020.10.19 |
---|---|
유니티 IDE(비주얼스튜디오) 바꾸기 (0) | 2020.08.19 |
유니티 콜라보레이트 클라우드 (0) | 2020.08.10 |
해당 오브젝트 하위의 이미지등이 rect 안에서만 보임
alpha값은 1/255 이상이여야 하고 0이면 안됨
적용이 잘 안 된다면 Mask컴포넌트를 지웠다가 재할당 할것
TTS (0) | 2020.10.19 |
---|---|
유니티 IDE(비주얼스튜디오) 바꾸기 (0) | 2020.08.19 |
유니티 콜라보레이트 클라우드 (0) | 2020.08.10 |
www.miray.de/download/hdclone.html
HDClone | Miray Software
HDClone X Free Edition The Free Edition is real freeware without any obligation to buy. It is intended for temporary and free use cases. For more frequent or professional use, we recommend you to use one of the higher editions, as they offer higher speed,
www.miray.de
일반용
나머진 그냥 next
-usb부팅 방법
안드로이드 스튜디오 앱 업로드 (0) | 2020.10.19 |
---|---|
윈도우 이전작업 (0) | 2020.09.03 |
스마트폰으로 컴퓨터 인터넷 연결하기 (0) | 2020.08.15 |
c:\windows\system32\sysprep\sysprep.exe
를 친다.
HDclone 사용법 (0) | 2020.09.03 |
---|---|
스마트폰으로 컴퓨터 인터넷 연결하기 (0) | 2020.08.15 |
프로그래밍 영어 (0) | 2020.08.12 |
파일 주소앞에 file:///를 넣는다
끝
유니티 에디터 관련 (0) | 2020.10.05 |
---|---|
c# MD5 (0) | 2020.08.25 |
UnityWebRequest (0) | 2020.08.20 |
2020년
오뚜기 오삼불고기 덮밥: 맛있다. 데워먹지 않아도 된다. 가성비 좋다
오뚜기 제육덮밥 : 데워먹지 않아도 된다. 맛있다.
오뚜기 불닭마요 : 맛있다. 닭꼬치맛. 데우지 않아도 된다. 가성비 좋다. 단점은 야채건더기가 딱딱함. 소스갯수가 많아 넣는거도 귀찮고 쓰레기가 많이나온다 빡쳐
오뚜기 김치참치 덮밥 : 괜찮다. 풍부한 단백질, 훈제계란 부숴서 넣으면 맛있다.
오뚜기 쇠고기 전골밥 : 정말 맛있다. 단점은 당면이 있어서 라면처럼 물넣어서 끓여야한다. 개빡쳐.
오뚜기 볼케이노 치밥 : 우웩, 열여덟
오뚜기 허니갈릭 치밥 : 먹을만하다. 별로 취향은 아님. 마늘맛
오뚜기 부대찌개밥 : 정말 맛있다. 햄도 생각보다 많음. 단점은 끓여먹어야한다. 필수는 아니지만 그러는게 좋음
SSD 시세 추이 (0) | 2020.08.31 |
---|---|
코로나 자가격리자 지침서 (0) | 2020.08.19 |
애드몹 PIN등록하기 (0) | 2020.08.19 |
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("-", "");
}
failed to connect to localhost port 80: Connection (0) | 2020.09.01 |
---|---|
UnityWebRequest (0) | 2020.08.20 |
형변환 모음 (0) | 2020.08.11 |
파일을 다운로드
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());
}
c# MD5 (0) | 2020.08.25 |
---|---|
형변환 모음 (0) | 2020.08.11 |
유니티 씬 계열 함수 모음 (0) | 2020.07.30 |