using UnityEngine;
using Photon.Pun;
public class SpawnPlayers : MonoBehaviour
{
[SerializeField] private GameObject _playerPrefab;
[SerializeField] private float _minX, _maxX, _minY, _maxY;
[SerializeField] private InventoryGUI _playerInventoryGUI;
private GameObject _player;
void Start()
{
Vector2 _randomPosition = new Vector2(Random.Range(_minX, _maxX), Random.Range(_minY, _maxY));
_player = PhotonNetwork.Instantiate(_playerPrefab.name, _randomPosition, Quaternion.identity);
_playerInventoryGUI.targetInventory = _player.GetComponent<Inventory>();
}
}