Pedro Gomes c458ae4e8f Job Update
- refactored job information and what selecting a job means in terms of code/data
- job templates
- networked job selection & job activation state
2024-06-12 22:07:33 +01:00

29 lines
801 B
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "GameEvent_JobData", menuName = "Wavefunction/Event/New GameEvent JobData", order = 1)]
public class GameEvent_JobInstance : ScriptableObject
{
private List<GameEventListener_JobInstance> listeners = new List<GameEventListener_JobInstance>();
public void Raise(JobInstance jobData)
{
for (int i = listeners.Count - 1; i >= 0; i--)
{
listeners[i].OnEventRaised(jobData);
}
}
public void RegisterListener(GameEventListener_JobInstance listener)
{
listeners.Add(listener);
}
public void UnRegisterListener(GameEventListener_JobInstance listener)
{
listeners.Remove(listener);
}
}