Added Main menu Changes to UI

Added Rules Menu Changes to UI
Added Cutscenes to the rules scene
Reorganised Files
This commit is contained in:
iDunnoDev
2022-06-22 13:30:58 +01:00
committed by iDunnoDev
parent e30ffcfc80
commit 0360907df1
1276 changed files with 55430 additions and 32901 deletions

View File

@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
public enum TimerDirection
{
TimerIncrement,
TimerDecrement
}
public class TimerHelper
{
private float _timerInterval;
private float _timerMax;
private float _timerTick;
private int _timesRun;
private bool _timerRepeats;
private TimerDirection _timerDirection;
public TimerHelper(float timeMax, bool repeating = true, TimerDirection direction = TimerDirection.TimerIncrement)
{
_timerMax = timeMax;
_timerRepeats = repeating;
_timerDirection = direction;
if (_timerDirection == TimerDirection.TimerDecrement)
{
_timerInterval = 0.0f;
_timerTick = -_timerMax;
}
else
{
_timerInterval = _timerMax;
_timerTick = 0.0f;
}
}
public float CurrentTick
{
get
{
return Math.Abs(_timerTick);
}
}
public int TimesRun
{
get
{
return _timesRun;
}
}
public bool HasTicked(float currentTimestamp)
{
if (_timerTick >= _timerInterval)
{
_timesRun++;
if (_timerRepeats)
{
RestartTimer();
}
return true;
}
else
{
_timerTick += currentTimestamp;
return false;
}
}
public void RestartTimer()
{
if (_timerDirection == TimerDirection.TimerDecrement)
{
_timerTick = -_timerMax;
}
else
{
_timerTick = 0.0f;
}
}
}