问答详情
源自:2-4 [Unity3D五子棋大战] 游戏主循环

d:\wuziqi\Assets\Script\Board.cs(43,43): Error CS0308: 非泛型 方法“UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)”不能与类型参数一起使用 (CS0308) (Assembly-CSharp)

d:\wuziqi\Assets\Script\Board.cs(43,43): Error CS0308: 非泛型 方法“UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)”不能与类型参数一起使用 (CS0308) (Assembly-CSharp)

提问者:慕粉3335045 2016-05-18 19:26

个回答

  • qq_风雨_22
    2018-02-23 11:26:33

    (GameObject)Instantiate(crossPrefab); 强制把object转成gameobject

  • 森林清风
    2016-06-09 18:51:24

    GameObject.Instantiate<GameObject>(crossPrefab);

    crossPrefab要是那个声明的public变量,到时候要把prefab拖上去