/// <summary> /// コルーチンでファイル読み込み /// </summary> /// <param name="file"></param> /// <returns></returns> IEnumerator LoadVR180Coroutine(string file) { FindObjectOfType <VR180Mesh>().GenerateMesh(file); FindObjectOfType <VR180Mesh>().StartPlay(file); // 前のtextureを破棄 Destroy(texture); // Quiltを読み込み quilt.tiling = new Quilt.Tiling( "Custom " + 2 + "x" + 1, 2, 1, 2560, 1440 ); quilt.overrideQuilt = renderTexture; quilt.SetupQuilt(); // 念のため毎回GCをしてみる… System.GC.Collect(); Debug.Log("Estimaged tiling: " + quilt.tiling.presetName); // 選択されたTiling // 読み込み完了 isLoading = false; yield return(null); }
/// <summary> /// コルーチンでファイル読み込み /// </summary> /// <param name="file"></param> /// <returns></returns> IEnumerator LoadQuiltFile(string file) { file = "file://" + file; Debug.Log(file); WWW www = new WWW(file); yield return(www); Debug.Log(www.error); Debug.Log(www.texture); texture = www.texture; quilt.tiling = GetTilingType(texture); quilt.overrideQuilt = texture; quilt.SetupQuilt(); Debug.Log(quilt.tiling.presetName + " # " + quilt.TilingPresetIndex); // 選択されたTiling }