House menu ui

This commit is contained in:
s-prechtl 2022-05-19 09:51:17 +02:00
parent 4612938b54
commit e9f4f3344b
5 changed files with 1020 additions and 33 deletions

View file

@ -0,0 +1,33 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class HouseController : MonoBehaviour {
private int dayCount = 0;
private static UnityEvent newDayEvent;
public static UnityEvent NewDayEvent => newDayEvent;
public Canvas menu;
private void OnMouseDown() {
toggleMenu();
}
void Start() {
newDayEvent ??= new UnityEvent();
newDayEvent.AddListener(newDay);
}
public void newDay() {
dayCount++;
Debug.Log("New day: " + dayCount);
newDayEvent?.Invoke();
}
public void toggleMenu() {
menu.gameObject.SetActive(!menu.gameObject.activeSelf);
}
}