Unverified Commit 750d7f6b authored by Gerard Gascón's avatar Gerard Gascón Committed by GitHub
Browse files

Added Timer

New version featuring a timer
parent f7c4067d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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/GerardGascon/SimpleTools.git](https://github.com/GerardGascon/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/Geri8/SimpleTools.git](https://github.com/Geri8/SimpleTools.git)

or

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)"
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)"

### Manual Installation

+1 −1
Original line number Diff line number Diff line
using UnityEngine;
using UnityEngine.Audio;

[CreateAssetMenu(fileName = "Sounds", menuName = "Tools/Sounds", order = 0)]
[CreateAssetMenu(fileName = "Sounds", menuName = "Simple Tools/Sounds", order = 11)]
public class Sounds : ScriptableObject{

    [Tooltip("The music mixer.")]
+1 −1
Original line number Diff line number Diff line
using UnityEngine;

[CreateAssetMenu(fileName = "New Character", menuName = "Tools/Character", order = 0)]
[CreateAssetMenu(fileName = "New Character", menuName = "Simple Tools/Character", order = 11)]
public class Dialogue : ScriptableObject{

    public bool displayName;
+11 −4
Original line number Diff line number Diff line
@@ -8,11 +8,16 @@ namespace TMPro{

    public class TMP_Animated : TextMeshProUGUI{

        float speed;
        float speed = 20;

        public TextRevealEvent onTextReveal;
        public DialogueEvent onDialogueFinish;

		void Update(){
            /*if(Application.isPlaying)
                this.Animate();*/
        }

		public void ReadText(string newText){
            text = string.Empty;

@@ -27,7 +32,7 @@ namespace TMPro{
            }

            bool isCustomTag(string tag){
                return tag.StartsWith("speed=") || tag.StartsWith("pause=");
                return tag.StartsWith("speed=") || tag.StartsWith("pause=") || tag.StartsWith("wave") || tag.StartsWith("rainbow") || tag.StartsWith("shake");
            }

            text = displayText;
@@ -45,7 +50,9 @@ namespace TMPro{
                            onTextReveal.Invoke(subTexts[subCounter][visibleCounter]);
                            visibleCounter++;
                            maxVisibleCharacters++;
                            yield return new WaitForSeconds(1f / speed);
                            //this.Animate();

                            yield return new WaitForSeconds(text[maxVisibleCharacters - 1] == ' ' ? 0 : (1f / speed));
                        }
                        visibleCounter = 0;
                    }
+12 −12
Original line number Diff line number Diff line
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -14,13 +13,13 @@ using System;

public class ToolsEditor{
    
    [MenuItem("GameObject/Tools/AudioManager", false, 10)]
    [MenuItem("GameObject/Simple Tools/AudioManager", false, 10)]
    static void CreateAudioManager(){
        GameObject audioManager = new GameObject("AudioManager");
        audioManager.AddComponent<AudioManager>();
    }

    [MenuItem("GameObject/Tools/Dialogue System", false, 10)]
    [MenuItem("GameObject/Simple Tools/Dialogue System", false, 10)]
    static void CreateDialogueSystem(){
        GameObject dialogueCanvas = new GameObject("DialogueCanvas");
        dialogueCanvas.AddComponent<RectTransform>();
@@ -51,7 +50,7 @@ public class ToolsEditor{
        dialogueSystem.nameField = name;
    }

    [MenuItem("GameObject/Tools/Camera Trigger/2D", false, 10)]
    [MenuItem("GameObject/Simple Tools/Camera Trigger/2D", false, 10)]
    static void CreateCameraTrigger2D(){
        GameObject cameraTrigger = new GameObject("CameraTrigger2D");
        cameraTrigger.AddComponent<BoxCollider2D>();
@@ -64,7 +63,7 @@ public class ToolsEditor{
        cam.m_Lens.Orthographic = true;
    }

    [MenuItem("GameObject/Tools/Camera Trigger/3D", false, 10)]
    [MenuItem("GameObject/Simple Tools/Camera Trigger/3D", false, 10)]
    static void CreateCameraTrigger3D(){
        GameObject cameraTrigger = new GameObject("CameraTrigger3D");
        cameraTrigger.AddComponent<BoxCollider>();
@@ -78,7 +77,7 @@ public class ToolsEditor{
    }

#if CINEMACHINE_271_OR_NEWER
    [MenuItem("GameObject/Tools/ScreenShake Camera/2D", false, 10)]
    [MenuItem("GameObject/Simple Tools/ScreenShake Camera/2D", false, 10)]
    static void CreateScreenShakeCamera2d(){
        GameObject screenShakeCamera = new GameObject("ScreenShakeCamera");
        CinemachineVirtualCamera vCam = screenShakeCamera.AddComponent<CinemachineVirtualCamera>();
@@ -92,7 +91,7 @@ public class ToolsEditor{
        shake.m_AmplitudeGain = 0f;
        shake.m_FrequencyGain = 1f;
    }
    [MenuItem("GameObject/Tools/ScreenShake Camera/3D", false, 10)]
    [MenuItem("GameObject/Simple Tools/ScreenShake Camera/3D", false, 10)]
    static void CreateScreenShakeCamera3d(){
        GameObject screenShakeCamera = new GameObject("ScreenShakeCamera");
        CinemachineVirtualCamera vCam = screenShakeCamera.AddComponent<CinemachineVirtualCamera>();
@@ -107,7 +106,7 @@ public class ToolsEditor{
        shake.m_FrequencyGain = 1f;
    }
#else
    [MenuItem("GameObject/Tools/ScreenShake Camera", false, 10)]
    [MenuItem("GameObject/Simple Tools/ScreenShake Camera", false, 10)]
    static void CreateScreenShakeCamera2d(){
        GameObject screenShakeCamera = new GameObject("ScreenShakeCamera");
        CinemachineVirtualCamera vCam = screenShakeCamera.AddComponent<CinemachineVirtualCamera>();
@@ -122,7 +121,8 @@ public class ToolsEditor{
    }
#endif

    [MenuItem("Assets/Create/Tools/Create Loading Scene")]
    [MenuItem("Assets/Create/Simple Tools/Create Loading Scene")]
    [MenuItem("Simple Tools/Create Loading Scene")]
    static void CreateLoadingScene(){
        EditorSceneManager.SaveOpenScenes();

@@ -163,7 +163,7 @@ public class ToolsEditor{
        progressBarTransform.anchoredPosition = Vector2.zero;
        progressBarTransform.sizeDelta = new Vector2Int(900, 20);

        progressBar.sprite = (Sprite)AssetDatabase.LoadAssetAtPath("Packages/com.geri.simpletools/Tools/Editor/Square.png", typeof(Sprite));
        progressBar.sprite = (Sprite)AssetDatabase.LoadAssetAtPath("Packages/com.geri.simpletools/Simple Tools/Editor/Square.png", typeof(Sprite));
        progressBar.type = Image.Type.Filled;
        progressBar.fillMethod = Image.FillMethod.Horizontal;
        progressBar.fillOrigin = (int)Image.OriginHorizontal.Left;
@@ -172,7 +172,8 @@ public class ToolsEditor{
    }

#if UNITY_2019_3_OR_NEWER
    [MenuItem("Assets/Create/Tools/Create Menu Scene")]
    [MenuItem("Assets/Create/Simple Tools/Create Menu Scene")]
    [MenuItem("Simple Tools/Create Menu Scene")]
    static void CreateMenuScene(){
        EditorSceneManager.SaveOpenScenes();

@@ -532,4 +533,3 @@ public class ToolsEditor{
    #endregion
#endif
}
#endif
Loading