Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Photon.Pun;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- public class PhotonEnemy : MonoBehaviour
- {
- private PhotonView PV;
- private PhotonRoomCustomMatch PRCM;
- public GameObject myAvatar;
- int spawnNumber;
- int enemyAmount;
- // Start is called before the first frame update
- void Start()
- {
- PV = GetComponent<PhotonView>();
- spawnNumber = 0;
- enemyAmount = 4;
- if (PhotonNetwork.IsMasterClient)
- {
- SpawnEnemies();
- }
- }
- void SpawnEnemies()
- {
- for (int i = 0; i < enemyAmount; i++)
- {
- int spawnPicker = spawnNumber++;
- myAvatar = PhotonNetwork.InstantiateSceneObject(Path.Combine("Prefabs", "Enemy"),
- GameSetup.GS.enemySpawnPoints[spawnPicker].position, GameSetup.GS.enemySpawnPoints[spawnPicker].rotation, 0);
- }
- }
- }
Add Comment
Please, Sign In to add comment