안녕하세요 로로아빠입니다.
오늘은 유니티3d에서 이미지를 불러온 후 텍스쳐에 넣는 소스코드 공유드립니다.
소스코드 예제는 자바스크립트와 C# 두가지 입니다.
Javascript
var tDynamicTx : Texture2D ;
var tLoad :WWW ;
var images : String ;
images = "file://"+ Application.dataPath +"Test.jpg";
tLoad= new WWW(images);
tDynamicTx= new Texture2D(64, 64);
tLoad.LoadImageIntoTexture(tDynamicTx);
C#
public Texture2D tDynamicTx;
public WWW tLoad;
public string images;
images = "file://"+ Application.dataPath +"Test.jpg";
tLoad= new WWW(images);
tDynamicTx= new Texture2D(64, 64);
tLoad.LoadImageIntoTexture(tDynamicTx);
도움이 되었기를 바랍니다.
감사합니다.
'IT팁 > IT 기타' 카테고리의 다른 글
[Unity3D] 유니티 상속 관계를 코드에서 해체 하기 (0) | 2023.01.21 |
---|---|
Google chart Spring 구글 차트에 서버 데이터 넣기 (0) | 2023.01.20 |
[해결] The JRE could not be found. Edit the server and change the JRE location (0) | 2023.01.20 |
[Websquare] Websqure 가 정의 되지 않았습니다 (0) | 2023.01.20 |
[공유] VI 에디터 사용법 (0) | 2023.01.18 |