2015-06-28 44 views
0

Assets/Resources/Game/Game.cs(15,53):錯誤CS0234:類型或名稱空間名稱Load' does not exist in the namespace Resources'。您是否缺少裝配參考?試圖在unity上使用Resources.Load(),並且出現錯誤CS0234

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); 
... 
+0

請將您的代碼粘貼到發生錯誤的地方。 – Inisheer

+1

@Inisheer我編輯了我的問題與代碼.. GameObject playerPreFab = Resources.Load(「Ethan」,GameObject);是錯誤行 –

回答

1

您錯過了Resources.Load的一些語法。它應該是:

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

你的情況。

相關問題