Initialized project with loader scripts and necessary components.
Added newtonsoft package. Added dotween package. Updated game scene with PopupManager, GameBootLoader. Added necessary UI scripts.
This commit is contained in:
parent
9078a4f441
commit
ece8c8d5cb
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"visualstudiotoolsforunity.vstuc"
|
||||||
|
]
|
||||||
|
}
|
||||||
10
.vscode/launch.json
vendored
Normal file
10
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Attach to Unity",
|
||||||
|
"type": "vstuc",
|
||||||
|
"request": "attach"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
55
.vscode/settings.json
vendored
Normal file
55
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.gitmodules": true,
|
||||||
|
"**/*.booproj": true,
|
||||||
|
"**/*.pidb": true,
|
||||||
|
"**/*.suo": true,
|
||||||
|
"**/*.user": true,
|
||||||
|
"**/*.userprefs": true,
|
||||||
|
"**/*.unityproj": true,
|
||||||
|
"**/*.dll": true,
|
||||||
|
"**/*.exe": true,
|
||||||
|
"**/*.pdf": true,
|
||||||
|
"**/*.mid": true,
|
||||||
|
"**/*.midi": true,
|
||||||
|
"**/*.wav": true,
|
||||||
|
"**/*.gif": true,
|
||||||
|
"**/*.ico": true,
|
||||||
|
"**/*.jpg": true,
|
||||||
|
"**/*.jpeg": true,
|
||||||
|
"**/*.png": true,
|
||||||
|
"**/*.psd": true,
|
||||||
|
"**/*.tga": true,
|
||||||
|
"**/*.tif": true,
|
||||||
|
"**/*.tiff": true,
|
||||||
|
"**/*.3ds": true,
|
||||||
|
"**/*.3DS": true,
|
||||||
|
"**/*.fbx": true,
|
||||||
|
"**/*.FBX": true,
|
||||||
|
"**/*.lxo": true,
|
||||||
|
"**/*.LXO": true,
|
||||||
|
"**/*.ma": true,
|
||||||
|
"**/*.MA": true,
|
||||||
|
"**/*.obj": true,
|
||||||
|
"**/*.OBJ": true,
|
||||||
|
"**/*.asset": true,
|
||||||
|
"**/*.cubemap": true,
|
||||||
|
"**/*.flare": true,
|
||||||
|
"**/*.mat": true,
|
||||||
|
"**/*.meta": true,
|
||||||
|
"**/*.prefab": true,
|
||||||
|
"**/*.unity": true,
|
||||||
|
"build/": true,
|
||||||
|
"Build/": true,
|
||||||
|
"Library/": true,
|
||||||
|
"library/": true,
|
||||||
|
"obj/": true,
|
||||||
|
"Obj/": true,
|
||||||
|
"ProjectSettings/": true,
|
||||||
|
"temp/": true,
|
||||||
|
"Temp/": true
|
||||||
|
},
|
||||||
|
"dotnet.defaultSolution": "Ludo-3D.sln"
|
||||||
|
}
|
||||||
8
Assets/External-Assets.meta
Normal file
8
Assets/External-Assets.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11f25296bc68449ea94bc0df0751f603
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/External-Assets/packages.meta
Normal file
8
Assets/External-Assets/packages.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 04affb95222bc4b5fb6dfc5dbcf953e9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8a3389fa12f0c44bea588b22049490af
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/External-Assets/packages/Newtonsoft.Json-for-Unity-13.0.102/Plugins.meta
vendored
Normal file
8
Assets/External-Assets/packages/Newtonsoft.Json-for-Unity-13.0.102/Plugins.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3c12412e3eece49a29904fd824685f3d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6923e00e69342432c8c9ebe484ca65e3
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@ -0,0 +1,129 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6c694cfdc33ae264fb33e0cd1c7e25cf
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 1
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
'': Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Android: 0
|
||||||
|
Exclude Editor: 1
|
||||||
|
Exclude Linux: 0
|
||||||
|
Exclude Linux64: 0
|
||||||
|
Exclude LinuxUniversal: 0
|
||||||
|
Exclude OSXUniversal: 0
|
||||||
|
Exclude WebGL: 0
|
||||||
|
Exclude Win: 0
|
||||||
|
Exclude Win64: 0
|
||||||
|
Exclude WindowsStoreApps: 0
|
||||||
|
Exclude iOS: 0
|
||||||
|
Exclude tvOS: 0
|
||||||
|
- first:
|
||||||
|
Android: Android
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: ARMv7
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
|
- first:
|
||||||
|
Facebook: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Facebook: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Linux
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: x86
|
||||||
|
- first:
|
||||||
|
Standalone: Linux64
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: LinuxUniversal
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Standalone: OSXUniversal
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win64
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
WebGL: WebGL
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
DontProcess: false
|
||||||
|
PlaceholderPath:
|
||||||
|
SDK: AnySDK
|
||||||
|
ScriptingBackend: AnyScriptingBackend
|
||||||
|
- first:
|
||||||
|
iPhone: iOS
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
AddToEmbeddedBinaries: false
|
||||||
|
CompileFlags:
|
||||||
|
FrameworkDependencies:
|
||||||
|
- first:
|
||||||
|
tvOS: tvOS
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CompileFlags:
|
||||||
|
FrameworkDependencies:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8cabbf59ee4444e3ea5c6cbef0f375e1
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@ -0,0 +1,82 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c4bfcb5b17948478ccb955bccff9652
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
'': Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Editor: 0
|
||||||
|
Exclude Linux64: 1
|
||||||
|
Exclude OSXUniversal: 1
|
||||||
|
Exclude WebGL: 1
|
||||||
|
Exclude Win: 1
|
||||||
|
Exclude Win64: 1
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
|
- first:
|
||||||
|
Facebook: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Facebook: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Linux64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: OSXUniversal
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins.meta
Normal file
8
Assets/Plugins.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8dcdd9e7c76c647fc9c11102a4dd2602
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Demigiant.meta
Normal file
8
Assets/Plugins/Demigiant.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 561eb8ffabe564da9a3294e3a0a6852f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Demigiant/DOTween.meta
Normal file
8
Assets/Plugins/Demigiant/DOTween.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cbe370bf715de4ab69e6c071b960f7ea
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/DOTween.dll
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/DOTween.dll
Normal file
Binary file not shown.
22
Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta
Normal file
22
Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a811bde74b26b53498b4f6d872b09b6d
|
||||||
|
PluginImporter:
|
||||||
|
serializedVersion: 1
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
isPreloaded: 0
|
||||||
|
platformData:
|
||||||
|
Any:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
Editor:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
WindowsStoreApps:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Demigiant/DOTween/Editor.meta
Normal file
8
Assets/Plugins/Demigiant/DOTween/Editor.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c2e36e0ca63bc409fbe7d43ccb6d84d8
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll
Normal file
Binary file not shown.
@ -0,0 +1,22 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 45d5034162d6cf04dbe46da84fc7d074
|
||||||
|
PluginImporter:
|
||||||
|
serializedVersion: 1
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
isPreloaded: 0
|
||||||
|
platformData:
|
||||||
|
Any:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
Editor:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
WindowsStoreApps:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Demigiant/DOTween/Modules.meta
Normal file
8
Assets/Plugins/Demigiant/DOTween/Modules.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a17265398e1224389814de756c21653f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
198
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs
Normal file
198
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if true // MODULE_MARKER
|
||||||
|
using System;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Audio; // Required for AudioMixer
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModuleAudio
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region Audio
|
||||||
|
|
||||||
|
/// <summary>Tweens an AudioSource's volume to the given value.
|
||||||
|
/// Also stores the AudioSource as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOFade(this AudioSource target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
if (endValue < 0) endValue = 0;
|
||||||
|
else if (endValue > 1) endValue = 1;
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an AudioSource's pitch to the given value.
|
||||||
|
/// Also stores the AudioSource as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOPitch(this AudioSource target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region AudioMixer
|
||||||
|
|
||||||
|
/// <summary>Tweens an AudioMixer's exposed float to the given value.
|
||||||
|
/// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
|
||||||
|
/// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.</summary>
|
||||||
|
/// <param name="floatName">Name given to the exposed float to set</param>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(()=> {
|
||||||
|
float currVal;
|
||||||
|
target.GetFloat(floatName, out currVal);
|
||||||
|
return currVal;
|
||||||
|
}, x=> target.SetFloat(floatName, x), endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Operation Shortcuts
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Completes all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens completed
|
||||||
|
/// (meaning the tweens that don't have infinite loops and were not already complete)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
|
||||||
|
/// otherwise they will be ignored</param>
|
||||||
|
public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
|
||||||
|
{
|
||||||
|
return DOTween.Complete(target, withCallbacks);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Kills all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens killed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="complete">If TRUE completes the tween before killing it</param>
|
||||||
|
public static int DOKill(this AudioMixer target, bool complete = false)
|
||||||
|
{
|
||||||
|
return DOTween.Kill(target, complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens flipped.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOFlip(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.Flip(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends to the given position all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens involved.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="to">Time position to reach
|
||||||
|
/// (if higher than the whole tween duration the tween will simply reach its end)</param>
|
||||||
|
/// <param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
|
||||||
|
public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
|
||||||
|
{
|
||||||
|
return DOTween.Goto(target, to, andPlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pauses all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens paused.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOPause(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.Pause(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plays all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens played.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOPlay(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.Play(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plays backwards all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens played.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOPlayBackwards(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.PlayBackwards(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plays forward all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens played.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOPlayForward(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.PlayForward(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Restarts all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens restarted.
|
||||||
|
/// </summary>
|
||||||
|
public static int DORestart(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.Restart(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rewinds all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens rewinded.
|
||||||
|
/// </summary>
|
||||||
|
public static int DORewind(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.Rewind(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Smoothly rewinds all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens rewinded.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOSmoothRewind(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.SmoothRewind(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||||
|
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||||
|
/// and returns the total number of tweens involved.
|
||||||
|
/// </summary>
|
||||||
|
public static int DOTogglePause(this AudioMixer target)
|
||||||
|
{
|
||||||
|
return DOTween.TogglePause(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b766d08851589514b97afb23c6f30a70
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if false || EPO_DOTWEEN // MODULE_MARKER
|
||||||
|
|
||||||
|
using EPOOutline;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using DG.Tweening;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModuleEPOOutline
|
||||||
|
{
|
||||||
|
public static int DOKill(this SerializedPass target, bool complete)
|
||||||
|
{
|
||||||
|
return DOTween.Kill(target, complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOFloat(this SerializedPass target, string propertyName, float endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetFloat(propertyName), x => target.SetFloat(propertyName, x), endValue, duration);
|
||||||
|
tweener.SetOptions(true).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SerializedPass target, string propertyName, float endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.ToAlpha(() => target.GetColor(propertyName), x => target.SetColor(propertyName, x), endValue, duration);
|
||||||
|
tweener.SetOptions(true).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SerializedPass target, string propertyName, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetColor(propertyName), x => target.SetColor(propertyName, x), endValue, duration);
|
||||||
|
tweener.SetOptions(false).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Vector4, Vector4, VectorOptions> DOVector(this SerializedPass target, string propertyName, Vector4 endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetVector(propertyName), x => target.SetVector(propertyName, x), endValue, duration);
|
||||||
|
tweener.SetOptions(false).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOFloat(this SerializedPass target, int propertyId, float endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetFloat(propertyId), x => target.SetFloat(propertyId, x), endValue, duration);
|
||||||
|
tweener.SetOptions(true).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SerializedPass target, int propertyId, float endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.ToAlpha(() => target.GetColor(propertyId), x => target.SetColor(propertyId, x), endValue, duration);
|
||||||
|
tweener.SetOptions(true).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SerializedPass target, int propertyId, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetColor(propertyId), x => target.SetColor(propertyId, x), endValue, duration);
|
||||||
|
tweener.SetOptions(false).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TweenerCore<Vector4, Vector4, VectorOptions> DOVector(this SerializedPass target, int propertyId, Vector4 endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.GetVector(propertyId), x => target.SetVector(propertyId, x), endValue, duration);
|
||||||
|
tweener.SetOptions(false).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int DOKill(this Outlinable.OutlineProperties target, bool complete = false)
|
||||||
|
{
|
||||||
|
return DOTween.Kill(target, complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int DOKill(this Outliner target, bool complete = false)
|
||||||
|
{
|
||||||
|
return DOTween.Kill(target, complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the alpha (transparency) of the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Outlinable.OutlineProperties target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.ToAlpha(() => target.Color, x => target.Color = x, endValue, duration);
|
||||||
|
tweener.SetOptions(true).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the color of the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Outlinable.OutlineProperties target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.Color, x => target.Color = x, endValue, duration);
|
||||||
|
tweener.SetOptions(false).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the amount of blur applied to the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOBlurShift(this Outlinable.OutlineProperties target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.BlurShift, x => target.BlurShift = x, endValue, duration);
|
||||||
|
tweener.SetOptions(snapping).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the amount of blur applied to the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOBlurShift(this Outliner target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.BlurShift, x => target.BlurShift = x, endValue, duration);
|
||||||
|
tweener.SetOptions(snapping).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the amount of dilation applied to the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DODilateShift(this Outlinable.OutlineProperties target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.DilateShift, x => target.DilateShift = x, endValue, duration);
|
||||||
|
tweener.SetOptions(snapping).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls the amount of dilation applied to the outline
|
||||||
|
/// </summary>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DODilateShift(this Outliner target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
var tweener = DOTween.To(() => target.DilateShift, x => target.DilateShift = x, endValue, duration);
|
||||||
|
tweener.SetOptions(snapping).SetTarget(target);
|
||||||
|
return tweener;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e944529dcaee98f4e9498d80e541d93e
|
||||||
|
timeCreated: 1602593330
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
216
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs
Normal file
216
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if true // MODULE_MARKER
|
||||||
|
using System;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Core.Enums;
|
||||||
|
using DG.Tweening.Plugins;
|
||||||
|
using DG.Tweening.Plugins.Core.PathCore;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModulePhysics
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region Rigidbody
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's position to the given value.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's X position to the given value.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's Y position to the given value.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's Z position to the given value.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's rotation to the given value.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="mode">Rotation mode</param>
|
||||||
|
public static TweenerCore<Quaternion, Vector3, QuaternionOptions> DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
|
||||||
|
{
|
||||||
|
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
t.plugOptions.rotateMode = mode;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's rotation so that it will look towards the given position.
|
||||||
|
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="axisConstraint">Eventual axis constraint for the rotation</param>
|
||||||
|
/// <param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
|
||||||
|
public static TweenerCore<Quaternion, Vector3, QuaternionOptions> DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
|
||||||
|
{
|
||||||
|
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
|
||||||
|
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
|
||||||
|
t.plugOptions.axisConstraint = axisConstraint;
|
||||||
|
t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Special
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
|
||||||
|
/// Returns a Sequence instead of a Tweener.
|
||||||
|
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
|
||||||
|
/// <param name="numJumps">Total number of jumps</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
if (numJumps < 1) numJumps = 1;
|
||||||
|
float startPosY = 0;
|
||||||
|
float offsetY = -1;
|
||||||
|
bool offsetYSet = false;
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2))
|
||||||
|
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
|
||||||
|
.SetLoops(numJumps * 2, LoopType.Yoyo)
|
||||||
|
.OnStart(() => startPosY = target.position.y);
|
||||||
|
s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration)
|
||||||
|
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
|
||||||
|
).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
|
||||||
|
.SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
|
||||||
|
).Join(yTween)
|
||||||
|
.SetTarget(target).SetEase(DOTween.defaultEaseType);
|
||||||
|
yTween.OnUpdate(() => {
|
||||||
|
if (!offsetYSet) {
|
||||||
|
offsetYSet = true;
|
||||||
|
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
|
||||||
|
}
|
||||||
|
Vector3 pos = target.position;
|
||||||
|
pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
|
||||||
|
target.MovePosition(pos);
|
||||||
|
});
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
|
||||||
|
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
|
||||||
|
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
|
||||||
|
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
|
||||||
|
/// If you plan to publish there you should use a regular transform.DOPath.</para></summary>
|
||||||
|
/// <param name="path">The waypoints to go through</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
|
||||||
|
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
|
||||||
|
/// <param name="resolution">The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
|
||||||
|
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||||
|
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||||
|
public static TweenerCore<Vector3, Path, PathOptions> DOPath(
|
||||||
|
this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
|
||||||
|
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (resolution < 1) resolution = 1;
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration)
|
||||||
|
.SetTarget(target).SetUpdate(UpdateType.Fixed);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
|
||||||
|
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
|
||||||
|
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
|
||||||
|
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
|
||||||
|
/// If you plan to publish there you should use a regular transform.DOLocalPath.</para></summary>
|
||||||
|
/// <param name="path">The waypoint to go through</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
|
||||||
|
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
|
||||||
|
/// <param name="resolution">The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
|
||||||
|
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||||
|
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||||
|
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
|
||||||
|
this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
|
||||||
|
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (resolution < 1) resolution = 1;
|
||||||
|
Transform trans = target.transform;
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration)
|
||||||
|
.SetTarget(target).SetUpdate(UpdateType.Fixed);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
t.plugOptions.useLocalPosition = true;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path
|
||||||
|
internal static TweenerCore<Vector3, Path, PathOptions> DOPath(
|
||||||
|
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
|
||||||
|
)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration)
|
||||||
|
.SetTarget(target);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
internal static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
|
||||||
|
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Transform trans = target.transform;
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
|
||||||
|
.SetTarget(target);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
t.plugOptions.useLocalPosition = true;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dae9aa560b4242648a3affa2bfabc365
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@ -0,0 +1,193 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if true // MODULE_MARKER
|
||||||
|
using System;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins;
|
||||||
|
using DG.Tweening.Plugins.Core.PathCore;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModulePhysics2D
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region Rigidbody2D Shortcuts
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's position to the given value.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's X position to the given value.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's Y position to the given value.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's rotation to the given value.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DORotate(this Rigidbody2D target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Special
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
|
||||||
|
/// Returns a Sequence instead of a Tweener.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
|
||||||
|
/// <para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
|
||||||
|
/// <param name="numJumps">Total number of jumps</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
if (numJumps < 1) numJumps = 1;
|
||||||
|
float startPosY = 0;
|
||||||
|
float offsetY = -1;
|
||||||
|
bool offsetYSet = false;
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
|
||||||
|
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
|
||||||
|
.SetLoops(numJumps * 2, LoopType.Yoyo)
|
||||||
|
.OnStart(() => startPosY = target.position.y);
|
||||||
|
s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
|
||||||
|
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
|
||||||
|
).Join(yTween)
|
||||||
|
.SetTarget(target).SetEase(DOTween.defaultEaseType);
|
||||||
|
yTween.OnUpdate(() => {
|
||||||
|
if (!offsetYSet) {
|
||||||
|
offsetYSet = true;
|
||||||
|
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
|
||||||
|
}
|
||||||
|
Vector3 pos = target.position;
|
||||||
|
pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
|
||||||
|
target.MovePosition(pos);
|
||||||
|
});
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Rigidbody2D's position through the given path waypoints, using the chosen path algorithm.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
|
||||||
|
/// <para>NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened.</para>
|
||||||
|
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
|
||||||
|
/// If you plan to publish there you should use a regular transform.DOPath.</para></summary>
|
||||||
|
/// <param name="path">The waypoints to go through</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
|
||||||
|
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
|
||||||
|
/// <param name="resolution">The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
|
||||||
|
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||||
|
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||||
|
public static TweenerCore<Vector3, Path, PathOptions> DOPath(
|
||||||
|
this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear,
|
||||||
|
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (resolution < 1) resolution = 1;
|
||||||
|
int len = path.Length;
|
||||||
|
Vector3[] path3D = new Vector3[len];
|
||||||
|
for (int i = 0; i < len; ++i) path3D[i] = path[i];
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, x => target.MovePosition(x), new Path(pathType, path3D, resolution, gizmoColor), duration)
|
||||||
|
.SetTarget(target).SetUpdate(UpdateType.Fixed);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody2D = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a Rigidbody2D's localPosition through the given path waypoints, using the chosen path algorithm.
|
||||||
|
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
|
||||||
|
/// <para>NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened.</para>
|
||||||
|
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
|
||||||
|
/// If you plan to publish there you should use a regular transform.DOLocalPath.</para></summary>
|
||||||
|
/// <param name="path">The waypoint to go through</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
|
||||||
|
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
|
||||||
|
/// <param name="resolution">The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
|
||||||
|
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
|
||||||
|
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
|
||||||
|
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
|
||||||
|
this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear,
|
||||||
|
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (resolution < 1) resolution = 1;
|
||||||
|
int len = path.Length;
|
||||||
|
Vector3[] path3D = new Vector3[len];
|
||||||
|
for (int i = 0; i < len; ++i) path3D[i] = path[i];
|
||||||
|
Transform trans = target.transform;
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path3D, resolution, gizmoColor), duration)
|
||||||
|
.SetTarget(target).SetUpdate(UpdateType.Fixed);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody2D = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
t.plugOptions.useLocalPosition = true;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path
|
||||||
|
internal static TweenerCore<Vector3, Path, PathOptions> DOPath(
|
||||||
|
this Rigidbody2D target, Path path, float duration, PathMode pathMode = PathMode.Full3D
|
||||||
|
)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, x => target.MovePosition(x), path, duration)
|
||||||
|
.SetTarget(target);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody2D = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
internal static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
|
||||||
|
this Rigidbody2D target, Path path, float duration, PathMode pathMode = PathMode.Full3D
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Transform trans = target.transform;
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
|
||||||
|
.SetTarget(target);
|
||||||
|
|
||||||
|
t.plugOptions.isRigidbody2D = true;
|
||||||
|
t.plugOptions.mode = pathMode;
|
||||||
|
t.plugOptions.useLocalPosition = true;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 230fe34542e175245ba74b4659dae700
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if true // MODULE_MARKER
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModuleSprite
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region SpriteRenderer
|
||||||
|
|
||||||
|
/// <summary>Tweens a SpriteRenderer's color to the given value.
|
||||||
|
/// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SpriteRenderer target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Material's alpha color to the given value.
|
||||||
|
/// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SpriteRenderer target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a SpriteRenderer's color using the given gradient
|
||||||
|
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
|
||||||
|
{
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
GradientColorKey[] colors = gradient.colorKeys;
|
||||||
|
int len = colors.Length;
|
||||||
|
for (int i = 0; i < len; ++i) {
|
||||||
|
GradientColorKey c = colors[i];
|
||||||
|
if (i == 0 && c.time <= 0) {
|
||||||
|
target.color = c.color;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
float colorDuration = i == len - 1
|
||||||
|
? duration - s.Duration(false) // Verifies that total duration is correct
|
||||||
|
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
|
||||||
|
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
|
||||||
|
}
|
||||||
|
s.SetTarget(target);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Blendables
|
||||||
|
|
||||||
|
#region SpriteRenderer
|
||||||
|
|
||||||
|
/// <summary>Tweens a SpriteRenderer's color to the given value,
|
||||||
|
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||||
|
/// instead than fight each other as multiple DOColor would do.
|
||||||
|
/// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
endValue = endValue - target.color;
|
||||||
|
Color to = new Color(0, 0, 0, 0);
|
||||||
|
return DOTween.To(() => to, x => {
|
||||||
|
Color diff = x - to;
|
||||||
|
to = x;
|
||||||
|
target.color += diff;
|
||||||
|
}, endValue, duration)
|
||||||
|
.Blendable().SetTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 188918ab119d93148aa0de59ccf5286b
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
662
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs
Normal file
662
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs
Normal file
@ -0,0 +1,662 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if true // MODULE_MARKER
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Core.Enums;
|
||||||
|
using DG.Tweening.Plugins;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using Outline = UnityEngine.UI.Outline;
|
||||||
|
using Text = UnityEngine.UI.Text;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModuleUI
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region CanvasGroup
|
||||||
|
|
||||||
|
/// <summary>Tweens a CanvasGroup's alpha color to the given value.
|
||||||
|
/// Also stores the canvasGroup as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOFade(this CanvasGroup target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Graphic
|
||||||
|
|
||||||
|
/// <summary>Tweens an Graphic's color to the given value.
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Graphic target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an Graphic's alpha color to the given value.
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Graphic target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Image
|
||||||
|
|
||||||
|
/// <summary>Tweens an Image's color to the given value.
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Image target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an Image's alpha color to the given value.
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Image target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an Image's fillAmount to the given value.
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOFillAmount(this Image target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
if (endValue > 1) endValue = 1;
|
||||||
|
else if (endValue < 0) endValue = 0;
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an Image's colors using the given gradient
|
||||||
|
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration)
|
||||||
|
{
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
GradientColorKey[] colors = gradient.colorKeys;
|
||||||
|
int len = colors.Length;
|
||||||
|
for (int i = 0; i < len; ++i) {
|
||||||
|
GradientColorKey c = colors[i];
|
||||||
|
if (i == 0 && c.time <= 0) {
|
||||||
|
target.color = c.color;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
float colorDuration = i == len - 1
|
||||||
|
? duration - s.Duration(false) // Verifies that total duration is correct
|
||||||
|
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
|
||||||
|
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
|
||||||
|
}
|
||||||
|
s.SetTarget(target);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region LayoutElement
|
||||||
|
|
||||||
|
/// <summary>Tweens an LayoutElement's flexibleWidth/Height to the given value.
|
||||||
|
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => {
|
||||||
|
target.flexibleWidth = x.x;
|
||||||
|
target.flexibleHeight = x.y;
|
||||||
|
}, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an LayoutElement's minWidth/Height to the given value.
|
||||||
|
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => {
|
||||||
|
target.minWidth = x.x;
|
||||||
|
target.minHeight = x.y;
|
||||||
|
}, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens an LayoutElement's preferredWidth/Height to the given value.
|
||||||
|
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => {
|
||||||
|
target.preferredWidth = x.x;
|
||||||
|
target.preferredHeight = x.y;
|
||||||
|
}, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Outline
|
||||||
|
|
||||||
|
/// <summary>Tweens a Outline's effectColor to the given value.
|
||||||
|
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Outline target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Outline's effectColor alpha to the given value.
|
||||||
|
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Outline target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Outline's effectDistance to the given value.
|
||||||
|
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOScale(this Outline target, Vector2 endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RectTransform
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition X to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition Y to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition3D to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition3D X to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition3D Y to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition3D Z to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchorMax to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchorMin to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's pivot to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivot(this RectTransform target, Vector2 endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's pivot X to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivotX(this RectTransform target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a RectTransform's pivot Y to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivotY(this RectTransform target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's sizeDelta to the given value.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
|
||||||
|
/// as if it was connected to the starting position via an elastic.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="vibrato">Indicates how much will the punch vibrate</param>
|
||||||
|
/// <param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
|
||||||
|
/// 1 creates a full oscillation between the punch direction and the opposite direction,
|
||||||
|
/// while 0 oscillates only between the punch and the start position</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
|
||||||
|
{
|
||||||
|
return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
|
||||||
|
.SetTarget(target).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="strength">The shake strength</param>
|
||||||
|
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
|
||||||
|
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
|
||||||
|
/// Setting it to 0 will shake along a single direction.</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
|
||||||
|
/// <param name="randomnessMode">Randomness mode</param>
|
||||||
|
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full)
|
||||||
|
{
|
||||||
|
return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut, randomnessMode)
|
||||||
|
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="strength">The shake strength on each axis</param>
|
||||||
|
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
|
||||||
|
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
|
||||||
|
/// Setting it to 0 will shake along a single direction.</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
|
||||||
|
/// <param name="randomnessMode">Randomness mode</param>
|
||||||
|
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full)
|
||||||
|
{
|
||||||
|
return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut, randomnessMode)
|
||||||
|
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Special
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
|
||||||
|
/// Returns a Sequence instead of a Tweener.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
|
||||||
|
/// <param name="numJumps">Total number of jumps</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
if (numJumps < 1) numJumps = 1;
|
||||||
|
float startPosY = 0;
|
||||||
|
float offsetY = -1;
|
||||||
|
bool offsetYSet = false;
|
||||||
|
|
||||||
|
// Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence
|
||||||
|
// (in case users add a delay or other elements to the Sequence)
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
|
||||||
|
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
|
||||||
|
.SetLoops(numJumps * 2, LoopType.Yoyo)
|
||||||
|
.OnStart(()=> startPosY = target.anchoredPosition.y);
|
||||||
|
s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration)
|
||||||
|
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
|
||||||
|
).Join(yTween)
|
||||||
|
.SetTarget(target).SetEase(DOTween.defaultEaseType);
|
||||||
|
s.OnUpdate(() => {
|
||||||
|
if (!offsetYSet) {
|
||||||
|
offsetYSet = true;
|
||||||
|
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
|
||||||
|
}
|
||||||
|
Vector2 pos = target.anchoredPosition;
|
||||||
|
pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad);
|
||||||
|
target.anchoredPosition = pos;
|
||||||
|
});
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ScrollRect
|
||||||
|
|
||||||
|
/// <summary>Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
|
||||||
|
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
|
||||||
|
x => {
|
||||||
|
target.horizontalNormalizedPosition = x.x;
|
||||||
|
target.verticalNormalizedPosition = x.y;
|
||||||
|
}, endValue, duration)
|
||||||
|
.SetOptions(snapping).SetTarget(target);
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
|
||||||
|
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration)
|
||||||
|
.SetOptions(snapping).SetTarget(target);
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a ScrollRect's verticalNormalizedPosition to the given value.
|
||||||
|
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration)
|
||||||
|
.SetOptions(snapping).SetTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Slider
|
||||||
|
|
||||||
|
/// <summary>Tweens a Slider's value to the given value.
|
||||||
|
/// Also stores the Slider as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<float, float, FloatOptions> DOValue(this Slider target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.value, x => target.value = x, endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Text
|
||||||
|
|
||||||
|
/// <summary>Tweens a Text's color to the given value.
|
||||||
|
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Text target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tweens a Text's text from one integer to another, with options for thousands separators
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fromValue">The value to start from</param>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="addThousandsSeparator">If TRUE (default) also adds thousands separators</param>
|
||||||
|
/// <param name="culture">The <see cref="CultureInfo"/> to use (InvariantCulture if NULL)</param>
|
||||||
|
public static TweenerCore<int, int, NoOptions> DOCounter(
|
||||||
|
this Text target, int fromValue, int endValue, float duration, bool addThousandsSeparator = true, CultureInfo culture = null
|
||||||
|
){
|
||||||
|
int v = fromValue;
|
||||||
|
CultureInfo cInfo = !addThousandsSeparator ? null : culture ?? CultureInfo.InvariantCulture;
|
||||||
|
TweenerCore<int, int, NoOptions> t = DOTween.To(() => v, x => {
|
||||||
|
v = x;
|
||||||
|
target.text = addThousandsSeparator
|
||||||
|
? v.ToString("N0", cInfo)
|
||||||
|
: v.ToString();
|
||||||
|
}, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Text's alpha color to the given value.
|
||||||
|
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Text target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Text's text to the given value.
|
||||||
|
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
|
||||||
|
/// otherwise all tags will be considered as normal text</param>
|
||||||
|
/// <param name="scrambleMode">The type of scramble mode to use, if any</param>
|
||||||
|
/// <param name="scrambleChars">A string containing the characters to use for scrambling.
|
||||||
|
/// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
|
||||||
|
/// Leave it to NULL (default) to use default ones</param>
|
||||||
|
public static TweenerCore<string, string, StringOptions> DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
|
||||||
|
{
|
||||||
|
if (endValue == null) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors");
|
||||||
|
endValue = "";
|
||||||
|
}
|
||||||
|
TweenerCore<string, string, StringOptions> t = DOTween.To(() => target.text, x => target.text = x, endValue, duration);
|
||||||
|
t.SetOptions(richTextEnabled, scrambleMode, scrambleChars)
|
||||||
|
.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Blendables
|
||||||
|
|
||||||
|
#region Graphic
|
||||||
|
|
||||||
|
/// <summary>Tweens a Graphic's color to the given value,
|
||||||
|
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||||
|
/// instead than fight each other as multiple DOColor would do.
|
||||||
|
/// Also stores the Graphic as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
endValue = endValue - target.color;
|
||||||
|
Color to = new Color(0, 0, 0, 0);
|
||||||
|
return DOTween.To(() => to, x => {
|
||||||
|
Color diff = x - to;
|
||||||
|
to = x;
|
||||||
|
target.color += diff;
|
||||||
|
}, endValue, duration)
|
||||||
|
.Blendable().SetTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Image
|
||||||
|
|
||||||
|
/// <summary>Tweens a Image's color to the given value,
|
||||||
|
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||||
|
/// instead than fight each other as multiple DOColor would do.
|
||||||
|
/// Also stores the Image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
endValue = endValue - target.color;
|
||||||
|
Color to = new Color(0, 0, 0, 0);
|
||||||
|
return DOTween.To(() => to, x => {
|
||||||
|
Color diff = x - to;
|
||||||
|
to = x;
|
||||||
|
target.color += diff;
|
||||||
|
}, endValue, duration)
|
||||||
|
.Blendable().SetTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Text
|
||||||
|
|
||||||
|
/// <summary>Tweens a Text's color BY the given value,
|
||||||
|
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
|
||||||
|
/// instead than fight each other as multiple DOColor would do.
|
||||||
|
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
|
||||||
|
{
|
||||||
|
endValue = endValue - target.color;
|
||||||
|
Color to = new Color(0, 0, 0, 0);
|
||||||
|
return DOTween.To(() => to, x => {
|
||||||
|
Color diff = x - to;
|
||||||
|
to = x;
|
||||||
|
target.color += diff;
|
||||||
|
}, endValue, duration)
|
||||||
|
.Blendable().SetTarget(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Shapes
|
||||||
|
|
||||||
|
/// <summary>Tweens a RectTransform's anchoredPosition so that it draws a circle around the given center.
|
||||||
|
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations.<para/>
|
||||||
|
/// IMPORTANT: SetFrom(value) requires a <see cref="Vector2"/> instead of a float, where the X property represents the "from degrees value"</summary>
|
||||||
|
/// <param name="center">Circle-center/pivot around which to rotate (in UI anchoredPosition coordinates)</param>
|
||||||
|
/// <param name="endValueDegrees">The end value degrees to reach (to rotate counter-clockwise pass a negative value)</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
/// <param name="relativeCenter">If TRUE the <see cref="center"/> coordinates will be considered as relative to the target's current anchoredPosition</param>
|
||||||
|
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, CircleOptions> DOShapeCircle(
|
||||||
|
this RectTransform target, Vector2 center, float endValueDegrees, float duration, bool relativeCenter = false, bool snapping = false
|
||||||
|
)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, CircleOptions> t = DOTween.To(
|
||||||
|
CirclePlugin.Get(), () => target.anchoredPosition, x => target.anchoredPosition = x, center, duration
|
||||||
|
);
|
||||||
|
t.SetOptions(endValueDegrees, relativeCenter, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
|
||||||
|
public static class Utils
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
|
||||||
|
/// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
|
||||||
|
/// </summary>
|
||||||
|
public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to)
|
||||||
|
{
|
||||||
|
Vector2 localPoint;
|
||||||
|
Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin);
|
||||||
|
Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position);
|
||||||
|
screenP += fromPivotDerivedOffset;
|
||||||
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint);
|
||||||
|
Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin);
|
||||||
|
return to.anchoredPosition + localPoint - pivotDerivedOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a060394c03331a64392db53a10e7f2d1
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
@ -0,0 +1,389 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
//#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0)
|
||||||
|
//using Task = System.Threading.Tasks.Task;
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Shortcuts/functions that are not strictly related to specific Modules
|
||||||
|
/// but are available only on some Unity versions
|
||||||
|
/// </summary>
|
||||||
|
public static class DOTweenModuleUnityVersion
|
||||||
|
{
|
||||||
|
#region Material
|
||||||
|
|
||||||
|
/// <summary>Tweens a Material's color using the given gradient
|
||||||
|
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
|
||||||
|
public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
|
||||||
|
{
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
GradientColorKey[] colors = gradient.colorKeys;
|
||||||
|
int len = colors.Length;
|
||||||
|
for (int i = 0; i < len; ++i) {
|
||||||
|
GradientColorKey c = colors[i];
|
||||||
|
if (i == 0 && c.time <= 0) {
|
||||||
|
target.color = c.color;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
float colorDuration = i == len - 1
|
||||||
|
? duration - s.Duration(false) // Verifies that total duration is correct
|
||||||
|
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
|
||||||
|
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
|
||||||
|
}
|
||||||
|
s.SetTarget(target);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a Material's named color property using the given gradient
|
||||||
|
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
|
||||||
|
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="gradient">The gradient to use</param>
|
||||||
|
/// <param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
|
||||||
|
{
|
||||||
|
Sequence s = DOTween.Sequence();
|
||||||
|
GradientColorKey[] colors = gradient.colorKeys;
|
||||||
|
int len = colors.Length;
|
||||||
|
for (int i = 0; i < len; ++i) {
|
||||||
|
GradientColorKey c = colors[i];
|
||||||
|
if (i == 0 && c.time <= 0) {
|
||||||
|
target.SetColor(property, c.color);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
float colorDuration = i == len - 1
|
||||||
|
? duration - s.Duration(false) // Verifies that total duration is correct
|
||||||
|
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
|
||||||
|
s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
|
||||||
|
}
|
||||||
|
s.SetTarget(target);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region CustomYieldInstructions
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or complete.
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForCompletion(true);</code>
|
||||||
|
/// </summary>
|
||||||
|
public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForCompletion(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or rewinded.
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForRewind();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForRewind(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed.
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForKill();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForKill(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or has gone through the given amount of loops.
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForElapsedLoops(2);</code>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="elapsedLoops">Elapsed loops to wait for</param>
|
||||||
|
public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed
|
||||||
|
/// or has reached the given time position (loops included, delays excluded).
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForPosition(2.5f);</code>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position">Position (loops included, delays excluded) to wait for</param>
|
||||||
|
public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForPosition(t, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or started
|
||||||
|
/// (meaning when the tween is set in a playing state the first time, after any eventual delay).
|
||||||
|
/// It can be used inside a coroutine as a yield.
|
||||||
|
/// <para>Example usage:</para><code>yield return myTween.WaitForStart();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new DOTweenCYInstruction.WaitForStart(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
#region Unity 2018.1 or Newer
|
||||||
|
|
||||||
|
#region Material
|
||||||
|
|
||||||
|
/// <summary>Tweens a Material's named texture offset property with the given ID to the given value.
|
||||||
|
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="propertyID">The ID of the material property to tween (also called nameID in Unity's manual)</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
|
||||||
|
{
|
||||||
|
if (!target.HasProperty(propertyID)) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a Material's named texture scale property with the given ID to the given value.
|
||||||
|
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
|
||||||
|
/// <param name="endValue">The end value to reach</param>
|
||||||
|
/// <param name="propertyID">The ID of the material property to tween (also called nameID in Unity's manual)</param>
|
||||||
|
/// <param name="duration">The duration of the tween</param>
|
||||||
|
public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
|
||||||
|
{
|
||||||
|
if (!target.HasProperty(propertyID)) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region .NET 4.6 or Newer
|
||||||
|
|
||||||
|
#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0)
|
||||||
|
|
||||||
|
#region Async Instructions
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or complete.
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.WaitForCompletion();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForCompletion(this Tween t)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active && !t.IsComplete()) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or rewinded.
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.AsyncWaitForRewind();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForRewind(this Tween t)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0)) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed.
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.AsyncWaitForKill();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForKill(this Tween t)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or has gone through the given amount of loops.
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.AsyncWaitForElapsedLoops();</code>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="elapsedLoops">Elapsed loops to wait for</param>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForElapsedLoops(this Tween t, int elapsedLoops)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active && t.CompletedLoops() < elapsedLoops) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or started
|
||||||
|
/// (meaning when the tween is set in a playing state the first time, after any eventual delay).
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.AsyncWaitForPosition();</code>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position">Position (loops included, delays excluded) to wait for</param>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForPosition(this Tween t, float position)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active && t.position * (t.CompletedLoops() + 1) < position) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed.
|
||||||
|
/// It can be used inside an async operation.
|
||||||
|
/// <para>Example usage:</para><code>await myTween.AsyncWaitForKill();</code>
|
||||||
|
/// </summary>
|
||||||
|
public static async System.Threading.Tasks.Task AsyncWaitForStart(this Tween t)
|
||||||
|
{
|
||||||
|
if (!t.active) {
|
||||||
|
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (t.active && !t.playedOnce) await System.Threading.Tasks.Task.Yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
|
||||||
|
public static class DOTweenCYInstruction
|
||||||
|
{
|
||||||
|
public class WaitForCompletion : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active && !t.IsComplete();
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
public WaitForCompletion(Tween tween)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitForRewind : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
public WaitForRewind(Tween tween)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitForKill : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active;
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
public WaitForKill(Tween tween)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitForElapsedLoops : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active && t.CompletedLoops() < elapsedLoops;
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
readonly int elapsedLoops;
|
||||||
|
public WaitForElapsedLoops(Tween tween, int elapsedLoops)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
this.elapsedLoops = elapsedLoops;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitForPosition : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active && t.position * (t.CompletedLoops() + 1) < position;
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
readonly float position;
|
||||||
|
public WaitForPosition(Tween tween, float position)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitForStart : CustomYieldInstruction
|
||||||
|
{
|
||||||
|
public override bool keepWaiting { get {
|
||||||
|
return t.active && !t.playedOnce;
|
||||||
|
}}
|
||||||
|
readonly Tween t;
|
||||||
|
public WaitForStart(Tween tween)
|
||||||
|
{
|
||||||
|
t = tween;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 63c02322328255542995bd02b47b0457
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
167
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs
Normal file
167
Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
using UnityEngine;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins.Core.PathCore;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utility functions that deal with available Modules.
|
||||||
|
/// Modules defines:
|
||||||
|
/// - DOTAUDIO
|
||||||
|
/// - DOTPHYSICS
|
||||||
|
/// - DOTPHYSICS2D
|
||||||
|
/// - DOTSPRITE
|
||||||
|
/// - DOTUI
|
||||||
|
/// Extra defines set and used for implementation of external assets:
|
||||||
|
/// - DOTWEEN_TMP ► TextMesh Pro
|
||||||
|
/// - DOTWEEN_TK2D ► 2D Toolkit
|
||||||
|
/// </summary>
|
||||||
|
public static class DOTweenModuleUtils
|
||||||
|
{
|
||||||
|
static bool _initialized;
|
||||||
|
|
||||||
|
#region Reflection
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called via Reflection by DOTweenComponent on Awake
|
||||||
|
/// </summary>
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
if (_initialized) return;
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
|
DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
||||||
|
UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
|
||||||
|
#else
|
||||||
|
UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
#pragma warning disable
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
// Just used to preserve methods when building, never called
|
||||||
|
static void Preserver()
|
||||||
|
{
|
||||||
|
Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
|
||||||
|
}
|
||||||
|
#pragma warning restore
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
|
||||||
|
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
||||||
|
static void PlaymodeStateChanged()
|
||||||
|
#else
|
||||||
|
static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (DOTween.instance == null) return;
|
||||||
|
DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
|
||||||
|
|
||||||
|
public static class Physics
|
||||||
|
{
|
||||||
|
// Called via DOTweenExternalCommand callback
|
||||||
|
public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
|
||||||
|
{
|
||||||
|
#if true // PHYSICS_MARKER
|
||||||
|
if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
|
||||||
|
else trans.rotation = newRot;
|
||||||
|
#else
|
||||||
|
trans.rotation = newRot;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
|
||||||
|
public static bool HasRigidbody2D(Component target)
|
||||||
|
{
|
||||||
|
#if true // PHYSICS2D_MARKER
|
||||||
|
return target.GetComponent<Rigidbody2D>() != null;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Called via Reflection
|
||||||
|
|
||||||
|
|
||||||
|
// Called via Reflection by DOTweenPathInspector
|
||||||
|
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
|
public static bool HasRigidbody(Component target)
|
||||||
|
{
|
||||||
|
#if true // PHYSICS_MARKER
|
||||||
|
return target.GetComponent<Rigidbody>() != null;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called via Reflection by DOTweenPath
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
|
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
|
||||||
|
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
|
||||||
|
){
|
||||||
|
TweenerCore<Vector3, Path, PathOptions> t = null;
|
||||||
|
bool rBodyFoundAndTweened = false;
|
||||||
|
#if true // PHYSICS_MARKER
|
||||||
|
if (tweenRigidbody) {
|
||||||
|
Rigidbody rBody = target.GetComponent<Rigidbody>();
|
||||||
|
if (rBody != null) {
|
||||||
|
rBodyFoundAndTweened = true;
|
||||||
|
t = isLocal
|
||||||
|
? rBody.DOLocalPath(path, duration, pathMode)
|
||||||
|
: rBody.DOPath(path, duration, pathMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if true // PHYSICS2D_MARKER
|
||||||
|
if (!rBodyFoundAndTweened && tweenRigidbody) {
|
||||||
|
Rigidbody2D rBody2D = target.GetComponent<Rigidbody2D>();
|
||||||
|
if (rBody2D != null) {
|
||||||
|
rBodyFoundAndTweened = true;
|
||||||
|
t = isLocal
|
||||||
|
? rBody2D.DOLocalPath(path, duration, pathMode)
|
||||||
|
: rBody2D.DOPath(path, duration, pathMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!rBodyFoundAndTweened) {
|
||||||
|
t = isLocal
|
||||||
|
? target.transform.DOLocalPath(path, duration, pathMode)
|
||||||
|
: target.transform.DOPath(path, duration, pathMode);
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7bcaf917d9cf5b84090421a5a2abe42e
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
8
Assets/Scenes.meta
Normal file
8
Assets/Scenes.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a2eaed3987fcc4a6ba24196057ee857b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
454
Assets/Scenes/Game.unity
Normal file
454
Assets/Scenes/Game.unity
Normal file
@ -0,0 +1,454 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!29 &1
|
||||||
|
OcclusionCullingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_OcclusionBakeSettings:
|
||||||
|
smallestOccluder: 5
|
||||||
|
smallestHole: 0.25
|
||||||
|
backfaceThreshold: 100
|
||||||
|
m_SceneGUID: 00000000000000000000000000000000
|
||||||
|
m_OcclusionCullingData: {fileID: 0}
|
||||||
|
--- !u!104 &2
|
||||||
|
RenderSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 9
|
||||||
|
m_Fog: 0
|
||||||
|
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
|
m_FogMode: 3
|
||||||
|
m_FogDensity: 0.01
|
||||||
|
m_LinearFogStart: 0
|
||||||
|
m_LinearFogEnd: 300
|
||||||
|
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||||
|
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||||
|
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||||
|
m_AmbientIntensity: 1
|
||||||
|
m_AmbientMode: 0
|
||||||
|
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||||
|
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_HaloStrength: 0.5
|
||||||
|
m_FlareStrength: 1
|
||||||
|
m_FlareFadeSpeed: 3
|
||||||
|
m_HaloTexture: {fileID: 0}
|
||||||
|
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_DefaultReflectionMode: 0
|
||||||
|
m_DefaultReflectionResolution: 128
|
||||||
|
m_ReflectionBounces: 1
|
||||||
|
m_ReflectionIntensity: 1
|
||||||
|
m_CustomReflection: {fileID: 0}
|
||||||
|
m_Sun: {fileID: 705507994}
|
||||||
|
m_UseRadianceAmbientProbe: 0
|
||||||
|
--- !u!157 &3
|
||||||
|
LightmapSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 12
|
||||||
|
m_GIWorkflowMode: 1
|
||||||
|
m_GISettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_EnvironmentLightingMode: 0
|
||||||
|
m_EnableBakedLightmaps: 1
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_LightmapEditorSettings:
|
||||||
|
serializedVersion: 12
|
||||||
|
m_Resolution: 2
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_AtlasSize: 1024
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAmbientOcclusion: 0
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_TextureCompression: 1
|
||||||
|
m_FinalGather: 0
|
||||||
|
m_FinalGatherFiltering: 1
|
||||||
|
m_FinalGatherRayCount: 256
|
||||||
|
m_ReflectionCompression: 2
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 500
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVREnvironmentSampleCount: 500
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_PVRFilteringMode: 2
|
||||||
|
m_PVRDenoiserTypeDirect: 0
|
||||||
|
m_PVRDenoiserTypeIndirect: 0
|
||||||
|
m_PVRDenoiserTypeAO: 0
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVREnvironmentMIS: 0
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_LightingDataAsset: {fileID: 0}
|
||||||
|
m_LightingSettings: {fileID: 0}
|
||||||
|
--- !u!196 &4
|
||||||
|
NavMeshSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_BuildSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
agentTypeID: 0
|
||||||
|
agentRadius: 0.5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: 0.4
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
manualCellSize: 0
|
||||||
|
cellSize: 0.16666667
|
||||||
|
manualTileSize: 0
|
||||||
|
tileSize: 256
|
||||||
|
accuratePlacement: 0
|
||||||
|
maxJobWorkers: 0
|
||||||
|
preserveTilesOutsideBounds: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &628608732
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 628608733}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: ---------------------Loader/Managers---------------------
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &628608733
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 628608732}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 2
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &705507993
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 705507995}
|
||||||
|
- component: {fileID: 705507994}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Directional Light
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!108 &705507994
|
||||||
|
Light:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 705507993}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 10
|
||||||
|
m_Type: 1
|
||||||
|
m_Shape: 0
|
||||||
|
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||||
|
m_Intensity: 1
|
||||||
|
m_Range: 10
|
||||||
|
m_SpotAngle: 30
|
||||||
|
m_InnerSpotAngle: 21.802082
|
||||||
|
m_CookieSize: 10
|
||||||
|
m_Shadows:
|
||||||
|
m_Type: 2
|
||||||
|
m_Resolution: -1
|
||||||
|
m_CustomResolution: -1
|
||||||
|
m_Strength: 1
|
||||||
|
m_Bias: 0.05
|
||||||
|
m_NormalBias: 0.4
|
||||||
|
m_NearPlane: 0.2
|
||||||
|
m_CullingMatrixOverride:
|
||||||
|
e00: 1
|
||||||
|
e01: 0
|
||||||
|
e02: 0
|
||||||
|
e03: 0
|
||||||
|
e10: 0
|
||||||
|
e11: 1
|
||||||
|
e12: 0
|
||||||
|
e13: 0
|
||||||
|
e20: 0
|
||||||
|
e21: 0
|
||||||
|
e22: 1
|
||||||
|
e23: 0
|
||||||
|
e30: 0
|
||||||
|
e31: 0
|
||||||
|
e32: 0
|
||||||
|
e33: 1
|
||||||
|
m_UseCullingMatrixOverride: 0
|
||||||
|
m_Cookie: {fileID: 0}
|
||||||
|
m_DrawHalo: 0
|
||||||
|
m_Flare: {fileID: 0}
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_Lightmapping: 1
|
||||||
|
m_LightShadowCasterMode: 0
|
||||||
|
m_AreaSize: {x: 1, y: 1}
|
||||||
|
m_BounceIntensity: 1
|
||||||
|
m_ColorTemperature: 6570
|
||||||
|
m_UseColorTemperature: 0
|
||||||
|
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_UseBoundingSphereOverride: 0
|
||||||
|
m_UseViewFrustumForShadowCasterCull: 1
|
||||||
|
m_ShadowRadius: 0
|
||||||
|
m_ShadowAngle: 0
|
||||||
|
--- !u!4 &705507995
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 705507993}
|
||||||
|
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||||
|
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||||
|
--- !u!1 &963194225
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 963194228}
|
||||||
|
- component: {fileID: 963194227}
|
||||||
|
- component: {fileID: 963194226}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Main Camera
|
||||||
|
m_TagString: MainCamera
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!81 &963194226
|
||||||
|
AudioListener:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 963194225}
|
||||||
|
m_Enabled: 1
|
||||||
|
--- !u!20 &963194227
|
||||||
|
Camera:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 963194225}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ClearFlags: 1
|
||||||
|
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||||
|
m_projectionMatrixMode: 1
|
||||||
|
m_GateFitMode: 2
|
||||||
|
m_FOVAxisMode: 0
|
||||||
|
m_SensorSize: {x: 36, y: 24}
|
||||||
|
m_LensShift: {x: 0, y: 0}
|
||||||
|
m_FocalLength: 50
|
||||||
|
m_NormalizedViewPortRect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
|
near clip plane: 0.3
|
||||||
|
far clip plane: 1000
|
||||||
|
field of view: 60
|
||||||
|
orthographic: 0
|
||||||
|
orthographic size: 5
|
||||||
|
m_Depth: -1
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_RenderingPath: -1
|
||||||
|
m_TargetTexture: {fileID: 0}
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
m_TargetEye: 3
|
||||||
|
m_HDR: 1
|
||||||
|
m_AllowMSAA: 1
|
||||||
|
m_AllowDynamicResolution: 0
|
||||||
|
m_ForceIntoRT: 0
|
||||||
|
m_OcclusionCulling: 1
|
||||||
|
m_StereoConvergence: 10
|
||||||
|
m_StereoSeparation: 0.022
|
||||||
|
--- !u!4 &963194228
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 963194225}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1107252688
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1107252689}
|
||||||
|
- component: {fileID: 1107252690}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: PopupManager
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1107252689
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1107252688}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 4
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1107252690
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1107252688}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 21bc1be624c3645a2a713aa5171fc9aa, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!1 &1335794569
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1335794571}
|
||||||
|
- component: {fileID: 1335794570}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: GameBootLoader
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1335794570
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1335794569}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: c296d1232df484b49930ca2b13fb6fa9, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
uiBases: []
|
||||||
|
baseObjects: []
|
||||||
|
--- !u!4 &1335794571
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1335794569}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 3
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1728459364
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1728459365}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: ---------------------UI------------------------------
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1728459365
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1728459364}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 5
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
7
Assets/Scenes/Game.unity.meta
Normal file
7
Assets/Scenes/Game.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts.meta
Normal file
8
Assets/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dc69ae7ab03124fb3a43f45ca14f89fd
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction.meta
Normal file
8
Assets/Scripts/Abstraction.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d221f1892d4645d4b8917581cc76604d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction/#Main.meta
Normal file
8
Assets/Scripts/Abstraction/#Main.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21c8cd8c436154d98afe1bdb3762146c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
57
Assets/Scripts/Abstraction/#Main/InterfaceManager.cs
Normal file
57
Assets/Scripts/Abstraction/#Main/InterfaceManager.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class InterfaceManager
|
||||||
|
{
|
||||||
|
private static Dictionary<string, IBase> interfacesDict = new Dictionary<string, IBase>();
|
||||||
|
|
||||||
|
#region Singleton
|
||||||
|
public static InterfaceManager Instance { get; private set; }
|
||||||
|
|
||||||
|
public static void InitInstance()
|
||||||
|
{
|
||||||
|
if (Instance == null)
|
||||||
|
{
|
||||||
|
Instance = new InterfaceManager();
|
||||||
|
// Debug.Log("Initialized interface manager");
|
||||||
|
}
|
||||||
|
// Debug.Log($"Initialized interface manager: {Instance}");
|
||||||
|
Debug.Log($"Initialized interface manager: {interfacesDict.Count}");
|
||||||
|
foreach (var pair in interfacesDict)
|
||||||
|
{
|
||||||
|
Debug.Log($"Initialized interface manager: key: {pair.Key}, value: {pair.Value}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public InterfaceManager()
|
||||||
|
{
|
||||||
|
interfacesDict = new Dictionary<string, IBase>();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void RegisterInterface<T>(IBase interfaceInst) where T : IBase
|
||||||
|
{
|
||||||
|
string interfaceType = typeof(T).ToString();
|
||||||
|
|
||||||
|
if (!interfacesDict.ContainsKey(interfaceType))
|
||||||
|
{
|
||||||
|
interfacesDict.Add(interfaceType, interfaceInst);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
interfacesDict[interfaceType] = interfaceInst;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetInterfaceInstance<T>() where T : IBase
|
||||||
|
{
|
||||||
|
string interfaceType = typeof(T).ToString();
|
||||||
|
|
||||||
|
if (interfacesDict.ContainsKey(interfaceType))
|
||||||
|
return (T)interfacesDict[interfaceType];
|
||||||
|
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Abstraction/#Main/InterfaceManager.cs.meta
Normal file
11
Assets/Scripts/Abstraction/#Main/InterfaceManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6166c27df5247ed4a82850b1c7d7a406
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction/Data.meta
Normal file
8
Assets/Scripts/Abstraction/Data.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a00ece75f292c4797b6970abacad30b8
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
5
Assets/Scripts/Abstraction/Data/IDataLoader.cs
Normal file
5
Assets/Scripts/Abstraction/Data/IDataLoader.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
public interface IDataLoader
|
||||||
|
{
|
||||||
|
void InitializeData();
|
||||||
|
}
|
||||||
11
Assets/Scripts/Abstraction/Data/IDataLoader.cs.meta
Normal file
11
Assets/Scripts/Abstraction/Data/IDataLoader.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7566c016daf3b4cdc86142232401c9ab
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction/Loading.meta
Normal file
8
Assets/Scripts/Abstraction/Loading.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ac3dd10431db3422d8ebba19d1b95b2e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
4
Assets/Scripts/Abstraction/Loading/IBootLoader.cs
Normal file
4
Assets/Scripts/Abstraction/Loading/IBootLoader.cs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
public interface IBootLoader
|
||||||
|
{
|
||||||
|
public void Initialize();
|
||||||
|
}
|
||||||
11
Assets/Scripts/Abstraction/Loading/IBootLoader.cs.meta
Normal file
11
Assets/Scripts/Abstraction/Loading/IBootLoader.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 840defa9c436b42979d7d8b0f36e5fe4
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction/Manager.meta
Normal file
8
Assets/Scripts/Abstraction/Manager.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2d7776ebeda234f9e86c0dccc8c5690a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
3
Assets/Scripts/Abstraction/Manager/IBase.cs
Normal file
3
Assets/Scripts/Abstraction/Manager/IBase.cs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public interface IBase
|
||||||
|
{
|
||||||
|
}
|
||||||
11
Assets/Scripts/Abstraction/Manager/IBase.cs.meta
Normal file
11
Assets/Scripts/Abstraction/Manager/IBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 95b719af7133c184a8a67d96f05556e9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Abstraction/UI.meta
Normal file
8
Assets/Scripts/Abstraction/UI.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a8b6f570edfb543d4a7925a38b7001ce
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
5
Assets/Scripts/Abstraction/UI/IUIBase.cs
Normal file
5
Assets/Scripts/Abstraction/UI/IUIBase.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
public interface IUIBase
|
||||||
|
{
|
||||||
|
void Initialize();
|
||||||
|
}
|
||||||
11
Assets/Scripts/Abstraction/UI/IUIBase.cs.meta
Normal file
11
Assets/Scripts/Abstraction/UI/IUIBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0780f77712a5a483a90fc4e9acb6b73c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Input.meta
Normal file
8
Assets/Scripts/Input.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0298e7c87cc174ad2b1c5ef0d53f4885
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
22
Assets/Scripts/Input/InputManager.cs
Normal file
22
Assets/Scripts/Input/InputManager.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class InputManager : MonoBehaviour, IBase, IBootLoader
|
||||||
|
{
|
||||||
|
public bool IsInputEnabled
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
InterfaceManager.Instance?.RegisterInterface<InputManager>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetInputState(bool state)
|
||||||
|
{
|
||||||
|
IsInputEnabled = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Input/InputManager.cs.meta
Normal file
11
Assets/Scripts/Input/InputManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 65fc56bd12ad747bf989f140be8bc855
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Loader.meta
Normal file
8
Assets/Scripts/Loader.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7dd2ef08ba93941b6939345f41789467
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
34
Assets/Scripts/Loader/BootLoader.cs
Normal file
34
Assets/Scripts/Loader/BootLoader.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public abstract class BootLoader : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Tooltip("For keeping track of all ui related objects: screens and popups")]
|
||||||
|
[SerializeField] private GameObject[] uiBases;
|
||||||
|
|
||||||
|
protected virtual void Start()
|
||||||
|
{
|
||||||
|
InterfaceManager.InitInstance();
|
||||||
|
|
||||||
|
InitBootLoaders();
|
||||||
|
InitializeUIBases();
|
||||||
|
InitializeData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeUIBases()
|
||||||
|
{
|
||||||
|
if (uiBases != null && uiBases.Length > 0)
|
||||||
|
foreach (GameObject uiBase in uiBases)
|
||||||
|
uiBase.GetComponent<IUIBase>().Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void InitBootLoaders();
|
||||||
|
protected abstract void InitializeData();
|
||||||
|
|
||||||
|
protected bool GetLoader<T>(Transform loader, out T outLoader)
|
||||||
|
{
|
||||||
|
outLoader = loader.GetComponent<T>();
|
||||||
|
return outLoader != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Loader/BootLoader.cs.meta
Normal file
11
Assets/Scripts/Loader/BootLoader.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ea08392cc8bf5554cbc14e888e26ec76
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
54
Assets/Scripts/Loader/GameBootLoader.cs
Normal file
54
Assets/Scripts/Loader/GameBootLoader.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GameBootLoader : BootLoader
|
||||||
|
{
|
||||||
|
[SerializeField] private GameObject[] baseObjects;
|
||||||
|
// [SerializeField] private BaseSO[] scriptables;
|
||||||
|
|
||||||
|
private bool hasInitializedScriptables = false;
|
||||||
|
|
||||||
|
protected override void InitBootLoaders()
|
||||||
|
{
|
||||||
|
IBootLoader bootLoader = null;
|
||||||
|
|
||||||
|
foreach (GameObject loader in baseObjects)
|
||||||
|
{
|
||||||
|
if (GetLoader<IBootLoader>(loader.transform, out bootLoader))
|
||||||
|
{
|
||||||
|
bootLoader.Initialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void InitializeData()
|
||||||
|
{
|
||||||
|
InitializeScriptablesData();
|
||||||
|
|
||||||
|
IDataLoader dataLoader = null;
|
||||||
|
foreach (GameObject loader in baseObjects)
|
||||||
|
{
|
||||||
|
if (GetLoader<IDataLoader>(loader.transform, out dataLoader))
|
||||||
|
{
|
||||||
|
dataLoader.InitializeData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Start()
|
||||||
|
{
|
||||||
|
base.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeScriptablesData()
|
||||||
|
{
|
||||||
|
// if (!hasInitializedScriptables)
|
||||||
|
// {
|
||||||
|
// foreach (BaseSO scriptableObject in scriptables)
|
||||||
|
// {
|
||||||
|
// scriptableObject.InitData();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// hasInitializedScriptables = true;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Loader/GameBootLoader.cs.meta
Normal file
11
Assets/Scripts/Loader/GameBootLoader.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c296d1232df484b49930ca2b13fb6fa9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI.meta
Normal file
8
Assets/Scripts/UI.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49d57ff87563e4f46a289706b5ef832b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Components.meta
Normal file
8
Assets/Scripts/UI/Components.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e260dd17d716443ce8b8b2fbe1bac325
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Components/Button.meta
Normal file
8
Assets/Scripts/UI/Components/Button.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e265131402b6244848312ade03fe3f8a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
36
Assets/Scripts/UI/Components/Button/ButtonSound.cs
Normal file
36
Assets/Scripts/UI/Components/Button/ButtonSound.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class ButtonSound : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Button buttonComp;
|
||||||
|
// private SoundManager soundManager;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
buttonComp = GetComponent<Button>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
buttonComp.onClick.AddListener(OnClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
buttonComp.onClick.RemoveListener(OnClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnClick()
|
||||||
|
{
|
||||||
|
SetSoundManager();
|
||||||
|
// soundManager.PlayButtonSoundClip(SoundType.Button_Click);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetSoundManager()
|
||||||
|
{
|
||||||
|
// soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Components/Button/ButtonSound.cs.meta
Normal file
11
Assets/Scripts/UI/Components/Button/ButtonSound.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2d4fa4234b03041d0a05e127ebcb21c3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Components/Panel.meta
Normal file
8
Assets/Scripts/UI/Components/Panel.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 198d6843f0243478697579ab21560d5c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
70
Assets/Scripts/UI/Components/Panel/UIScaler.cs
Normal file
70
Assets/Scripts/UI/Components/Panel/UIScaler.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Summary:
|
||||||
|
Add to any UI panel for example add to popup or screen for
|
||||||
|
desired effect and set settings inside inspector
|
||||||
|
|
||||||
|
Note: add a canvas group if using this component
|
||||||
|
*/
|
||||||
|
public class UIScaler : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Popup Scaling")]
|
||||||
|
[SerializeField] protected Transform popupScaleContent;
|
||||||
|
// [SerializeField] protected bool shouldScale = true;
|
||||||
|
[SerializeField] protected float zoomDuration = 0.5f;
|
||||||
|
[SerializeField] protected PopupScalerType popupScalerType = PopupScalerType.Zoom;
|
||||||
|
[SerializeField] protected float fadeDuration;
|
||||||
|
|
||||||
|
protected CanvasGroup canvasGroup;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
canvasGroup = GetComponent<CanvasGroup>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ApplyEffectOnShow(Action onComplete)
|
||||||
|
{
|
||||||
|
switch (popupScalerType)
|
||||||
|
{
|
||||||
|
case PopupScalerType.None:
|
||||||
|
onComplete?.Invoke();
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Zoom:
|
||||||
|
popupScaleContent.localScale = Vector3.zero;
|
||||||
|
onComplete?.Invoke();
|
||||||
|
popupScaleContent.DOScale(Vector3.one, zoomDuration);
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Fade:
|
||||||
|
canvasGroup.alpha = 0;
|
||||||
|
onComplete?.Invoke();
|
||||||
|
canvasGroup.DOFade(1, fadeDuration);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ActivateCanvasGroup(bool state)
|
||||||
|
{
|
||||||
|
canvasGroup.interactable = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ApplyEffectOnHide(Action onComplete)
|
||||||
|
{
|
||||||
|
switch (popupScalerType)
|
||||||
|
{
|
||||||
|
case PopupScalerType.None:
|
||||||
|
onComplete?.Invoke();
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Zoom:
|
||||||
|
popupScaleContent.DOScale(Vector3.zero, zoomDuration).OnComplete(() => onComplete?.Invoke());
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Fade:
|
||||||
|
canvasGroup.DOFade(0, fadeDuration).OnComplete(() => onComplete?.Invoke());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Components/Panel/UIScaler.cs.meta
Normal file
11
Assets/Scripts/UI/Components/Panel/UIScaler.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1ea1f5c9d63b45d586ec3585f5120bc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Managers.meta
Normal file
8
Assets/Scripts/UI/Managers.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4c346b3dc86ec40d498d45d5bbc94a90
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
110
Assets/Scripts/UI/Managers/PopupManager.cs
Normal file
110
Assets/Scripts/UI/Managers/PopupManager.cs
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// public class BaseUIManager<T> : MonoBehaviour, IBase, IBootLoader where T : UIBase
|
||||||
|
// {
|
||||||
|
// public void Initialize()
|
||||||
|
// {
|
||||||
|
// throw new NotImplementedException();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
public enum PopupResultEvent
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
LifeLostInGameOver,
|
||||||
|
OnSpentCoinsForLevel,
|
||||||
|
OnFreeRefillHealth,
|
||||||
|
OnCancelRefillHealth,
|
||||||
|
FreeRefillUsed,
|
||||||
|
LivesFull
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PopupManager : MonoBehaviour, IBase, IBootLoader
|
||||||
|
{
|
||||||
|
private Dictionary<PopupType, PopupBase> popupsDict = new Dictionary<PopupType, PopupBase>();
|
||||||
|
|
||||||
|
private PopupBase activePopup = null;
|
||||||
|
public PopupBase GetActivePU() => activePopup;
|
||||||
|
|
||||||
|
private Stack<PopupBase> popupBasesStack = new Stack<PopupBase>();
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
InterfaceManager.Instance?.RegisterInterface<PopupManager>(this);
|
||||||
|
popupsDict.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterPopup(PopupBase popupBase)
|
||||||
|
{
|
||||||
|
if (!popupsDict.ContainsKey(popupBase.PopupType))
|
||||||
|
popupsDict.Add(popupBase.PopupType, popupBase);
|
||||||
|
else
|
||||||
|
popupsDict[popupBase.PopupType] = popupBase;
|
||||||
|
|
||||||
|
popupBase.InitNextActionEvent((resultType) => OnPopupClosedExceuteEvent(resultType));
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetPopup<T>(PopupType uiType) where T : PopupBase
|
||||||
|
{
|
||||||
|
return popupsDict.ContainsKey(uiType) ? (T)popupsDict[uiType] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowPopup(PopupType uiType)
|
||||||
|
{
|
||||||
|
activePopup = popupsDict[uiType];
|
||||||
|
if (activePopup != null)
|
||||||
|
{
|
||||||
|
Debug.Log($"Stack check :: activePopup added to stack: {activePopup.PopupType}");
|
||||||
|
popupBasesStack.Push(activePopup);
|
||||||
|
activePopup.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HidePopup(PopupType popupType)
|
||||||
|
{
|
||||||
|
if (popupsDict[popupType] != null)
|
||||||
|
{
|
||||||
|
var poppedElement = popupBasesStack.Pop();
|
||||||
|
Debug.Log($"Stack check :: before popupBasesStack: {popupBasesStack?.Count}");
|
||||||
|
Debug.Log($"Stack check :: popped element: {poppedElement.PopupType}");
|
||||||
|
|
||||||
|
activePopup = popupBasesStack.Count > 0 ? popupBasesStack.Peek() : null;
|
||||||
|
popupsDict[popupType].Hide();
|
||||||
|
|
||||||
|
Debug.Log($"Stack check :: activePopup: {activePopup}");
|
||||||
|
|
||||||
|
Debug.Log($"Stack check :: peeked element type: {activePopup?.PopupType}, hidden element from dict: {popupType}");
|
||||||
|
Debug.Log($"Stack check :: after popupBasesStack: {popupBasesStack?.Count}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPopupClosedExceuteEvent(PopupResultEvent popupResultEvent)
|
||||||
|
{
|
||||||
|
switch (popupResultEvent)
|
||||||
|
{
|
||||||
|
case PopupResultEvent.None:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PopupResultEvent.LifeLostInGameOver:
|
||||||
|
ShowPopup(PopupType.LevelFailPopup);
|
||||||
|
break;
|
||||||
|
case PopupResultEvent.OnSpentCoinsForLevel:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PopupResultEvent.OnFreeRefillHealth:
|
||||||
|
ShowPopup(PopupType.FreeRefillPopup);
|
||||||
|
break;
|
||||||
|
case PopupResultEvent.LivesFull:
|
||||||
|
case PopupResultEvent.OnCancelRefillHealth:
|
||||||
|
case PopupResultEvent.FreeRefillUsed:
|
||||||
|
Debug.Log($"GetMoreLivesPopup");
|
||||||
|
ShowPopup(PopupType.GetMoreLivesPopup);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Managers/PopupManager.cs.meta
Normal file
11
Assets/Scripts/UI/Managers/PopupManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21bc1be624c3645a2a713aa5171fc9aa
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
71
Assets/Scripts/UI/Managers/ScreenManager.cs
Normal file
71
Assets/Scripts/UI/Managers/ScreenManager.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum ScreenResultEvent
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
OnSettingsClicked
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScreenManager : MonoBehaviour, IBase, IBootLoader
|
||||||
|
{
|
||||||
|
private Dictionary<ScreenType, ScreenBase> screensDict = new Dictionary<ScreenType, ScreenBase>();
|
||||||
|
|
||||||
|
private ScreenBase activeScreen = null;
|
||||||
|
private Stack<ScreenBase> screenBasesStack = new Stack<ScreenBase>();
|
||||||
|
|
||||||
|
public ScreenBase GetActiveScreen() => activeScreen;
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
InterfaceManager.Instance?.RegisterInterface<ScreenManager>(this);
|
||||||
|
screensDict.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterScreen(ScreenBase screenBase)
|
||||||
|
{
|
||||||
|
if (!screensDict.ContainsKey(screenBase.ScreenType))
|
||||||
|
screensDict.Add(screenBase.ScreenType, screenBase);
|
||||||
|
else
|
||||||
|
screensDict[screenBase.ScreenType] = screenBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetScreen<T>(ScreenType screenType) where T : ScreenBase
|
||||||
|
{
|
||||||
|
return screensDict.ContainsKey(screenType) ? (T)screensDict[screenType] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowScreen(ScreenType screenType)
|
||||||
|
{
|
||||||
|
activeScreen = screensDict[screenType];
|
||||||
|
if (activeScreen != null)
|
||||||
|
{
|
||||||
|
screenBasesStack.Push(activeScreen);
|
||||||
|
activeScreen.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideScreen(ScreenType screenType)
|
||||||
|
{
|
||||||
|
if (screensDict[screenType] != null)
|
||||||
|
{
|
||||||
|
screenBasesStack.Pop();
|
||||||
|
Debug.Log($"ScreenManager check: screenBasesStack.Count: {screenBasesStack.Count}");
|
||||||
|
activeScreen = screenBasesStack.Count > 0 ? screenBasesStack.Peek() : null;
|
||||||
|
screensDict[screenType].Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void OnScreenEventExecute(ScreenResultEvent screenResultEvent)
|
||||||
|
// {
|
||||||
|
// switch (screenResultEvent)
|
||||||
|
// {
|
||||||
|
// case ScreenResultEvent.None:
|
||||||
|
|
||||||
|
// break;
|
||||||
|
// case ScreenResultEvent.OnSettingsClicked:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Managers/ScreenManager.cs.meta
Normal file
11
Assets/Scripts/UI/Managers/ScreenManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8bc3eb3d39087402f812f38b14c260dd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Pages.meta
Normal file
8
Assets/Scripts/UI/Pages.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 84823ffc1276548d995b44a8ac14734b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/UI/Pages/Bases.meta
Normal file
8
Assets/Scripts/UI/Pages/Bases.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 97f174bcb48b74d8198d104afc0eb06c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
109
Assets/Scripts/UI/Pages/Bases/PopupBase.cs
Normal file
109
Assets/Scripts/UI/Pages/Bases/PopupBase.cs
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
using System.Numerics;
|
||||||
|
using System;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum PopupType
|
||||||
|
{
|
||||||
|
FTUE_Popup, //
|
||||||
|
SettingsPopup,
|
||||||
|
RestartPopup, //
|
||||||
|
LevelCompletePopup,
|
||||||
|
GameOverPopup,
|
||||||
|
LevelFailPopup,
|
||||||
|
GetMoreLivesPopup, //
|
||||||
|
FreeRefillPopup,
|
||||||
|
FeedbackPopup,
|
||||||
|
TargetGoalPopup
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PopupScalerType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Zoom,
|
||||||
|
Fade
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PopupBase : UIBase, IUIBase
|
||||||
|
{
|
||||||
|
[Header("Popup Scaling")]
|
||||||
|
[SerializeField] protected Transform popupScaleContent;
|
||||||
|
// [SerializeField] protected bool shouldScale = true;
|
||||||
|
[SerializeField] protected float zoomDuration = 0.5f;
|
||||||
|
[SerializeField] protected PopupType popupType;
|
||||||
|
[SerializeField] protected PopupScalerType popupScalerType = PopupScalerType.Zoom;
|
||||||
|
[SerializeField] protected CanvasGroup canvasGroup;
|
||||||
|
[SerializeField] protected float fadeDuration;
|
||||||
|
|
||||||
|
private Action<PopupResultEvent> onComplete;
|
||||||
|
public PopupType PopupType => popupType;
|
||||||
|
|
||||||
|
protected PopupManager popupManager;
|
||||||
|
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
ApplyEffectOnShow();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
ApplyEffectOnHide();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
popupManager = popupManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<PopupManager>() : popupManager;
|
||||||
|
popupManager.RegisterPopup(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitNextActionEvent(Action<PopupResultEvent> onComplete)
|
||||||
|
{
|
||||||
|
this.onComplete = onComplete;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnComplete(PopupResultEvent popupResultEvent)
|
||||||
|
{
|
||||||
|
onComplete?.Invoke(popupResultEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyEffectOnShow()
|
||||||
|
{
|
||||||
|
switch (popupScalerType)
|
||||||
|
{
|
||||||
|
case PopupScalerType.None:
|
||||||
|
base.Show();
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Zoom:
|
||||||
|
popupScaleContent.localScale = UnityEngine.Vector3.zero;
|
||||||
|
base.Show();
|
||||||
|
popupScaleContent.DOScale(UnityEngine.Vector3.one, zoomDuration);
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Fade:
|
||||||
|
canvasGroup.alpha = 0;
|
||||||
|
base.Show();
|
||||||
|
canvasGroup.DOFade(1, fadeDuration);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyEffectOnHide()
|
||||||
|
{
|
||||||
|
switch (popupScalerType)
|
||||||
|
{
|
||||||
|
case PopupScalerType.None:
|
||||||
|
base.Hide();
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Zoom:
|
||||||
|
popupScaleContent.DOScale(UnityEngine.Vector3.zero, zoomDuration).OnComplete(() => base.Hide());
|
||||||
|
break;
|
||||||
|
case PopupScalerType.Fade:
|
||||||
|
canvasGroup.DOFade(0, fadeDuration).OnComplete(() => base.Hide());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
onComplete = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Pages/Bases/PopupBase.cs.meta
Normal file
11
Assets/Scripts/UI/Pages/Bases/PopupBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6d62013169cef439da57ebe92bbf5111
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
42
Assets/Scripts/UI/Pages/Bases/ScreenBase.cs
Normal file
42
Assets/Scripts/UI/Pages/Bases/ScreenBase.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum ScreenType
|
||||||
|
{
|
||||||
|
LoadingScreen,
|
||||||
|
LevelsScreen,
|
||||||
|
InGameHUDScreen,
|
||||||
|
MenuHUDScreen,
|
||||||
|
GlobalHUDScreen
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScreenBase : UIBase, IUIBase
|
||||||
|
{
|
||||||
|
[SerializeField] protected ScreenType screenType;
|
||||||
|
[SerializeField] protected bool shouldFade = false;
|
||||||
|
|
||||||
|
|
||||||
|
public ScreenType ScreenType => screenType;
|
||||||
|
|
||||||
|
private ScreenManager screenManager;
|
||||||
|
|
||||||
|
public void Initialize()
|
||||||
|
{
|
||||||
|
screenManager = screenManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>() : screenManager;
|
||||||
|
screenManager.RegisterScreen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
base.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Pages/Bases/ScreenBase.cs.meta
Normal file
11
Assets/Scripts/UI/Pages/Bases/ScreenBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 366dc2731a5bf4bf2be21093b70a6189
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
16
Assets/Scripts/UI/Pages/Bases/UIBase.cs
Normal file
16
Assets/Scripts/UI/Pages/Bases/UIBase.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class UIBase : MonoBehaviour
|
||||||
|
{
|
||||||
|
public virtual void Show()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Hide()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Pages/Bases/UIBase.cs.meta
Normal file
11
Assets/Scripts/UI/Pages/Bases/UIBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4c845cfc80e91458d8526c7f112a10b7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
45
Packages/manifest.json
Normal file
45
Packages/manifest.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.collab-proxy": "2.5.2",
|
||||||
|
"com.unity.feature.development": "1.0.1",
|
||||||
|
"com.unity.ide.rider": "3.0.31",
|
||||||
|
"com.unity.ide.visualstudio": "2.0.22",
|
||||||
|
"com.unity.ide.vscode": "1.2.5",
|
||||||
|
"com.unity.test-framework": "1.1.33",
|
||||||
|
"com.unity.textmeshpro": "3.0.6",
|
||||||
|
"com.unity.timeline": "1.6.5",
|
||||||
|
"com.unity.ugui": "1.0.0",
|
||||||
|
"com.unity.visualscripting": "1.9.4",
|
||||||
|
"com.unity.modules.ai": "1.0.0",
|
||||||
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.cloth": "1.0.0",
|
||||||
|
"com.unity.modules.director": "1.0.0",
|
||||||
|
"com.unity.modules.imageconversion": "1.0.0",
|
||||||
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.particlesystem": "1.0.0",
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.physics2d": "1.0.0",
|
||||||
|
"com.unity.modules.screencapture": "1.0.0",
|
||||||
|
"com.unity.modules.terrain": "1.0.0",
|
||||||
|
"com.unity.modules.terrainphysics": "1.0.0",
|
||||||
|
"com.unity.modules.tilemap": "1.0.0",
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.uielements": "1.0.0",
|
||||||
|
"com.unity.modules.umbra": "1.0.0",
|
||||||
|
"com.unity.modules.unityanalytics": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequesttexture": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestwww": "1.0.0",
|
||||||
|
"com.unity.modules.vehicles": "1.0.0",
|
||||||
|
"com.unity.modules.video": "1.0.0",
|
||||||
|
"com.unity.modules.vr": "1.0.0",
|
||||||
|
"com.unity.modules.wind": "1.0.0",
|
||||||
|
"com.unity.modules.xr": "1.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
393
Packages/packages-lock.json
Normal file
393
Packages/packages-lock.json
Normal file
@ -0,0 +1,393 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.collab-proxy": {
|
||||||
|
"version": "2.5.2",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.editorcoroutines": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.ext.nunit": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.feature.development": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ide.visualstudio": "2.0.22",
|
||||||
|
"com.unity.ide.rider": "3.0.31",
|
||||||
|
"com.unity.ide.vscode": "1.2.5",
|
||||||
|
"com.unity.editorcoroutines": "1.0.0",
|
||||||
|
"com.unity.performance.profile-analyzer": "1.2.2",
|
||||||
|
"com.unity.test-framework": "1.1.33",
|
||||||
|
"com.unity.testtools.codecoverage": "1.2.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.ide.rider": {
|
||||||
|
"version": "3.0.31",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ext.nunit": "1.0.6"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.ide.visualstudio": {
|
||||||
|
"version": "2.0.22",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.test-framework": "1.1.9"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.ide.vscode": {
|
||||||
|
"version": "1.2.5",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.performance.profile-analyzer": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.settings-manager": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"depth": 2,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.test-framework": {
|
||||||
|
"version": "1.1.33",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ext.nunit": "1.0.6",
|
||||||
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.testtools.codecoverage": {
|
||||||
|
"version": "1.2.6",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.test-framework": "1.0.16",
|
||||||
|
"com.unity.settings-manager": "1.0.1"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.textmeshpro": {
|
||||||
|
"version": "3.0.6",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ugui": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.timeline": {
|
||||||
|
"version": "1.6.5",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.director": "1.0.0",
|
||||||
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
"com.unity.modules.particlesystem": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.ugui": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.imgui": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.visualscripting": {
|
||||||
|
"version": "1.9.4",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ugui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.modules.ai": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.androidjni": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.animation": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.assetbundle": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.audio": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.cloth": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.director": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.animation": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.imageconversion": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.imgui": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.jsonserialize": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.particlesystem": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.physics": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.physics2d": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.screencapture": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.imageconversion": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.subsystems": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.terrain": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.terrainphysics": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.terrain": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.tilemap": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics2d": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.ui": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.uielements": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.uielementsnative": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.uielementsnative": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.umbra": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unityanalytics": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unitywebrequest": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unitywebrequestassetbundle": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unitywebrequestaudio": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.audio": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unitywebrequesttexture": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.imageconversion": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.unitywebrequestwww": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.imageconversion": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.vehicles": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.video": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.vr": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.xr": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.unity.modules.wind": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.modules.xr": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.subsystems": "1.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
ProjectSettings/AudioManager.asset
Normal file
19
ProjectSettings/AudioManager.asset
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!11 &1
|
||||||
|
AudioManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Volume: 1
|
||||||
|
Rolloff Scale: 1
|
||||||
|
Doppler Factor: 1
|
||||||
|
Default Speaker Mode: 2
|
||||||
|
m_SampleRate: 0
|
||||||
|
m_DSPBufferSize: 1024
|
||||||
|
m_VirtualVoiceCount: 512
|
||||||
|
m_RealVoiceCount: 32
|
||||||
|
m_SpatializerPlugin:
|
||||||
|
m_AmbisonicDecoderPlugin:
|
||||||
|
m_DisableAudio: 0
|
||||||
|
m_VirtualizeEffects: 1
|
||||||
|
m_RequestedDSPBufferSize: 1024
|
||||||
6
ProjectSettings/ClusterInputManager.asset
Normal file
6
ProjectSettings/ClusterInputManager.asset
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!236 &1
|
||||||
|
ClusterInputManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Inputs: []
|
||||||
34
ProjectSettings/DynamicsManager.asset
Normal file
34
ProjectSettings/DynamicsManager.asset
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!55 &1
|
||||||
|
PhysicsManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 11
|
||||||
|
m_Gravity: {x: 0, y: -9.81, z: 0}
|
||||||
|
m_DefaultMaterial: {fileID: 0}
|
||||||
|
m_BounceThreshold: 2
|
||||||
|
m_SleepThreshold: 0.005
|
||||||
|
m_DefaultContactOffset: 0.01
|
||||||
|
m_DefaultSolverIterations: 6
|
||||||
|
m_DefaultSolverVelocityIterations: 1
|
||||||
|
m_QueriesHitBackfaces: 0
|
||||||
|
m_QueriesHitTriggers: 1
|
||||||
|
m_EnableAdaptiveForce: 0
|
||||||
|
m_ClothInterCollisionDistance: 0
|
||||||
|
m_ClothInterCollisionStiffness: 0
|
||||||
|
m_ContactsGeneration: 1
|
||||||
|
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||||
|
m_AutoSimulation: 1
|
||||||
|
m_AutoSyncTransforms: 0
|
||||||
|
m_ReuseCollisionCallbacks: 1
|
||||||
|
m_ClothInterCollisionSettingsToggle: 0
|
||||||
|
m_ContactPairsMode: 0
|
||||||
|
m_BroadphaseType: 0
|
||||||
|
m_WorldBounds:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 250, y: 250, z: 250}
|
||||||
|
m_WorldSubdivisions: 8
|
||||||
|
m_FrictionType: 0
|
||||||
|
m_EnableEnhancedDeterminism: 0
|
||||||
|
m_EnableUnifiedHeightmaps: 1
|
||||||
|
m_DefaultMaxAngluarSpeed: 7
|
||||||
8
ProjectSettings/EditorBuildSettings.asset
Normal file
8
ProjectSettings/EditorBuildSettings.asset
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1045 &1
|
||||||
|
EditorBuildSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Scenes: []
|
||||||
|
m_configObjects: {}
|
||||||
30
ProjectSettings/EditorSettings.asset
Normal file
30
ProjectSettings/EditorSettings.asset
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!159 &1
|
||||||
|
EditorSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 11
|
||||||
|
m_ExternalVersionControlSupport: Visible Meta Files
|
||||||
|
m_SerializationMode: 2
|
||||||
|
m_LineEndingsForNewScripts: 0
|
||||||
|
m_DefaultBehaviorMode: 0
|
||||||
|
m_PrefabRegularEnvironment: {fileID: 0}
|
||||||
|
m_PrefabUIEnvironment: {fileID: 0}
|
||||||
|
m_SpritePackerMode: 0
|
||||||
|
m_SpritePackerPaddingPower: 1
|
||||||
|
m_EtcTextureCompressorBehavior: 1
|
||||||
|
m_EtcTextureFastCompressor: 1
|
||||||
|
m_EtcTextureNormalCompressor: 2
|
||||||
|
m_EtcTextureBestCompressor: 4
|
||||||
|
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
|
||||||
|
m_ProjectGenerationRootNamespace:
|
||||||
|
m_CollabEditorSettings:
|
||||||
|
inProgressEnabled: 1
|
||||||
|
m_EnableTextureStreamingInEditMode: 1
|
||||||
|
m_EnableTextureStreamingInPlayMode: 1
|
||||||
|
m_AsyncShaderCompilation: 1
|
||||||
|
m_EnterPlayModeOptionsEnabled: 0
|
||||||
|
m_EnterPlayModeOptions: 3
|
||||||
|
m_ShowLightmapResolutionOverlay: 1
|
||||||
|
m_UseLegacyProbeSampleCount: 0
|
||||||
|
m_SerializeInlineMappingsOnOneLine: 1
|
||||||
63
ProjectSettings/GraphicsSettings.asset
Normal file
63
ProjectSettings/GraphicsSettings.asset
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!30 &1
|
||||||
|
GraphicsSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 13
|
||||||
|
m_Deferred:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_DeferredReflections:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ScreenSpaceShadows:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LegacyDeferred:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_DepthNormals:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_MotionVectors:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LightHalo:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LensFlare:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_AlwaysIncludedShaders:
|
||||||
|
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_PreloadedShaders: []
|
||||||
|
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||||
|
type: 0}
|
||||||
|
m_CustomRenderPipeline: {fileID: 0}
|
||||||
|
m_TransparencySortMode: 0
|
||||||
|
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
|
||||||
|
m_DefaultRenderingPath: 1
|
||||||
|
m_DefaultMobileRenderingPath: 1
|
||||||
|
m_TierSettings: []
|
||||||
|
m_LightmapStripping: 0
|
||||||
|
m_FogStripping: 0
|
||||||
|
m_InstancingStripping: 0
|
||||||
|
m_LightmapKeepPlain: 1
|
||||||
|
m_LightmapKeepDirCombined: 1
|
||||||
|
m_LightmapKeepDynamicPlain: 1
|
||||||
|
m_LightmapKeepDynamicDirCombined: 1
|
||||||
|
m_LightmapKeepShadowMask: 1
|
||||||
|
m_LightmapKeepSubtractive: 1
|
||||||
|
m_FogKeepLinear: 1
|
||||||
|
m_FogKeepExp: 1
|
||||||
|
m_FogKeepExp2: 1
|
||||||
|
m_AlbedoSwatchInfos: []
|
||||||
|
m_LightsUseLinearIntensity: 0
|
||||||
|
m_LightsUseColorTemperature: 0
|
||||||
|
m_LogWhenShaderIsCompiled: 0
|
||||||
|
m_AllowEnlightenSupportForUpgradedProject: 0
|
||||||
295
ProjectSettings/InputManager.asset
Normal file
295
ProjectSettings/InputManager.asset
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!13 &1
|
||||||
|
InputManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Axes:
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Horizontal
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton: left
|
||||||
|
positiveButton: right
|
||||||
|
altNegativeButton: a
|
||||||
|
altPositiveButton: d
|
||||||
|
gravity: 3
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 3
|
||||||
|
snap: 1
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Vertical
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton: down
|
||||||
|
positiveButton: up
|
||||||
|
altNegativeButton: s
|
||||||
|
altPositiveButton: w
|
||||||
|
gravity: 3
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 3
|
||||||
|
snap: 1
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire1
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left ctrl
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 0
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire2
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left alt
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 1
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire3
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left shift
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 2
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Jump
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: space
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse X
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse Y
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 1
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse ScrollWheel
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 2
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Horizontal
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0.19
|
||||||
|
sensitivity: 1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 2
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Vertical
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0.19
|
||||||
|
sensitivity: 1
|
||||||
|
snap: 0
|
||||||
|
invert: 1
|
||||||
|
type: 2
|
||||||
|
axis: 1
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire1
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 0
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire2
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 1
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire3
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 2
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Jump
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 3
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Submit
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: return
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: joystick button 0
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Submit
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: enter
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: space
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Cancel
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: escape
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: joystick button 1
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
35
ProjectSettings/MemorySettings.asset
Normal file
35
ProjectSettings/MemorySettings.asset
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!387306366 &1
|
||||||
|
MemorySettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_EditorMemorySettings:
|
||||||
|
m_MainAllocatorBlockSize: -1
|
||||||
|
m_ThreadAllocatorBlockSize: -1
|
||||||
|
m_MainGfxBlockSize: -1
|
||||||
|
m_ThreadGfxBlockSize: -1
|
||||||
|
m_CacheBlockSize: -1
|
||||||
|
m_TypetreeBlockSize: -1
|
||||||
|
m_ProfilerBlockSize: -1
|
||||||
|
m_ProfilerEditorBlockSize: -1
|
||||||
|
m_BucketAllocatorGranularity: -1
|
||||||
|
m_BucketAllocatorBucketsCount: -1
|
||||||
|
m_BucketAllocatorBlockSize: -1
|
||||||
|
m_BucketAllocatorBlockCount: -1
|
||||||
|
m_ProfilerBucketAllocatorGranularity: -1
|
||||||
|
m_ProfilerBucketAllocatorBucketsCount: -1
|
||||||
|
m_ProfilerBucketAllocatorBlockSize: -1
|
||||||
|
m_ProfilerBucketAllocatorBlockCount: -1
|
||||||
|
m_TempAllocatorSizeMain: -1
|
||||||
|
m_JobTempAllocatorBlockSize: -1
|
||||||
|
m_BackgroundJobTempAllocatorBlockSize: -1
|
||||||
|
m_JobTempAllocatorReducedBlockSize: -1
|
||||||
|
m_TempAllocatorSizeGIBakingWorker: -1
|
||||||
|
m_TempAllocatorSizeNavMeshWorker: -1
|
||||||
|
m_TempAllocatorSizeAudioWorker: -1
|
||||||
|
m_TempAllocatorSizeCloudWorker: -1
|
||||||
|
m_TempAllocatorSizeGfx: -1
|
||||||
|
m_TempAllocatorSizeJobWorker: -1
|
||||||
|
m_TempAllocatorSizeBackgroundWorker: -1
|
||||||
|
m_TempAllocatorSizePreloadManager: -1
|
||||||
|
m_PlatformMemorySettings: {}
|
||||||
91
ProjectSettings/NavMeshAreas.asset
Normal file
91
ProjectSettings/NavMeshAreas.asset
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!126 &1
|
||||||
|
NavMeshProjectSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
areas:
|
||||||
|
- name: Walkable
|
||||||
|
cost: 1
|
||||||
|
- name: Not Walkable
|
||||||
|
cost: 1
|
||||||
|
- name: Jump
|
||||||
|
cost: 2
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
m_LastAgentTypeID: -887442657
|
||||||
|
m_Settings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
agentTypeID: 0
|
||||||
|
agentRadius: 0.5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: 0.75
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
manualCellSize: 0
|
||||||
|
cellSize: 0.16666667
|
||||||
|
manualTileSize: 0
|
||||||
|
tileSize: 256
|
||||||
|
accuratePlacement: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
|
m_SettingNames:
|
||||||
|
- Humanoid
|
||||||
35
ProjectSettings/PackageManagerSettings.asset
Normal file
35
ProjectSettings/PackageManagerSettings.asset
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &1
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 61
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_EnablePreReleasePackages: 0
|
||||||
|
m_EnablePackageDependencies: 0
|
||||||
|
m_AdvancedSettingsExpanded: 1
|
||||||
|
m_ScopedRegistriesSettingsExpanded: 1
|
||||||
|
m_SeeAllPackageVersions: 0
|
||||||
|
oneTimeWarningShown: 0
|
||||||
|
m_Registries:
|
||||||
|
- m_Id: main
|
||||||
|
m_Name:
|
||||||
|
m_Url: https://packages.unity.com
|
||||||
|
m_Scopes: []
|
||||||
|
m_IsDefault: 1
|
||||||
|
m_Capabilities: 7
|
||||||
|
m_UserSelectedRegistryName:
|
||||||
|
m_UserAddingNewScopedRegistry: 0
|
||||||
|
m_RegistryInfoDraft:
|
||||||
|
m_Modified: 0
|
||||||
|
m_ErrorMessage:
|
||||||
|
m_UserModificationsInstanceId: -830
|
||||||
|
m_OriginalInstanceId: -832
|
||||||
|
m_LoadAssets: 0
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"m_Name": "Settings",
|
||||||
|
"m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json",
|
||||||
|
"m_Dictionary": {
|
||||||
|
"m_DictionaryValues": []
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user