簡體   English   中英

嘗試統一使用Resources.Load()時出現錯誤CS0234

[英]Trying to use Resources.Load() on unity and I get an error CS0234

資產/資源/游戲/游戲.cs(15,53):錯誤CS0234:類型或名稱空間名稱“ Load' does not exist in the namespace資源” Load' does not exist in the namespace 您是否缺少裝配參考?

using UnityEngine;
using System.Collections;

using InControl;

public class Game : MonoBehaviour {

private float _originalTimeScale;
private float _slowMoTimeScale;  //slow motion time scale
private float _fastMoTimeScale;  //fast motion time scale
private float factor = 4f;      //factor to increase or decrease the timescale by

// Use this for initialization
void Start () {
    GameObject playerPreFab = Resources.Load("Ethan", GameObject);
...

您缺少Resources.Load的某些語法。 它應該是:

(GameObject)Resources.Load("Ethan", typeof(GameObject))

在你的情況下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM