バグの再現:
動映像テクスチャーのビデオドラッグを再生すると、パッケージ後にこの動画が削除された場合でも、プログラムはまだビデオを再生することができます。
movieTexture.Play();直接放送映像。偉大な神がグループを導くためにした後、スクリプトに対応するオブジェクトをドラッグすると団結、彼らは関係のリソースを関連付け、そのプロジェクトに直接パックするときことがわかりました。
WWWは、動的にビデオコードを再生ロード:
using UnityEngine;
using System.Collections;
public class MovePlay : MonoBehaviour {
public MovieTexture movieTexture;
public WWW www;
string datapath;
// Use this for initialization
void Start () {
datapath = Application.streamingAssetsPath+ "/DLXX.ogv";
Debug.Log("file://" + datapath );
StartCoroutine(OnLoadMove());
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
if (GUILayout.Button("play")) {
movieTexture.Play();
}
}
IEnumerator OnLoadMove() {
www = new WWW("file://"+datapath);
Debug.Log(www);
yield return www;
movieTexture = www.movie;
renderer.material.mainTexture = movieTexture;
movieTexture.loop = true;
// movieTexture.Play();
}
}