Files
project1_Space4x/Assets/Scripts/Clock.cs
2023-06-05 13:30:33 +02:00

31 lines
672 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Clock : MonoBehaviour
{
// Array ref to player managers
public GameManager gameManager { private get; set; }
public float DayTime = 10.0f;
// Start is called before the first frame update
void Start()
{
// callUpdateGame will be called once each n seconds
InvokeRepeating("callUpdateGame", 0.0f, DayTime);
}
// Update is called once per frame
void Update(){}
// calls update game
private void callUpdateGame()
{
if (gameManager != null)
{
gameManager.updateGame();
}
}
}