mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 09:08:23 -05:00
33 lines
636 B
C#
33 lines
636 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
namespace UnityAtoms
|
|||
|
{
|
|||
|
[CreateAssetMenu(menuName = "Unity Atoms/Molecules/Timer/Timer")]
|
|||
|
public class Timer : ScriptableObject
|
|||
|
{
|
|||
|
public float TimeElapsed = 0f;
|
|||
|
public bool Started = false;
|
|||
|
|
|||
|
public void Start()
|
|||
|
{
|
|||
|
Started = true;
|
|||
|
}
|
|||
|
|
|||
|
public void Stop()
|
|||
|
{
|
|||
|
TimeElapsed = 0f;
|
|||
|
Started = false;
|
|||
|
}
|
|||
|
|
|||
|
public float GetElapsedTime()
|
|||
|
{
|
|||
|
return TimeElapsed;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsStarted()
|
|||
|
{
|
|||
|
return Started;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|