런타임에서 스트리밍 폴더 만들어 파일 읽어 오기

http://cafe.naver.com/unityhub/33749

using UnityEngine;
using System.Collections;
using System.IO;

public class TEST : MonoBehaviour {

    Texture image;
    string path;

 // Use this for initialization
 void Start () {
 
 
        StartCoroutine(ImageTex());
 
 }
 
    IEnumerator ImageTex()
    {
        path = Path.Combine("file:///" + Application.streamingAssetsPath, "logo.jpg");
        WWW w = new WWW(path);
        yield return w;
        image = w.texture;
        Debug.Log(image.name);
        gameObject.GetComponent<MeshRenderer>().material.mainTexture = image;
    }

 // Update is called once per frame
 void Update () {
 
 }
}



댓글

이 블로그의 인기 게시물

날짜 시간 시간차 시간 계산 하기

코루틴에서 CallBack 함수 적용하기

C++ 언어 퍼센트 구하는 방법 / 기본 언어 퍼센트 구하는 방법