DayController.cs started implementation
This commit is contained in:
parent
84c1b1f2df
commit
5320e65356
3 changed files with 52 additions and 3 deletions
25
Assets/Scripts/DayController.cs
Normal file
25
Assets/Scripts/DayController.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
|
||||
private void OnMouseDown() {
|
||||
newDay();
|
||||
}
|
||||
|
||||
void Start() {
|
||||
newDayEvent ??= new UnityEvent();
|
||||
|
||||
newDayEvent.AddListener(newDay);
|
||||
}
|
||||
|
||||
private void newDay() {
|
||||
dayCount++;
|
||||
newDayEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue