Files
CityBuilder/Assets/Scripts/TechEvents.cs
SHOUTING_PIRATE 1c91215efd initial commit
2025-07-07 20:59:04 +01:00

38 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class TechEvents : MonoBehaviour
{
public static Action<Technology> OnTechResearchStarted;
public static Action<Technology> OnTechResearchCompleted;
public static Action<Technology> OnTechUnlocked;
public static Action OnTurnPassed; // takes no parameter passed in
public static void TechResearchStarted(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechResearchStarted?.Invoke(tech);
}
public static void TechResearchCompleted(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechResearchCompleted?.Invoke(tech);
}
public static void TechUnlocked(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechUnlocked?.Invoke(tech);
}
public static void TurnPassed(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTurnPassed?.Invoke();
}
}