24 lines
530 B
C#
24 lines
530 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Photon.Pun;
|
|
|
|
public class SpawnPlayer : MonoBehaviour
|
|
{
|
|
public GameObject PlayerPrefab;
|
|
public GameObject PlayerPrefab1;
|
|
|
|
public float minX;
|
|
public float maxX;
|
|
public float minY;
|
|
public float maxY;
|
|
|
|
|
|
void Start()
|
|
{
|
|
Vector2 randomPosition = new Vector2(Random.Range(minX, maxX), Random.Range(minY, maxY));
|
|
PhotonNetwork.Instantiate(PlayerPrefab.name, randomPosition, Quaternion.identity);
|
|
}
|
|
|
|
}
|