【发布时间】:2016-10-26 01:50:12
【问题描述】:
我正在尝试在 unity3d v5.4.0f3 的 WebGL 上构建我的游戏,但我收到了这个错误:
errorCS-0246:类型或命名空间名称“MovieTexture”不能是 成立。您是否缺少 using 指令或程序集引用?
这是 c# 代码:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
[RequireComponent (typeof(AudioSource))]
public class videoplayer : MonoBehaviour {
public MovieTexture movie;
private AudioSource audio;
void Start () {
GetComponent<RawImage>().texture = movie as MovieTexture;
audio = GetComponent<AudioSource>();
audio.clip = movie.audioClip;
movie.Play ();
audio.Play();
}
void Update () {
}
}
【问题讨论】:
-
你的构建目标是什么(在播放器设置中)?
-
我不知道,我怎么知道?
-
抱歉,它在构建设置中,而不是在播放器设置中。有一个标记为 Target Platform 的下拉菜单
-
哦,当然,但是这个下拉目标平台在 PC、Mac 和 Linux Standalone 中。我正在尝试在 WebGL 上构建
-
如果我在 pc、mac 和 linux 上独立构建它可以工作