- Boss after rift clearance - job completed event - job rewards awarded on completion
44 lines
1.1 KiB
C#
44 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.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 bossIndex;
|
|
public Vector3 position;
|
|
}
|