1.Commit
This commit is contained in:
30
Assets/Scripts/Clock.cs
Normal file
30
Assets/Scripts/Clock.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user