Add files via upload
This commit is contained in:
parent
310f5c8838
commit
7046716893
5 changed files with 31 additions and 5 deletions
15
README.md
15
README.md
|
@ -1,5 +1,9 @@
|
||||||
# Simple Tools
|
# Simple Tools
|
||||||
|
|
||||||
|
This package contains simple tools to use in your project.
|
||||||
|
|
||||||
|
This package will be updated once I find another useful tool or someone suggest me one.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **AudioManager** with Play, Pause and most of the other basic things, as well as some effects like FadeIn or FadeOut.
|
- **AudioManager** with Play, Pause and most of the other basic things, as well as some effects like FadeIn or FadeOut.
|
||||||
|
@ -17,11 +21,11 @@ First install the TextMeshPro and Cinemachine into your Unity project
|
||||||
|
|
||||||
### Git Installation (Best way to get latest version)
|
### 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/IntoTheDev/Save-System-for-Unity.git](https://github.com/IntoTheDev/Save-System-for-Unity.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
|
or
|
||||||
|
|
||||||
Open the manifest.json file of your Unity project. Add "com.geri.simpletools": "[https://github.com/IntoTheDev/Save-System-for-Unity.git](https://github.com/IntoTheDev/Save-System-for-Unity.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
|
### Manual Installation
|
||||||
|
|
||||||
|
@ -35,6 +39,7 @@ Download latest package from the Release section Import SimpleTools.unitypackage
|
||||||
AudioManager.instance.Play("Name"); //Plays the sound with that name
|
AudioManager.instance.Play("Name"); //Plays the sound with that name
|
||||||
AudioManager.instance.Play("Name", 1f); //Starts playing the sound "Name" in 1 second
|
AudioManager.instance.Play("Name", 1f); //Starts playing the sound "Name" in 1 second
|
||||||
AudioManager.instance.PlayOneShot("Name"); //Plays one shot of that sound (Useful for repeated sounds)
|
AudioManager.instance.PlayOneShot("Name"); //Plays one shot of that sound (Useful for repeated sounds)
|
||||||
|
AudioManager.instance.PlayWithIntro("Intro", "Loop"); //Plays the intro and then the loop
|
||||||
|
|
||||||
AudioManager.instance.Pause("Name"); //Pauses the sound
|
AudioManager.instance.Pause("Name"); //Pauses the sound
|
||||||
AudioManager.instance.UnPause("Name"); //Unpauses the sound
|
AudioManager.instance.UnPause("Name"); //Unpauses the sound
|
||||||
|
@ -90,3 +95,9 @@ Loader.Load("Scene"); //Loads a scene with a specific name
|
||||||
```csharp
|
```csharp
|
||||||
ScreenShake.Shake(1f, .25f); //Shakes the camera with an intensity and duration
|
ScreenShake.Shake(1f, .25f); //Shakes the camera with an intensity and duration
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
Also you can right click in the Hierarchy for easily creating some GameObjects with the Tools in it.
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e9c1d398f3d17184a97bce327ff06621
|
guid: ee23fd1b6b87e954f836c97747d4c083
|
||||||
TextScriptImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|
|
@ -73,6 +73,19 @@ public class AudioManager : MonoBehaviour{
|
||||||
s.source.volume = s.RandomVolume;
|
s.source.volume = s.RandomVolume;
|
||||||
s.source.PlayOneShot(s.clip);
|
s.source.PlayOneShot(s.clip);
|
||||||
}
|
}
|
||||||
|
public void PlayWithIntro(string intro, string song){
|
||||||
|
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == intro);
|
||||||
|
if (s == null){
|
||||||
|
Debug.LogWarning("Sound: " + intro + " not found!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s.source.pitch = s.RandomPitch;
|
||||||
|
s.source.volume = s.RandomVolume;
|
||||||
|
s.source.Play();
|
||||||
|
|
||||||
|
float introDuration = s.clip.length;
|
||||||
|
Play(song, introDuration);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Pause
|
#region Pause
|
||||||
public void Pause(string name){
|
public void Pause(string name){
|
||||||
|
|
|
@ -170,6 +170,7 @@ public class ToolsEditor{
|
||||||
progressBar.gameObject.AddComponent<LoadingProgressBar>();
|
progressBar.gameObject.AddComponent<LoadingProgressBar>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2019_3_OR_NEWER
|
||||||
[MenuItem("Assets/Create/Tools/Create Menu Scene")]
|
[MenuItem("Assets/Create/Tools/Create Menu Scene")]
|
||||||
static void CreateMenuScene(){
|
static void CreateMenuScene(){
|
||||||
EditorSceneManager.SaveOpenScenes();
|
EditorSceneManager.SaveOpenScenes();
|
||||||
|
@ -528,4 +529,5 @@ public class ToolsEditor{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"unityRelease": "30f1",
|
"unityRelease": "30f1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.cinemachine": "2.2.0",
|
"com.unity.cinemachine": "2.2.0",
|
||||||
"com.unity.textmeshpro": "1.0.21"
|
"com.unity.textmeshpro": "1.4.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"gamejam",
|
"gamejam",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue