Skip to content
Snippets Groups Projects
RoundController.cs 885 B
Newer Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public interface IRoundCallback
{
    void OnRoundStart();
    void OnRoundEnd();
}
public class RoundController : MonoBehaviour
{

    public List<IRoundCallback> callbackObjects;
    bool running = false;
    [SerializeField] Sprite stopSprite, startSprite;

    //gets called, when Button for Start gets pressed
    public void OnStateChange(Button button)
    {
        if (running)
        {
            StopRound();
            button.image.sprite = startSprite;
            button.image.color = Color.green;
        }
        else
        {
            StartRound();
            button.image.sprite = stopSprite;
            button.image.color = Color.red;
        }
        running = !running;
    }

    void StartRound()
    {

    }

    void StopRound()
    {

    }

}