상세 컨텐츠

본문 제목

Unity3D Load Json StreamingAsssets Path in Android Solution

개발생활/Unity Engine

by 한국인맛집 2019. 7. 24. 21:59

본문

반응형

// Json Path.

// Assets/StreamingAssets/level.json

 

public void LoadJsonData(){

 string filePath ="";

        if(Application.platform == RuntimePlatform.Android){
        
            filePath = System.IO.Path.Combine(Application.streamingAssetsPath,gameData);

            WWW reader = new WWW(filePath);
            while ( ! reader.isDone){ }

            string realPath = Application.persistentDataPath + "/level";
            System.IO.File.WriteAllBytes(realPath,reader.bytes);

            filePath = realPath;

        }
	
}
반응형

관련글 더보기