Foerming/Assets/Scripts/DayController.cs
2022-05-09 23:02:02 +02:00

27 lines
No EOL
551 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class DayController : MonoBehaviour {
private int dayCount = 0;
private static UnityEvent newDayEvent;
public static UnityEvent NewDayEvent => newDayEvent;
private void OnMouseDown() {
newDay();
}
void Start() {
newDayEvent ??= new UnityEvent();
newDayEvent.AddListener(newDay);
}
private void newDay() {
dayCount++;
newDayEvent?.Invoke();
}
}