如果我没有错的话,
显示此错误
方法"实例化"没有重载需要三个参数
对于此行
PhotonNetwork.Instantiate(PlayerPrefabs.name, randomPosition, Quaternion.identity);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawn_Player : MonoBehaviour
{
public GameObject PlayerPrefabs;
public float minx;
public float maxx;
public float miny;
public float maxy;
// Start is called before the first frame update
void Start()
{
Vector3 randomPosition = new Vector3(Random.Range(minx, maxx),1, Random.Range(miny,maxy));
PhotonNetwork.Instantiate(PlayerPrefabs.name, randomPosition, Quaternion.identity);
}
}
PhotonNetwork.Instantiate
至少需要4个参数。
1.预制
2.位置
3.旋转
4.以及利益集团
此外,您可以添加用于自定义实例化数据的第五个参数。