From 91604d39466d6ba1a7530d899d515e7befc52983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gasc=C3=B3n?= <52170489+GerardGascon@users.noreply.github.com> Date: Mon, 14 Jun 2021 09:18:03 +0200 Subject: [PATCH] Updated README --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 854060e..c45a3ab 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ First install the TextMeshPro and Cinemachine into your Unity project ### Git Installation (Best way to get latest version) -If you have git in your computer, you can open Package Manager inside Unity, select "Add package from Git url...", and paste link [https://github.com/Geri8/SimpleTools.git](https://github.com/Geri8/SimpleTools.git) +If you have git in your computer, you can open Package Manager inside Unity, select "Add package from Git url...", and paste link [https://github.com/GerardGascon/SimpleTools.git](https://github.com/GerardGascon/SimpleTools.git) or -Open the manifest.json file of your Unity project. Add "com.geri.simpletools": "[https://github.com/Geri8/SimpleTools.git](https://github.com/Geri8/SimpleTools.git)" +Open the manifest.json file of your Unity project. Add "com.geri.simpletools": "[https://github.com/GerardGascon/SimpleTools.git](https://github.com/GerardGascon/SimpleTools.git)" ### Manual Installation @@ -98,6 +98,24 @@ Loader.Load("Scene"); //Loads a scene with a specific name ScreenShake.Shake(1f, .25f); //Shakes the camera with an intensity and duration ``` +### Timer + +```csharp +using SimpleTools.Timer; + +//Setup a stopwatch that updates at an unscaled time +Timer timer = textMeshProText.SetupTimer(TimerType.Stopwatch, TimerUpdate.UnscaledTime); +//Setup a clock +Timer timer = textMeshProText.SetupTimer(TimerType.Clock, TimerUpdate.UnscaledTime); +//Setup a countdown with the default time of 60 seconds +Timer timer = textMeshProText.SetupTimer(TimerType.Countdown, TimerUpdate.UnscaledTime, 60f); + +timer.Play(); //Play or resume the timer +timer.Stop(); //Pause the timer +timer.ResetTimer(); //Pause and sets the time to the default one +timer.Restart(); //Restarts the timer +``` + ### Editor You can easily set up some things by right clicking in your Project Tab and then selecting Tools and clicking on the one you want to create.