- added multiple waves of enemies spawn before boss instead of single wave + boss - added Multi job reward for every X jobs players can claim a bonus reward (using job templates)
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using Photon.Pun;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class RiftSpawner : MonoBehaviour
|
|
{
|
|
[Header("Rifts:")]
|
|
[SerializeField] private List<GameObject> riftPrefabs = new List<GameObject>();
|
|
|
|
[Header("Listeners:")]
|
|
[SerializeField] private GameEventListener_RiftSettings onSpawnRiftRequest;
|
|
|
|
GameObject spawnedRiftGO;
|
|
Rift spawnedRift;
|
|
|
|
private void Awake()
|
|
{
|
|
DontDestroyOnLoad(this);
|
|
|
|
onSpawnRiftRequest.Response.AddListener(SpawnRiftOnRequest);
|
|
}
|
|
|
|
private void SpawnRiftOnRequest(RiftSettings riftSettings)
|
|
{
|
|
spawnedRiftGO = PhotonNetwork.Instantiate("Rifts/" + riftPrefabs[riftSettings.riftIndex].name, riftSettings.zoneData.spawnPoints[0].position, Quaternion.identity);
|
|
|
|
spawnedRift = spawnedRiftGO.GetComponent<Rift>();
|
|
|
|
spawnedRift.InitializeRift(riftSettings);
|
|
|
|
spawnedRift.StartSpawning();
|
|
}
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class RiftSettings
|
|
{
|
|
public int riftIndex;
|
|
public Dictionary<int,int> enemyIndexes_Quantity;
|
|
public int numberOfWaves;
|
|
public int bossIndex;
|
|
public ZoneData zoneData;
|
|
}
|