init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
8
Assets/Tools/AudioManager.meta
Normal file
8
Assets/Tools/AudioManager.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1d98cf7b5d008ba4a832612b94195e04
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
196
Assets/Tools/AudioManager/AudioManager.cs
Normal file
196
Assets/Tools/AudioManager/AudioManager.cs
Normal file
|
@ -0,0 +1,196 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
public class AudioManager : MonoBehaviour{
|
||||
|
||||
public static AudioManager instance;
|
||||
|
||||
[SerializeField] Sounds soundList = default;
|
||||
|
||||
void Awake(){
|
||||
if(instance == null){
|
||||
instance = this;
|
||||
}else{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
foreach(Sounds.List s in soundList.sounds){
|
||||
GameObject sound = new GameObject(s.name);
|
||||
sound.transform.parent = transform;
|
||||
s.source = sound.AddComponent<AudioSource>();
|
||||
|
||||
if(soundList.mainMixer && soundList.sfxMixer){
|
||||
if (s.type == Sounds.List.Type.Music)
|
||||
s.source.outputAudioMixerGroup = soundList.mainMixer;
|
||||
else
|
||||
s.source.outputAudioMixerGroup = soundList.sfxMixer;
|
||||
}
|
||||
|
||||
s.source.clip = s.clip;
|
||||
|
||||
s.source.volume = (s.volume.x + s.volume.y) / 2;
|
||||
s.source.pitch = (s.pitch.x + s.pitch.y) / 2;
|
||||
s.source.loop = s.loop;
|
||||
}
|
||||
}
|
||||
|
||||
public void Play(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if(s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.Play();
|
||||
}
|
||||
public void Play(string name, float delay){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.PlayDelayed(delay);
|
||||
}
|
||||
public void PlayOneShot(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.PlayOneShot(s.clip);
|
||||
}
|
||||
public void Pause(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.Pause();
|
||||
}
|
||||
public void UnPause(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.UnPause();
|
||||
}
|
||||
public void Stop(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = s.RandomVolume;
|
||||
s.source.Stop();
|
||||
}
|
||||
public void StopAll(){
|
||||
foreach (Sounds.List s in soundList.sounds){
|
||||
if (s.source){
|
||||
s.source.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AudioSource GetSource(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return null;
|
||||
}
|
||||
return s.source;
|
||||
}
|
||||
|
||||
public void FadeIn(string name, float duration){
|
||||
StartCoroutine(FadeInCoroutine(name, duration));
|
||||
}
|
||||
IEnumerator FadeInCoroutine(string name, float fadeTime){
|
||||
AudioSource audioSource = GetSource(name);
|
||||
if (audioSource != null && !audioSource.isPlaying){
|
||||
float volume = audioSource.volume;
|
||||
audioSource.volume = 0;
|
||||
audioSource.Play();
|
||||
while (audioSource.volume < volume){
|
||||
audioSource.volume += Time.deltaTime / fadeTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
audioSource.volume = volume;
|
||||
}
|
||||
}
|
||||
public void FadeOut(string name, float duration){
|
||||
StartCoroutine(FadeOutCoroutine(name, duration));
|
||||
}
|
||||
IEnumerator FadeOutCoroutine(string name, float fadeTime){
|
||||
AudioSource audioSource = GetSource(name);
|
||||
|
||||
if (audioSource && audioSource.isPlaying){
|
||||
float startVolume = audioSource.volume;
|
||||
|
||||
while (audioSource.volume > 0){
|
||||
audioSource.volume -= startVolume * Time.deltaTime / fadeTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
audioSource.Stop();
|
||||
audioSource.volume = startVolume;
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayMuted(string name){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
return;
|
||||
}
|
||||
s.source.pitch = s.RandomPitch;
|
||||
s.source.volume = 0f;
|
||||
s.source.Play();
|
||||
}
|
||||
public void FadeMutedIn(string name, float duration){
|
||||
StartCoroutine(FadeMutedInCoroutine(name, duration));
|
||||
}
|
||||
IEnumerator FadeMutedInCoroutine(string name, float fadeTime){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
yield break;
|
||||
}
|
||||
|
||||
while (s.source.volume < s.volume.y){
|
||||
s.source.volume += Time.deltaTime / fadeTime;
|
||||
yield return null;
|
||||
}
|
||||
s.source.volume = s.volume.y;
|
||||
}
|
||||
public void FadeMutedOut(string name, float duration){
|
||||
StartCoroutine(FadeMutedOutCoroutine(name, duration));
|
||||
}
|
||||
IEnumerator FadeMutedOutCoroutine(string name, float fadeTime){
|
||||
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == name);
|
||||
if (s == null){
|
||||
Debug.LogWarning("Sound: " + name + " not found!");
|
||||
yield break;
|
||||
}
|
||||
|
||||
while (s.source.volume > 0){
|
||||
s.source.volume -= Time.deltaTime / fadeTime;
|
||||
yield return null;
|
||||
}
|
||||
s.source.volume = 0;
|
||||
}
|
||||
}
|
11
Assets/Tools/AudioManager/AudioManager.cs.meta
Normal file
11
Assets/Tools/AudioManager/AudioManager.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d2879f3876727040b4f0cc799ec7ada
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
51
Assets/Tools/AudioManager/Sounds.cs
Normal file
51
Assets/Tools/AudioManager/Sounds.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using Geri.MinMaxSlider;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
[CreateAssetMenu(fileName = "Sounds", menuName = "Tools/Sounds")]
|
||||
public class Sounds : ScriptableObject{
|
||||
|
||||
[Tooltip("The music mixer.")]
|
||||
public AudioMixerGroup mainMixer = default;
|
||||
[Tooltip("The SFX mixer.")]
|
||||
public AudioMixerGroup sfxMixer = default;
|
||||
|
||||
public List[] sounds;
|
||||
|
||||
[System.Serializable] public class List{
|
||||
[Tooltip("Name of the sound. Each name has to be different between each other.")]
|
||||
public string name;
|
||||
|
||||
public AudioClip clip;
|
||||
|
||||
[System.Serializable] public enum Type { Music, SFX }
|
||||
[Space]
|
||||
[Tooltip("Is it part of the music or the SFX?")] public Type type;
|
||||
|
||||
[Space]
|
||||
[Tooltip("Default volume of the sound."), MinMaxSlider(0f, 1f)] public Vector2 volume;
|
||||
[Tooltip("Default pitch of the sound."), MinMaxSlider(.1f, 3f)] public Vector2 pitch;
|
||||
|
||||
public bool loop;
|
||||
|
||||
[HideInInspector] public AudioSource source;
|
||||
|
||||
float randomVolume;
|
||||
public float RandomVolume{
|
||||
get{
|
||||
randomVolume = Random.Range(volume.x, volume.y);
|
||||
return randomVolume;
|
||||
}
|
||||
}
|
||||
|
||||
float randomPitch;
|
||||
public float RandomPitch{
|
||||
get{
|
||||
randomPitch = Random.Range(pitch.x, pitch.y);
|
||||
return randomPitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Tools/AudioManager/Sounds.cs.meta
Normal file
11
Assets/Tools/AudioManager/Sounds.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ded47588579f3047b1c3cd72cd87044
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Tools/AudioManager/d3e5dd010fe84e70ac9cd20fc7d96c97.png
(Stored with Git LFS)
Normal file
BIN
Assets/Tools/AudioManager/d3e5dd010fe84e70ac9cd20fc7d96c97.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -0,0 +1,130 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 23c2f6dcbe236d044bcf869f85fae215
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/Cinemachine.meta
Normal file
8
Assets/Tools/Cinemachine.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5a2ff5ceb779d824d811d139fa608262
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
27
Assets/Tools/Cinemachine/CMCameraTrigger.cs
Normal file
27
Assets/Tools/Cinemachine/CMCameraTrigger.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cinemachine;
|
||||
|
||||
public class CMCameraTrigger : MonoBehaviour{
|
||||
|
||||
CinemachineVirtualCamera vcam;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake(){
|
||||
vcam = GetComponentInChildren<CinemachineVirtualCamera>();
|
||||
vcam.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
if (col.CompareTag("Player")){
|
||||
vcam.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit2D(Collider2D col){
|
||||
if (col.CompareTag("Player")){
|
||||
vcam.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Tools/Cinemachine/CMCameraTrigger.cs.meta
Normal file
11
Assets/Tools/Cinemachine/CMCameraTrigger.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 368758c1440a4cb4c867e140e8934c09
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/Cinemachine/DollyTrackAnimation.meta
Normal file
8
Assets/Tools/Cinemachine/DollyTrackAnimation.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 64770ab13b014f446bb4ad495e0b508c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
105
Assets/Tools/Cinemachine/DollyTrackAnimation/CMCameraRail.cs
Normal file
105
Assets/Tools/Cinemachine/DollyTrackAnimation/CMCameraRail.cs
Normal file
|
@ -0,0 +1,105 @@
|
|||
using Cinemachine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CMCameraRail : MonoBehaviour{
|
||||
|
||||
[SerializeField] CinemachineVirtualCamera dollyTrackCamera = default;
|
||||
CinemachineTrackedDolly cameraTrack;
|
||||
|
||||
[Space]
|
||||
[SerializeField] Waypoint[] waypoints = default;
|
||||
int totalCount;
|
||||
int currentCount;
|
||||
|
||||
bool finished;
|
||||
bool paused;
|
||||
|
||||
float easedPercentBetweenWaypoints;
|
||||
float speed;
|
||||
float currentEase;
|
||||
float percentBetweenWaypoints;
|
||||
float nextPos;
|
||||
float lastFieldOfView;
|
||||
|
||||
void Awake(){
|
||||
totalCount = waypoints.Length - 1;
|
||||
if(dollyTrackCamera != null){
|
||||
cameraTrack = dollyTrackCamera.GetCinemachineComponent<CinemachineTrackedDolly>();
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if(!finished && !paused){
|
||||
Waypoint waypoint = waypoints[currentCount];
|
||||
|
||||
if(currentCount == 0){
|
||||
speed = Time.deltaTime / waypoint.timeBetweenWaypoints * waypoint.endWaypoint;
|
||||
percentBetweenWaypoints += speed / waypoint.endWaypoint;
|
||||
percentBetweenWaypoints = Mathf.Clamp01(percentBetweenWaypoints);
|
||||
easedPercentBetweenWaypoints = Ease(percentBetweenWaypoints);
|
||||
|
||||
nextPos = easedPercentBetweenWaypoints * waypoint.endWaypoint;
|
||||
}else{
|
||||
speed = Time.deltaTime / waypoint.timeBetweenWaypoints * (waypoint.endWaypoint - waypoints[currentCount - 1].endWaypoint);
|
||||
percentBetweenWaypoints += speed / (waypoint.endWaypoint - waypoints[currentCount - 1].endWaypoint);
|
||||
percentBetweenWaypoints = Mathf.Clamp01(percentBetweenWaypoints);
|
||||
easedPercentBetweenWaypoints = Ease(percentBetweenWaypoints);
|
||||
|
||||
nextPos = waypoints[currentCount - 1].endWaypoint + easedPercentBetweenWaypoints * (waypoint.endWaypoint - waypoints[currentCount - 1].endWaypoint);
|
||||
}
|
||||
|
||||
dollyTrackCamera.m_Lens.FieldOfView = Mathf.Lerp(lastFieldOfView, waypoint.fieldOfView, easedPercentBetweenWaypoints);
|
||||
|
||||
if (cameraTrack.m_PathPosition < waypoint.endWaypoint){
|
||||
cameraTrack.m_PathPosition = nextPos;
|
||||
}else{
|
||||
NextWaypoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float Ease(float x){
|
||||
if (waypoints[currentCount].ease){
|
||||
float a = currentEase + 1;
|
||||
return Mathf.Pow(x, a) / (Mathf.Pow(x, a) + Mathf.Pow(1 - x, a));
|
||||
}else{
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Starts playing the cutscene. </summary>
|
||||
public void StartRail(){
|
||||
lastFieldOfView = dollyTrackCamera.m_Lens.FieldOfView;
|
||||
Waypoint waypoint = waypoints[currentCount];
|
||||
if (waypoint.startDelay > 0){
|
||||
paused = true;
|
||||
StartCoroutine(DelayMovement(waypoint.startDelay));
|
||||
}
|
||||
currentEase = waypoint.ease ? waypoint.easeAmount : 1;
|
||||
}
|
||||
|
||||
void NextWaypoint(){
|
||||
lastFieldOfView = dollyTrackCamera.m_Lens.FieldOfView;
|
||||
if (currentCount >= totalCount){
|
||||
Debug.Log("Finish");
|
||||
finished = true;
|
||||
}else{
|
||||
percentBetweenWaypoints = 0;
|
||||
currentCount++;
|
||||
Waypoint waypoint = waypoints[currentCount];
|
||||
if(waypoint.startDelay > 0){
|
||||
paused = true;
|
||||
StartCoroutine(DelayMovement(waypoint.startDelay));
|
||||
}
|
||||
currentEase = waypoint.ease ? waypoint.easeAmount : 1;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator DelayMovement(float delay){
|
||||
yield return new WaitForSeconds(delay);
|
||||
paused = false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6e80df5e5cd6b984396c057f7ce9a9c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Tools/Cinemachine/DollyTrackAnimation/Waypoint.cs
Normal file
18
Assets/Tools/Cinemachine/DollyTrackAnimation/Waypoint.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class Waypoint{
|
||||
|
||||
[Min(0)] public float startDelay;
|
||||
|
||||
[Header("Easing")]
|
||||
public bool ease;
|
||||
[Range(0f, 2f)] public float easeAmount;
|
||||
|
||||
[Header("Waypoints")]
|
||||
[Min(0)] public float timeBetweenWaypoints;
|
||||
[Min(0)] public int endWaypoint;
|
||||
|
||||
[Header("Field of View")]
|
||||
[Range(1, 179)] public float fieldOfView = 60;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cbcbf05409a71c34498aea255a6ba921
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/Tools/Cinemachine/ScreenShake.cs
Normal file
33
Assets/Tools/Cinemachine/ScreenShake.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using Cinemachine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public static class ScreenShake{
|
||||
|
||||
static CinemachineVirtualCamera vCam;
|
||||
static ScreenShakeUpdate shakeUpdate;
|
||||
|
||||
class ScreenShakeUpdate : MonoBehaviour {
|
||||
[HideInInspector] public float shakeTimer;
|
||||
[HideInInspector] public float shakeTimerTotal;
|
||||
[HideInInspector] public float startingIntensity;
|
||||
|
||||
void Update(){
|
||||
if (shakeTimer > 0){
|
||||
shakeTimer -= Time.deltaTime;
|
||||
CinemachineBasicMultiChannelPerlin multiChannelPerlin = vCam.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
|
||||
multiChannelPerlin.m_AmplitudeGain = Mathf.Lerp(startingIntensity, 0f, 1 - (shakeTimer / shakeTimerTotal));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Shake(float intensity, float time){
|
||||
if(vCam == null || shakeUpdate == null){
|
||||
vCam = Camera.main.GetComponent<CinemachineBrain>().ActiveVirtualCamera.VirtualCameraGameObject.GetComponent<CinemachineVirtualCamera>();
|
||||
shakeUpdate = new GameObject("ShakeUpdate").AddComponent<ScreenShakeUpdate>();
|
||||
}
|
||||
shakeUpdate.startingIntensity = intensity;
|
||||
shakeUpdate.shakeTimer = shakeUpdate.shakeTimerTotal = time;
|
||||
}
|
||||
}
|
11
Assets/Tools/Cinemachine/ScreenShake.cs.meta
Normal file
11
Assets/Tools/Cinemachine/ScreenShake.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 181034c7ad5ece241a2737ab35d47c5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/DialogueSystem.meta
Normal file
8
Assets/Tools/DialogueSystem.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 645cca644899cc74882ea9bc1d9c5aa9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
10
Assets/Tools/DialogueSystem/Dialogue.cs
Normal file
10
Assets/Tools/DialogueSystem/Dialogue.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "New Character", menuName = "Tools/Character")]
|
||||
public class Dialogue : ScriptableObject{
|
||||
|
||||
public string characterName;
|
||||
[TextArea] public string[] sentences;
|
||||
}
|
11
Assets/Tools/DialogueSystem/Dialogue.cs.meta
Normal file
11
Assets/Tools/DialogueSystem/Dialogue.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bd553cd05b84d614b998afe62e37c17c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
44
Assets/Tools/DialogueSystem/DialogueSystem.cs
Normal file
44
Assets/Tools/DialogueSystem/DialogueSystem.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class DialogueSystem : MonoBehaviour{
|
||||
|
||||
public TextMeshProUGUI nameText;
|
||||
public TextMeshProUGUI dialogueText;
|
||||
public TMP_Animated dialogue;
|
||||
|
||||
public Queue<string> sentences;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
sentences = new Queue<string>();
|
||||
}
|
||||
|
||||
public void StartDialogue(Dialogue dialogue){
|
||||
nameText.text = dialogue.characterName;
|
||||
|
||||
sentences.Clear();
|
||||
|
||||
foreach(string sentence in dialogue.sentences){
|
||||
sentences.Enqueue(sentence);
|
||||
}
|
||||
|
||||
DisplayNextSentence();
|
||||
}
|
||||
|
||||
public void DisplayNextSentence(){
|
||||
if(sentences.Count == 0){
|
||||
EndDialogue();
|
||||
return;
|
||||
}
|
||||
|
||||
string sentence = sentences.Dequeue();
|
||||
dialogue.ReadText(sentence);
|
||||
}
|
||||
|
||||
void EndDialogue(){
|
||||
Debug.Log("End of conversation.");
|
||||
}
|
||||
}
|
11
Assets/Tools/DialogueSystem/DialogueSystem.cs.meta
Normal file
11
Assets/Tools/DialogueSystem/DialogueSystem.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: caad12703fd5c3349acc637253734ac9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
Assets/Tools/DialogueSystem/DialogueTrigger.cs
Normal file
13
Assets/Tools/DialogueSystem/DialogueTrigger.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DialogueTrigger : MonoBehaviour{
|
||||
|
||||
public Dialogue dialogue;
|
||||
|
||||
/// <summary> Start the dialogue specified on the inspector </summary>
|
||||
public void TriggerDialogue(){
|
||||
FindObjectOfType<DialogueSystem>().StartDialogue(dialogue);
|
||||
}
|
||||
}
|
11
Assets/Tools/DialogueSystem/DialogueTrigger.cs.meta
Normal file
11
Assets/Tools/DialogueSystem/DialogueTrigger.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f15c572386779eb4aa5d6e8471fba51d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
72
Assets/Tools/DialogueSystem/TMP_Animated.cs
Normal file
72
Assets/Tools/DialogueSystem/TMP_Animated.cs
Normal file
|
@ -0,0 +1,72 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace TMPro{
|
||||
[System.Serializable] public class TextRevealEvent : UnityEvent<char> { }
|
||||
[System.Serializable] public class DialogueEvent : UnityEvent { }
|
||||
|
||||
public class TMP_Animated : TextMeshProUGUI{
|
||||
|
||||
float speed;
|
||||
|
||||
public TextRevealEvent onTextReveal;
|
||||
public DialogueEvent onDialogueFinish;
|
||||
|
||||
public void ReadText(string newText){
|
||||
text = string.Empty;
|
||||
|
||||
string[] subTexts = newText.Split('<', '>');
|
||||
|
||||
string displayText = "";
|
||||
for (int i = 0; i < subTexts.Length; i++){
|
||||
if (i % 2 == 0)
|
||||
displayText += subTexts[i];
|
||||
else if (!isCustomTag(subTexts[i].Replace(" ", "")))
|
||||
displayText += $"<{subTexts[i]}>";
|
||||
}
|
||||
|
||||
bool isCustomTag(string tag){
|
||||
return tag.StartsWith("speed=") || tag.StartsWith("pause=");
|
||||
}
|
||||
|
||||
text = displayText;
|
||||
maxVisibleCharacters = 0;
|
||||
StartCoroutine(Read());
|
||||
|
||||
IEnumerator Read(){
|
||||
int subCounter = 0;
|
||||
int visibleCounter = 0;
|
||||
while(subCounter < subTexts.Length){
|
||||
if(subCounter % 2 == 1){
|
||||
yield return EvaluateTag(subTexts[subCounter].Replace(" ", ""));
|
||||
}else{
|
||||
while(visibleCounter < subTexts[subCounter].Length){
|
||||
onTextReveal.Invoke(subTexts[subCounter][visibleCounter]);
|
||||
visibleCounter++;
|
||||
maxVisibleCharacters++;
|
||||
yield return new WaitForSeconds(1f / speed);
|
||||
}
|
||||
visibleCounter = 0;
|
||||
}
|
||||
subCounter++;
|
||||
}
|
||||
yield return null;
|
||||
|
||||
WaitForSeconds EvaluateTag(string tag){
|
||||
if (tag.Length > 0){
|
||||
if (tag.StartsWith("speed=")){
|
||||
speed = float.Parse(tag.Split('=')[1]);
|
||||
}else if (tag.StartsWith("pause=")){
|
||||
return new WaitForSeconds(float.Parse(tag.Split('=')[1]));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
onDialogueFinish.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Tools/DialogueSystem/TMP_Animated.cs.meta
Normal file
11
Assets/Tools/DialogueSystem/TMP_Animated.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f713d84a3ae882945800780459e26170
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/Menu.meta
Normal file
8
Assets/Tools/Menu.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ce31707f0d21dca449c23caec3a42cb5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
96
Assets/Tools/Menu/MenuController.cs
Normal file
96
Assets/Tools/Menu/MenuController.cs
Normal file
|
@ -0,0 +1,96 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class MenuController : MonoBehaviour{
|
||||
|
||||
[SerializeField] AudioMixer mainMixer = default;
|
||||
[Tooltip("The music volume the first time you start the game")] [SerializeField, Range(0, 1)] float defaultMusicValue = 1f;
|
||||
[Tooltip("The SFX volume the first time you start the game")] [SerializeField, Range(0, 1)] float defaultSfxValue = 1f;
|
||||
[SerializeField] Slider musicSlider = default;
|
||||
[SerializeField] Slider sfxSlider = default;
|
||||
|
||||
[Space]
|
||||
[SerializeField] TMP_Dropdown qualityDropdown = default;
|
||||
int qualitySelected;
|
||||
|
||||
[Space]
|
||||
[SerializeField] TMP_Dropdown resolutionDropdown = default;
|
||||
Resolution[] resolutions;
|
||||
int currentResolutionIndex;
|
||||
|
||||
void Awake(){
|
||||
if (resolutionDropdown != null){
|
||||
resolutions = Screen.resolutions.Select(resolution => new Resolution { width = resolution.width, height = resolution.height }).Distinct().ToArray();
|
||||
resolutionDropdown.ClearOptions();
|
||||
|
||||
List<string> options = new List<string>();
|
||||
for (int i = 0; i < resolutions.Length; i++){
|
||||
string option = resolutions[i].width + "x" + resolutions[i].height;
|
||||
options.Add(option);
|
||||
|
||||
if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height){
|
||||
currentResolutionIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
resolutions.Reverse();
|
||||
|
||||
resolutionDropdown.AddOptions(options);
|
||||
resolutionDropdown.value = currentResolutionIndex;
|
||||
resolutionDropdown.RefreshShownValue();
|
||||
}
|
||||
|
||||
if(qualityDropdown != null){
|
||||
if (PlayerPrefs.HasKey("QualitySelected")){
|
||||
qualitySelected = PlayerPrefs.GetInt("QualitySelected");
|
||||
}else{
|
||||
qualitySelected = qualityDropdown.value;
|
||||
}
|
||||
|
||||
qualityDropdown.value = qualitySelected;
|
||||
QualitySettings.SetQualityLevel(qualitySelected);
|
||||
}
|
||||
}
|
||||
|
||||
void Start(){
|
||||
if (musicSlider != null && sfxSlider != null){
|
||||
musicSlider.value = PlayerPrefs.GetFloat("MusicVolume", defaultMusicValue);
|
||||
sfxSlider.value = PlayerPrefs.GetFloat("SFXVolume", defaultSfxValue);
|
||||
}
|
||||
}
|
||||
|
||||
//Needs a slider between 0.0001 and 1
|
||||
public void SetMusicVolume(float sliderValue){
|
||||
mainMixer.SetFloat("Master", Mathf.Log10(sliderValue) * 20);
|
||||
PlayerPrefs.SetFloat("MusicVolume", sliderValue);
|
||||
}
|
||||
|
||||
//Needs a slider between 0.0001 and 1
|
||||
public void SetSfxVolume(float sliderValue){
|
||||
mainMixer.SetFloat("SFX", Mathf.Log10(sliderValue) * 20);
|
||||
PlayerPrefs.SetFloat("SFXVolume", sliderValue);
|
||||
}
|
||||
|
||||
public void SetQuality(int qualityIndex){
|
||||
QualitySettings.SetQualityLevel(qualityIndex);
|
||||
PlayerPrefs.SetInt("QualitySelected", qualityIndex);
|
||||
}
|
||||
|
||||
public void SetResolution(int resolutionIndex){
|
||||
Resolution resolution = resolutions[resolutionIndex];
|
||||
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
|
||||
}
|
||||
|
||||
public void Play(){
|
||||
|
||||
}
|
||||
|
||||
public void Quit(){
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
11
Assets/Tools/Menu/MenuController.cs.meta
Normal file
11
Assets/Tools/Menu/MenuController.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1e26602e8c04bfd488f5d150c29aed57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/ObjectPooler.meta
Normal file
8
Assets/Tools/ObjectPooler.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ec26cabd12646bb47bbe875cc4577e25
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
3
Assets/Tools/ObjectPooler/IPooledObject.cs
Normal file
3
Assets/Tools/ObjectPooler/IPooledObject.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
public interface IPooledObject{
|
||||
void OnObjectSpawn();
|
||||
}
|
11
Assets/Tools/ObjectPooler/IPooledObject.cs.meta
Normal file
11
Assets/Tools/ObjectPooler/IPooledObject.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f901e5ecf80a03c43b4375b93741a3bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
19
Assets/Tools/ObjectPooler/Pool.cs
Normal file
19
Assets/Tools/ObjectPooler/Pool.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "New Pool", menuName = "Tools/Pool")]
|
||||
public class Pool : ScriptableObject{
|
||||
|
||||
public List<PoolPrefab> pools;
|
||||
[System.Serializable]
|
||||
public class PoolPrefab{
|
||||
public string tag;
|
||||
public GameObject prefab;
|
||||
public bool undetermined;
|
||||
public int size;
|
||||
|
||||
[HideInInspector] public Queue<GameObject> determinedPool;
|
||||
[HideInInspector] public List<GameObject> undeterminedPool;
|
||||
}
|
||||
}
|
11
Assets/Tools/ObjectPooler/Pool.cs.meta
Normal file
11
Assets/Tools/ObjectPooler/Pool.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b5ff40c8bb5e75d4fabf7bd1d6a59c68
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
318
Assets/Tools/ObjectPooler/Pooler.cs
Normal file
318
Assets/Tools/ObjectPooler/Pooler.cs
Normal file
|
@ -0,0 +1,318 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public static class Pooler{
|
||||
|
||||
class PoolChecker : MonoBehaviour {
|
||||
public string poolTag;
|
||||
}
|
||||
|
||||
static Dictionary<string, Pool.PoolPrefab> poolDictionary;
|
||||
static Scene poolScene;
|
||||
|
||||
public static void CreatePools(Pool pool){
|
||||
poolDictionary = new Dictionary<string, Pool.PoolPrefab>();
|
||||
poolScene = SceneManager.CreateScene("PoolScene");
|
||||
|
||||
foreach(Pool.PoolPrefab p in pool.pools){
|
||||
if (!p.undetermined){
|
||||
p.determinedPool = new Queue<GameObject>();
|
||||
for (int i = 0; i < p.size; i++){
|
||||
GameObject obj = Object.Instantiate(p.prefab);
|
||||
obj.SetActive(false);
|
||||
obj.AddComponent<PoolChecker>().poolTag = p.tag;
|
||||
SceneManager.MoveGameObjectToScene(obj, poolScene);
|
||||
p.determinedPool.Enqueue(obj);
|
||||
}
|
||||
}else{
|
||||
p.undeterminedPool = new List<GameObject>();
|
||||
}
|
||||
poolDictionary.Add(p.tag, p);
|
||||
}
|
||||
}
|
||||
public static void CreatePools(Pool[] pools){
|
||||
poolDictionary = new Dictionary<string, Pool.PoolPrefab>();
|
||||
poolScene = SceneManager.CreateScene("PoolScene");
|
||||
|
||||
for (int i = 0; i < pools.Length; i++){
|
||||
foreach (Pool.PoolPrefab p in pools[i].pools){
|
||||
if (!p.undetermined){
|
||||
p.determinedPool = new Queue<GameObject>();
|
||||
for (int j = 0; j < p.size; j++){
|
||||
GameObject obj = Object.Instantiate(p.prefab);
|
||||
obj.SetActive(false);
|
||||
obj.AddComponent<PoolChecker>().poolTag = p.tag;
|
||||
SceneManager.MoveGameObjectToScene(obj, poolScene);
|
||||
p.determinedPool.Enqueue(obj);
|
||||
}
|
||||
}else{
|
||||
p.undeterminedPool = new List<GameObject>();
|
||||
}
|
||||
poolDictionary.Add(p.tag, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void Destroy(GameObject gameObject){
|
||||
PoolChecker poolChecker = gameObject.GetComponent<PoolChecker>();
|
||||
if (poolChecker == null){
|
||||
Debug.LogWarning("GameObject: " + gameObject + " isn't from a pool", gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
gameObject.transform.SetParent(null);
|
||||
SceneManager.MoveGameObjectToScene(gameObject, poolScene);
|
||||
|
||||
if (poolDictionary.ContainsKey(poolChecker.poolTag)){
|
||||
Pool.PoolPrefab pool = poolDictionary[poolChecker.poolTag];
|
||||
if (pool.undetermined){
|
||||
gameObject.SetActive(false);
|
||||
pool.undeterminedPool.Remove(gameObject);
|
||||
}else{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = Quaternion.identity;
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if(pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = Quaternion.identity;
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab, position, Quaternion.identity);
|
||||
SceneManager.MoveGameObjectToScene(objectToSpawn, poolScene);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if(pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position, Transform parent){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = Quaternion.identity;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if (pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = Quaternion.identity;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab, position, Quaternion.identity, parent);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if (pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position, Transform parent, bool instantiateInWorldSpace){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!instantiateInWorldSpace){
|
||||
SpawnFromPool(tag, position, parent);
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = Quaternion.identity;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if (pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = Quaternion.identity;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab);
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = Quaternion.identity;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if (pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position, Quaternion rotation){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = rotation;
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if (pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = rotation;
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab, position, rotation);
|
||||
SceneManager.MoveGameObjectToScene(objectToSpawn, poolScene);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if (pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position, Quaternion rotation, Transform parent){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = rotation;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if (pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.position = position;
|
||||
objectToSpawn.transform.rotation = rotation;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab, position, rotation, parent);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if (pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
public static GameObject SpawnFromPool(string tag, Vector3 position, Quaternion rotation, Transform parent, bool instantiateInWorldSpace){
|
||||
if (!poolDictionary.ContainsKey(tag)){
|
||||
Debug.Log("Pool with tag " + tag + " doesn't exist.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!instantiateInWorldSpace){
|
||||
SpawnFromPool(tag, position, rotation, parent);
|
||||
}
|
||||
|
||||
Pool.PoolPrefab pool = poolDictionary[tag];
|
||||
GameObject objectToSpawn = null;
|
||||
if (!pool.undetermined){
|
||||
objectToSpawn = pool.determinedPool.Dequeue();
|
||||
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = rotation;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
|
||||
pool.determinedPool.Enqueue(objectToSpawn);
|
||||
}else{
|
||||
if (pool.undeterminedPool.Count != 0){
|
||||
int lastIndex = pool.undeterminedPool.Count - 1;
|
||||
objectToSpawn = pool.undeterminedPool[lastIndex];
|
||||
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = rotation;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.SetActive(true);
|
||||
}else{
|
||||
objectToSpawn = Object.Instantiate(pool.prefab);
|
||||
objectToSpawn.transform.localPosition = position;
|
||||
objectToSpawn.transform.localRotation = rotation;
|
||||
objectToSpawn.transform.SetParent(parent);
|
||||
objectToSpawn.AddComponent<PoolChecker>().poolTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
IPooledObject pooledObj = objectToSpawn.GetComponent<IPooledObject>();
|
||||
if (pooledObj != null){
|
||||
pooledObj.OnObjectSpawn();
|
||||
}
|
||||
return objectToSpawn;
|
||||
}
|
||||
}
|
11
Assets/Tools/ObjectPooler/Pooler.cs.meta
Normal file
11
Assets/Tools/ObjectPooler/Pooler.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 05981bd6149198c4594304b79460229f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/SceneManager.meta
Normal file
8
Assets/Tools/SceneManager.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7fab4cee4244fe944894c2ed51272d02
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
46
Assets/Tools/SceneManager/Loader.cs
Normal file
46
Assets/Tools/SceneManager/Loader.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public static class Loader{
|
||||
|
||||
class LoadingMonoBehaviour : MonoBehaviour { }
|
||||
|
||||
static Action onLoaderCallback;
|
||||
static AsyncOperation loadingAsyncOperation;
|
||||
|
||||
public static void Load(int scene){
|
||||
onLoaderCallback = () => {
|
||||
GameObject loadingGameObject = new GameObject("LoadingGameObject");
|
||||
loadingGameObject.AddComponent<LoadingMonoBehaviour>().StartCoroutine(LoadSceneAsync(scene));
|
||||
};
|
||||
|
||||
SceneManager.LoadScene("Loading");
|
||||
}
|
||||
|
||||
static IEnumerator LoadSceneAsync(int scene){
|
||||
yield return null;
|
||||
loadingAsyncOperation = SceneManager.LoadSceneAsync(scene);
|
||||
|
||||
while (!loadingAsyncOperation.isDone){
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static float GetLoadingProgress(){
|
||||
if(loadingAsyncOperation != null){
|
||||
return loadingAsyncOperation.progress;
|
||||
}else{
|
||||
return 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoaderCallback(){
|
||||
if(onLoaderCallback != null){
|
||||
onLoaderCallback();
|
||||
onLoaderCallback = null;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Tools/SceneManager/Loader.cs.meta
Normal file
11
Assets/Tools/SceneManager/Loader.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f063a9d603510c141ab14838d5426a9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Assets/Tools/SceneManager/LoaderCallback.cs
Normal file
16
Assets/Tools/SceneManager/LoaderCallback.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class LoaderCallback : MonoBehaviour{
|
||||
|
||||
bool isFirstUpdate = true;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (isFirstUpdate){
|
||||
isFirstUpdate = false;
|
||||
Loader.LoaderCallback();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Tools/SceneManager/LoaderCallback.cs.meta
Normal file
11
Assets/Tools/SceneManager/LoaderCallback.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26cb7a3b5197df940891506a87636cf7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
19
Assets/Tools/SceneManager/LoadingProgressBar.cs
Normal file
19
Assets/Tools/SceneManager/LoadingProgressBar.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class LoadingProgressBar : MonoBehaviour{
|
||||
|
||||
Image image;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake(){
|
||||
image = transform.GetComponent<Image>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
image.fillAmount = Loader.GetLoadingProgress();
|
||||
}
|
||||
}
|
11
Assets/Tools/SceneManager/LoadingProgressBar.cs.meta
Normal file
11
Assets/Tools/SceneManager/LoadingProgressBar.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 79bedd11df41bee44a527b2e4e718d17
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/SimpleMinMaxSlider.meta
Normal file
8
Assets/Tools/SimpleMinMaxSlider.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8cf4e72d60c563f44b838b832e931b33
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/SimpleMinMaxSlider/Scripts.meta
Normal file
8
Assets/Tools/SimpleMinMaxSlider/Scripts.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4be9f6fb652f19488b46fbc9bac8be5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Tools/SimpleMinMaxSlider/Scripts/Editor.meta
Normal file
8
Assets/Tools/SimpleMinMaxSlider/Scripts/Editor.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b58f02022de16354ba42b835bcc79d57
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,81 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Geri.MinMaxSlider;
|
||||
|
||||
[CustomPropertyDrawer(typeof(MinMaxSliderAttribute))]
|
||||
public class MinMaxSliderDrawer : PropertyDrawer {
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){
|
||||
|
||||
var minMaxAttribute = (MinMaxSliderAttribute)attribute;
|
||||
var propertyType = property.propertyType;
|
||||
|
||||
label.tooltip = minMaxAttribute.min.ToString("F2") + " to " + minMaxAttribute.max.ToString("F2");
|
||||
|
||||
if(propertyType == SerializedPropertyType.Vector2){
|
||||
Vector2 vector = property.vector2Value;
|
||||
float minVal = vector.x;
|
||||
float maxVal = vector.y;
|
||||
|
||||
int originalIndentLevel = EditorGUI.indentLevel;
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
EditorGUI.indentLevel = 0;
|
||||
float fieldWidth = position.width / 4f - 4f;
|
||||
float sliderWidth = position.width / 2f;
|
||||
position.width = fieldWidth;
|
||||
minVal = EditorGUI.FloatField(position, minVal);
|
||||
position.x += fieldWidth + 4f;
|
||||
position.width = sliderWidth;
|
||||
EditorGUI.MinMaxSlider(position, ref minVal, ref maxVal, minMaxAttribute.min, minMaxAttribute.max);
|
||||
position.x += sliderWidth + 4f;
|
||||
position.width = fieldWidth;
|
||||
maxVal = EditorGUI.FloatField(position, maxVal);
|
||||
if (maxVal < minMaxAttribute.min){
|
||||
minVal = minMaxAttribute.min;
|
||||
}else if (maxVal > minMaxAttribute.max){
|
||||
maxVal = minMaxAttribute.max;
|
||||
}
|
||||
vector = new Vector2(minVal > maxVal ? maxVal : minVal, maxVal);
|
||||
property.vector2Value = vector;
|
||||
|
||||
EditorGUI.EndProperty();
|
||||
EditorGUI.indentLevel = originalIndentLevel;
|
||||
|
||||
}else if(propertyType == SerializedPropertyType.Vector2Int){
|
||||
|
||||
Vector2Int vector = property.vector2IntValue;
|
||||
float minVal = vector.x;
|
||||
float maxVal = vector.y;
|
||||
|
||||
int originalIndentLevel = EditorGUI.indentLevel;
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
EditorGUI.indentLevel = 0;
|
||||
float fieldWidth = position.width / 4f - 4f;
|
||||
float sliderWidth = position.width / 2f;
|
||||
position.width = fieldWidth;
|
||||
minVal = EditorGUI.FloatField(position, minVal);
|
||||
position.x += fieldWidth + 4f;
|
||||
position.width = sliderWidth;
|
||||
EditorGUI.MinMaxSlider(position, ref minVal, ref maxVal, minMaxAttribute.min, minMaxAttribute.max);
|
||||
position.x += sliderWidth + 4f;
|
||||
position.width = fieldWidth;
|
||||
maxVal = EditorGUI.FloatField(position, maxVal);
|
||||
if (maxVal < minMaxAttribute.min){
|
||||
minVal = minMaxAttribute.min;
|
||||
}else if (maxVal > minMaxAttribute.max){
|
||||
maxVal = minMaxAttribute.max;
|
||||
}
|
||||
vector = new Vector2Int(Mathf.FloorToInt(minVal > maxVal ? maxVal : minVal), Mathf.FloorToInt(maxVal));
|
||||
property.vector2IntValue = vector;
|
||||
|
||||
EditorGUI.EndProperty();
|
||||
EditorGUI.indentLevel = originalIndentLevel;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e6b53f69308943e499e344adc5adee79
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,16 @@
|
|||
namespace Geri.MinMaxSlider
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
public class MinMaxSliderAttribute : PropertyAttribute{
|
||||
|
||||
public float min;
|
||||
public float max;
|
||||
|
||||
public MinMaxSliderAttribute(float min, float max)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a090d8b694abe7141af9c000b8cf42ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Tools/SimpleMinMaxSlider/Square.png
(Stored with Git LFS)
Normal file
BIN
Assets/Tools/SimpleMinMaxSlider/Square.png
(Stored with Git LFS)
Normal file
Binary file not shown.
102
Assets/Tools/SimpleMinMaxSlider/Square.png.meta
Normal file
102
Assets/Tools/SimpleMinMaxSlider/Square.png.meta
Normal file
|
@ -0,0 +1,102 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d93624141d1826749b7f50e692cc2a93
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 3
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 4
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 4
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline:
|
||||
- - {x: -2, y: -2}
|
||||
- {x: -2, y: 2}
|
||||
- {x: 2, y: 2}
|
||||
- {x: 2, y: -2}
|
||||
physicsShape:
|
||||
- - {x: -2, y: -2}
|
||||
- {x: -2, y: 2}
|
||||
- {x: 2, y: 2}
|
||||
- {x: 2, y: -2}
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue