Compare commits
12 Commits
b39116e734
...
GameManage
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ad1a118d8 | ||
|
|
8f68e49e19 | ||
|
|
b8a119be87 | ||
|
|
ee05d6eda9 | ||
|
|
e8ce7eb653 | ||
|
|
a5313a94e0 | ||
|
|
7e62630cb0 | ||
|
|
c5421de715 | ||
|
|
f1213cd247 | ||
|
|
d4cb3c5f39 | ||
|
|
ec7dd33126 | ||
|
|
66d48537f7 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -75,3 +75,6 @@ crashlytics-build.properties
|
|||||||
/[Aa]ssets/[Ss]treamingAssets/aa/*
|
/[Aa]ssets/[Ss]treamingAssets/aa/*
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/unity
|
# End of https://www.toptal.com/developers/gitignore/api/unity
|
||||||
|
/Assets/Sprites/ShouldNotBeUsed
|
||||||
|
/Assets/TextMesh Pro
|
||||||
|
/Assets/Fonts
|
||||||
|
|||||||
8
Assets/Fonts.meta
Normal file
8
Assets/Fonts.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c5132d7f8a18fd418c8980c1dfa6aed
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins.meta
Normal file
8
Assets/Plugins.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb933ea5343323245996b9045f3e288a
|
||||||
|
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: 2bdbc082abaa9574b966e21c22f42551
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
21
Assets/Plugins/Demigiant/DOTween.meta
Normal file
21
Assets/Plugins/Demigiant/DOTween.meta
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a50bd9a009c8dfc4ebd88cc8101225a7
|
||||||
|
labels:
|
||||||
|
- Tween
|
||||||
|
- Tweening
|
||||||
|
- Animation
|
||||||
|
- HOTween
|
||||||
|
- Paths
|
||||||
|
- iTween
|
||||||
|
- DFTween
|
||||||
|
- LeanTween
|
||||||
|
- Ease
|
||||||
|
- Easing
|
||||||
|
- Shake
|
||||||
|
- Punch
|
||||||
|
- 2DToolkit
|
||||||
|
- TextMeshPro
|
||||||
|
- Text
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
3107
Assets/Plugins/Demigiant/DOTween/DOTween.XML
Normal file
3107
Assets/Plugins/Demigiant/DOTween/DOTween.XML
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/Plugins/Demigiant/DOTween/DOTween.XML.meta
Normal file
11
Assets/Plugins/Demigiant/DOTween/DOTween.XML.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 34192c5e0d14aee43a0e86cc4823268a
|
||||||
|
TextScriptImporter:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/DOTween.XML
|
||||||
|
uploadId: 862444
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/DOTween.dll
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/DOTween.dll
Normal file
Binary file not shown.
29
Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta
Normal file
29
Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
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:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/DOTween.dll
|
||||||
|
uploadId: 862444
|
||||||
5
Assets/Plugins/Demigiant/DOTween/Editor.meta
Normal file
5
Assets/Plugins/Demigiant/DOTween/Editor.meta
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b27f58ae5d5c33a4bb2d1f4f34bd036d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
165
Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML
Normal file
165
Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>DOTweenEditor</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="T:DG.DOTweenEditor.EditorCompatibilityUtils">
|
||||||
|
<summary>
|
||||||
|
Contains compatibility methods taken from DemiEditor (for when DOTween is without it)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectOfType``1(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectOfType(System.Type,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectsOfType``1(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectsOfType(System.Type,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.Start(System.Action)">
|
||||||
|
<summary>
|
||||||
|
Starts the update loop of tween in the editor. Has no effect during playMode.
|
||||||
|
</summary>
|
||||||
|
<param name="onPreviewUpdated">Eventual callback to call after every update</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.Stop(System.Boolean,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Stops the update loop and clears the onPreviewUpdated callback.
|
||||||
|
</summary>
|
||||||
|
<param name="resetTweenTargets">If TRUE also resets the tweened objects to their original state.
|
||||||
|
Note that this works by calling Rewind on all tweens, so it will work correctly
|
||||||
|
only if you have a single tween type per object and it wasn't killed</param>
|
||||||
|
<param name="clearTweens">If TRUE also kills any cached tween</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.PrepareTweenForPreview(DG.Tweening.Tween,System.Boolean,System.Boolean,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings.
|
||||||
|
</summary>
|
||||||
|
<param name="t">The tween to ready</param>
|
||||||
|
<param name="clearCallbacks">If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc)</param>
|
||||||
|
<param name="preventAutoKill">If TRUE prevents the tween from being auto-killed at completion</param>
|
||||||
|
<param name="andPlay">If TRUE starts playing the tween immediately</param>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.EditorVersion.Version">
|
||||||
|
<summary>Full major version + first minor version (ex: 2018.1f)</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.EditorVersion.MajorVersion">
|
||||||
|
<summary>Major version</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.EditorVersion.MinorVersion">
|
||||||
|
<summary>First minor version (ex: in 2018.1 it would be 1)</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
Checks that the given editor texture use the correct import settings,
|
||||||
|
and applies them if they're incorrect.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.DOTweenSetupRequired">
|
||||||
|
<summary>
|
||||||
|
Returns TRUE if setup is required
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.AssetExists(System.String)">
|
||||||
|
<summary>
|
||||||
|
Returns TRUE if the file/directory at the given path exists.
|
||||||
|
</summary>
|
||||||
|
<param name="adbPath">Path, relative to Unity's project folder</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.ADBPathToFullPath(System.String)">
|
||||||
|
<summary>
|
||||||
|
Converts the given project-relative path to a full path,
|
||||||
|
with backward (\) slashes).
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.FullPathToADBPath(System.String)">
|
||||||
|
<summary>
|
||||||
|
Converts the given full path to a path usable with AssetDatabase methods
|
||||||
|
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
|
||||||
|
If the asset already exists at the given path, loads it and returns it.
|
||||||
|
Otherwise, either returns NULL or automatically creates it before loading and returning it
|
||||||
|
(depending on the given parameters).
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T">Asset type</typeparam>
|
||||||
|
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
|
||||||
|
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
|
||||||
|
<summary>
|
||||||
|
Full path for the given loaded assembly, assembly file included
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.AddGlobalDefine(System.String)">
|
||||||
|
<summary>
|
||||||
|
Adds the given global define if it's not already present
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.RemoveGlobalDefine(System.String)">
|
||||||
|
<summary>
|
||||||
|
Removes the given global define if it's present
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.EditorUtils.HasGlobalDefine(System.String,System.Nullable{UnityEditor.BuildTargetGroup})">
|
||||||
|
<summary>
|
||||||
|
Returns TRUE if the given global define is present in all the <see cref="T:UnityEditor.BuildTargetGroup"/>
|
||||||
|
or only in the given <see cref="T:UnityEditor.BuildTargetGroup"/>, depending on passed parameters.<para/>
|
||||||
|
</summary>
|
||||||
|
<param name="id"></param>
|
||||||
|
<param name="buildTargetGroup"><see cref="T:UnityEditor.BuildTargetGroup"/>to use. Leave NULL to check in all of them.</param>
|
||||||
|
</member>
|
||||||
|
<member name="T:DG.DOTweenEditor.DOTweenDefines">
|
||||||
|
<summary>
|
||||||
|
Not used as menu item anymore, but as a utility function
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.RefreshDOTweenSettings(DG.Tweening.Core.DOTweenSettings)">
|
||||||
|
<summary>Sets the modules bool values to the current defines state</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.RefreshAll">
|
||||||
|
<summary>Refreshes the enabled state of all defines</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.ApplyGUIEnabledToAll">
|
||||||
|
<summary>Applies the guiEnabled value state to each define, adding or removing them based on that</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.RemoveAll">
|
||||||
|
<summary>Removes all DOTween defines including the ones for external assets</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.RemoveAllLegacy">
|
||||||
|
<summary>Removes all legacy defines</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.Def.Remove">
|
||||||
|
<summary>Removes the define if present</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.DOTweenEditor.DOTweenDefines.Def.Add">
|
||||||
|
<summary>Adds the define if it's not already present</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.UnityEditorVersion.Version">
|
||||||
|
<summary>Full major version + first minor version (ex: 2018.1f)</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.UnityEditorVersion.MajorVersion">
|
||||||
|
<summary>Major version</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.DOTweenEditor.UnityEditorVersion.MinorVersion">
|
||||||
|
<summary>First minor version (ex: in 2018.1 it would be 1)</summary>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2e2c6224d345d9249acfa6e8ef40bb2d
|
||||||
|
TextScriptImporter:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML
|
||||||
|
uploadId: 862444
|
||||||
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,29 @@
|
|||||||
|
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:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll
|
||||||
|
uploadId: 862444
|
||||||
5
Assets/Plugins/Demigiant/DOTween/Editor/Imgs.meta
Normal file
5
Assets/Plugins/Demigiant/DOTween/Editor/Imgs.meta
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0034ebae0c2a9344e897db1160d71b6d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,54 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8da095e39e9b4df488dfd436f81116d6
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -3
|
||||||
|
maxTextureSize: 128
|
||||||
|
textureSettings:
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
|
||||||
|
uploadId: 862444
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenMiniIcon.png
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenMiniIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 319 B |
@@ -0,0 +1,75 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 61521df2e071645488ba3d05e49289ae
|
||||||
|
timeCreated: 1602317874
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 0
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenMiniIcon.png
|
||||||
|
uploadId: 862444
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
54
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png.meta
Normal file
54
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png.meta
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7051dba417b3d53409f2918f1ea4938d
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -3
|
||||||
|
maxTextureSize: 256
|
||||||
|
textureSettings:
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png
|
||||||
|
uploadId: 862444
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,54 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 519694efe2bb2914788b151fbd8c01f4
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
|
||||||
|
uploadId: 862444
|
||||||
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg
Normal file
BIN
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
54
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta
Normal file
54
Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 78a59ca99f8987941adb61f9e14a06a7
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -3
|
||||||
|
maxTextureSize: 512
|
||||||
|
textureSettings:
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg
|
||||||
|
uploadId: 862444
|
||||||
5
Assets/Plugins/Demigiant/DOTween/Modules.meta
Normal file
5
Assets/Plugins/Demigiant/DOTween/Modules.meta
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 143604b8bad857d47a6f7cc7a533e2dc
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
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 !DOTWEEN_NOAUDIO // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b766d08851589514b97afb23c6f30a70
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs
|
||||||
|
uploadId: 862444
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if DOTWEEN_EPO || 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,19 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e944529dcaee98f4e9498d80e541d93e
|
||||||
|
timeCreated: 1602593330
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleEPOOutline.cs
|
||||||
|
uploadId: 862444
|
||||||
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 !DOTWEEN_NOPHYSICS // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dae9aa560b4242648a3affa2bfabc365
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs
|
||||||
|
uploadId: 862444
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if !DOTWEEN_NOPHYSICS2D // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 230fe34542e175245ba74b4659dae700
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs
|
||||||
|
uploadId: 862444
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
#if !DOTWEEN_NOSPRITES // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 188918ab119d93148aa0de59ccf5286b
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs
|
||||||
|
uploadId: 862444
|
||||||
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 !DOTWEEN_NOUI // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a060394c03331a64392db53a10e7f2d1
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs
|
||||||
|
uploadId: 862444
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2026/01/08
|
||||||
|
|
||||||
|
#if DOTWEEN_UITOOLKIT && UNITY_2021_3_OR_NEWER // MODULE_MARKER
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Core.Enums;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
public static class DOTweenModuleUIToolkit
|
||||||
|
{
|
||||||
|
#region Shortcuts
|
||||||
|
|
||||||
|
#region VisualElement
|
||||||
|
|
||||||
|
/// <summary>Tweens a VisualElement's position (via style.translate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, Vector3 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t
|
||||||
|
= DOTween.To(() => target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a VisualElement's position (via style.translate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, Vector2 endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t
|
||||||
|
= DOTween.To(() => (Vector2)target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, 0), endValue, duration);
|
||||||
|
t.SetOptions(snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a VisualElement's X position (via style.translate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t
|
||||||
|
= DOTween.To(() => target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), new Vector3(endValue, 0, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a VisualElement's Y position (via style.translate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t
|
||||||
|
= DOTween.To(() => target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), new Vector3(0, endValue, 0), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a VisualElement's Z position (via style.translate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, float endValue, float duration, bool snapping = false)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector3, Vector3, VectorOptions> t
|
||||||
|
= DOTween.To(() => target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), new Vector3(0, 0, endValue), duration);
|
||||||
|
t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a VisualElement's scale (via style.scale) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, Vector2 endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t
|
||||||
|
= DOTween.To(() => (Vector2)target.resolvedStyle.scale.value, x => target.style.scale = new Scale(x), endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Tweens a VisualElement's scale (via style.scale) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> t
|
||||||
|
= DOTween.To(() => (Vector2)target.resolvedStyle.scale.value, x => target.style.scale = new Scale(x), new Vector2(endValue, endValue), duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Tweens a VisualElement's rotation (via style.rotate) to the given value.
|
||||||
|
/// Also stores the VisualElement 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 VisualElement target, float endValue, float duration)
|
||||||
|
{
|
||||||
|
TweenerCore<float, float, FloatOptions> t
|
||||||
|
= DOTween.To(() => target.resolvedStyle.rotate.angle.value, x => target.style.rotate = new Rotate(x), endValue, duration);
|
||||||
|
t.SetTarget(target);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Punches a VisualElement's position 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 VisualElement 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 VisualElement'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 DOPunch(this VisualElement target, Vector3 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
|
||||||
|
{
|
||||||
|
return DOTween.Punch(() => target.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), punch, duration, vibrato, elasticity)
|
||||||
|
.SetTarget(target).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Shakes a VisualElement's position with the given values.
|
||||||
|
/// Also stores the VisualElement 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 DOShake(this VisualElement 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.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), duration, strength, vibrato, randomness, true, fadeOut, randomnessMode)
|
||||||
|
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
/// <summary>Shakes a VisualElement's position with the given values.
|
||||||
|
/// Also stores the VisualElement 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 DOShake(this VisualElement 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.resolvedStyle.translate, x => target.style.translate = new Translate(x.x, x.y, x.z), duration, strength, vibrato, randomness, fadeOut, randomnessMode)
|
||||||
|
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0c0a6d2683fb84e4193f2aa968264881
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUIToolkit.cs
|
||||||
|
uploadId: 862444
|
||||||
@@ -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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 63c02322328255542995bd02b47b0457
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs
|
||||||
|
uploadId: 862444
|
||||||
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 and rewrite them.
|
||||||
|
/// 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 !DOTWEEN_NOPHYSICS // 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 !DOTWEEN_NOPHYSICS2D // 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 !DOTWEEN_NOPHYSICS // 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 !DOTWEEN_NOPHYSICS // 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 !DOTWEEN_NOPHYSICS2D // 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,15 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7bcaf917d9cf5b84090421a5a2abe42e
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs
|
||||||
|
uploadId: 862444
|
||||||
29
Assets/Plugins/Demigiant/DOTween/readme.txt
Normal file
29
Assets/Plugins/Demigiant/DOTween/readme.txt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant
|
||||||
|
|
||||||
|
// IMPORTANT!!! /////////////////////////////////////////////
|
||||||
|
// Upgrading DOTween from versions older than 1.2.000 ///////
|
||||||
|
// (or DOTween Pro older than 1.0.000) //////////////////////
|
||||||
|
-------------------------------------------------------------
|
||||||
|
If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully.
|
||||||
|
1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry
|
||||||
|
2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
|
||||||
|
3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup
|
||||||
|
4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only)
|
||||||
|
|
||||||
|
// GET STARTED //////////////////////////////////////////////
|
||||||
|
|
||||||
|
- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween.
|
||||||
|
- In your code, add "using DG.Tweening" to each class where you want to use DOTween.
|
||||||
|
- You're ready to tween. Check out the links below for full documentation and license info.
|
||||||
|
|
||||||
|
|
||||||
|
// LINKS ///////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
DOTween website (documentation, examples, etc): http://dotween.demigiant.com
|
||||||
|
DOTween license: http://dotween.demigiant.com/license.php
|
||||||
|
DOTween repository (Google Code): https://code.google.com/p/dotween/
|
||||||
|
Demigiant website (documentation, examples, etc): http://www.demigiant.com
|
||||||
|
|
||||||
|
// NOTES //////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
|
||||||
11
Assets/Plugins/Demigiant/DOTween/readme.txt.meta
Normal file
11
Assets/Plugins/Demigiant/DOTween/readme.txt.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fccfc62abf2eb0a4db614853430894fd
|
||||||
|
TextScriptImporter:
|
||||||
|
userData:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 27676
|
||||||
|
packageName: DOTween (HOTween v2)
|
||||||
|
packageVersion: 1.2.825
|
||||||
|
assetPath: Assets/Plugins/Demigiant/DOTween/readme.txt
|
||||||
|
uploadId: 862444
|
||||||
8
Assets/Prefabs.meta
Normal file
8
Assets/Prefabs.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fbaedddce6d8bd44c8f89760ac6613dd
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
231
Assets/Prefabs/HpBar.prefab
Normal file
231
Assets/Prefabs/HpBar.prefab
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &44656911223875029
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 7867222899541067846}
|
||||||
|
- component: {fileID: 154264704736570930}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: bg
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &7867222899541067846
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 44656911223875029}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 2, y: 0.5, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 2230193285998630056}
|
||||||
|
m_Father: {fileID: 6632233675126567313}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &154264704736570930
|
||||||
|
SpriteRenderer:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 44656911223875029}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!1 &8660741472197541266
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6632233675126567313}
|
||||||
|
- component: {fileID: 7735241326697819927}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: HpBar
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6632233675126567313
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8660741472197541266}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 1.5, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 7867222899541067846}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &7735241326697819927
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8660741472197541266}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 177f745ebb3c415e8e5c73b53c18636b, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.HpBar
|
||||||
|
fill: {fileID: 9076800517195302650}
|
||||||
|
--- !u!1 &9076800517195302650
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2230193285998630056}
|
||||||
|
- component: {fileID: 538058977992172040}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: fill
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2230193285998630056
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9076800517195302650}
|
||||||
|
serializedVersion: 2
|
||||||
|
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: 7867222899541067846}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &538058977992172040
|
||||||
|
SpriteRenderer:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9076800517195302650}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||||
|
m_Color: {r: 1, g: 0, b: 0, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
7
Assets/Prefabs/HpBar.prefab.meta
Normal file
7
Assets/Prefabs/HpBar.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 80d51bce958d6c94eb94d45ca7bf8c3f
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
177
Assets/Prefabs/Tuna.prefab
Normal file
177
Assets/Prefabs/Tuna.prefab
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &1257769410015698969
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 654332869059302118}
|
||||||
|
- component: {fileID: 2528286071456296154}
|
||||||
|
- component: {fileID: 8629637382498582022}
|
||||||
|
- component: {fileID: 6157362189544272001}
|
||||||
|
- component: {fileID: 3431339588436326551}
|
||||||
|
m_Layer: 8
|
||||||
|
m_Name: Tuna
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &654332869059302118
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1257769410015698969}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 3.28, y: 0.05, z: 0}
|
||||||
|
m_LocalScale: {x: 3, y: 3, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &2528286071456296154
|
||||||
|
SpriteRenderer:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1257769410015698969}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: -1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_Sprite: {fileID: 21300000, guid: f76d2b387b3898d42918856179f974ba, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 2.320879, y: 1.546875}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!50 &8629637382498582022
|
||||||
|
Rigidbody2D:
|
||||||
|
serializedVersion: 5
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1257769410015698969}
|
||||||
|
m_BodyType: 0
|
||||||
|
m_Simulated: 1
|
||||||
|
m_UseFullKinematicContacts: 0
|
||||||
|
m_UseAutoMass: 0
|
||||||
|
m_Mass: 1
|
||||||
|
m_LinearDamping: 0
|
||||||
|
m_AngularDamping: 0.05
|
||||||
|
m_GravityScale: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_SleepingMode: 1
|
||||||
|
m_CollisionDetection: 0
|
||||||
|
m_Constraints: 4
|
||||||
|
--- !u!70 &6157362189544272001
|
||||||
|
CapsuleCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1257769410015698969}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_ForceSendLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ForceReceiveLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ContactCaptureLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_CallbackLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_CompositeOperation: 0
|
||||||
|
m_CompositeOrder: 0
|
||||||
|
m_Offset: {x: -0.053471576, y: -0.043541275}
|
||||||
|
m_Size: {x: 1.5439217, y: 1.0006151}
|
||||||
|
m_Direction: 1
|
||||||
|
--- !u!114 &3431339588436326551
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1257769410015698969}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0f3078fdd3458bf459c4463291b07499, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.Boss.Tuna
|
||||||
|
maxHealth: 200
|
||||||
|
health: 200
|
||||||
|
hpBarPrefab: {fileID: 8660741472197541266, guid: 80d51bce958d6c94eb94d45ca7bf8c3f, type: 3}
|
||||||
|
projContainer: {fileID: 0}
|
||||||
|
phase1Proj: {fileID: 5921252368867129526, guid: 6db1d20b24524e6449e79fcc39f40401, type: 3}
|
||||||
7
Assets/Prefabs/Tuna.prefab.meta
Normal file
7
Assets/Prefabs/Tuna.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3122dc7e05ab48e42bf631163a23b37f
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
154
Assets/Prefabs/TunaP1Attacker.prefab
Normal file
154
Assets/Prefabs/TunaP1Attacker.prefab
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &5921252368867129526
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2061320151633347195}
|
||||||
|
- component: {fileID: 1797540837772257342}
|
||||||
|
- component: {fileID: 490763327940191773}
|
||||||
|
- component: {fileID: 1152076818425219994}
|
||||||
|
m_Layer: 9
|
||||||
|
m_Name: TunaP1Attacker
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2061320151633347195
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5921252368867129526}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -4.3426, y: 0.67107, z: 0}
|
||||||
|
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
|
||||||
|
m_ConstrainProportionsScale: 1
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &1797540837772257342
|
||||||
|
SpriteRenderer:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5921252368867129526}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_Sprite: {fileID: -2413806693520163455, guid: a86470a33a6bf42c4b3595704624658b, type: 3}
|
||||||
|
m_Color: {r: 1, g: 0, b: 0, a: 0.30980393}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!61 &490763327940191773
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5921252368867129526}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_ForceSendLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ForceReceiveLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ContactCaptureLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_CallbackLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_CompositeOperation: 0
|
||||||
|
m_CompositeOrder: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
oldSize: {x: 1, y: 1}
|
||||||
|
newSize: {x: 1, y: 1}
|
||||||
|
adaptiveTilingThreshold: 0.5
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &1152076818425219994
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5921252368867129526}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bdb9c585da578ee408fc4177ce2010e1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.Hitbox.UnicornHitbox
|
||||||
|
hitboxData: {fileID: 11400000, guid: b6eb28167ca507f4097a624f0cc29d54, type: 2}
|
||||||
7
Assets/Prefabs/TunaP1Attacker.prefab.meta
Normal file
7
Assets/Prefabs/TunaP1Attacker.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6db1d20b24524e6449e79fcc39f40401
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources.meta
Normal file
8
Assets/Resources.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9cfa0bd0b4ddd3c4cb6f84c07d06871a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
55
Assets/Resources/DOTweenSettings.asset
Normal file
55
Assets/Resources/DOTweenSettings.asset
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 16995157, guid: a811bde74b26b53498b4f6d872b09b6d, type: 3}
|
||||||
|
m_Name: DOTweenSettings
|
||||||
|
m_EditorClassIdentifier: DOTween.dll::DG.Tweening.Core.DOTweenSettings
|
||||||
|
useSafeMode: 1
|
||||||
|
safeModeOptions:
|
||||||
|
logBehaviour: 2
|
||||||
|
nestedTweenFailureBehaviour: 0
|
||||||
|
timeScale: 1
|
||||||
|
unscaledTimeScale: 1
|
||||||
|
useSmoothDeltaTime: 0
|
||||||
|
maxSmoothUnscaledTime: 0.15
|
||||||
|
rewindCallbackMode: 0
|
||||||
|
showUnityEditorReport: 0
|
||||||
|
logBehaviour: 0
|
||||||
|
drawGizmos: 1
|
||||||
|
defaultRecyclable: 0
|
||||||
|
defaultAutoPlay: 3
|
||||||
|
defaultUpdateType: 0
|
||||||
|
defaultTimeScaleIndependent: 0
|
||||||
|
defaultEaseType: 6
|
||||||
|
defaultEaseOvershootOrAmplitude: 1.70158
|
||||||
|
defaultEasePeriod: 0
|
||||||
|
defaultAutoKill: 1
|
||||||
|
defaultLoopType: 0
|
||||||
|
debugMode: 0
|
||||||
|
debugStoreTargetId: 1
|
||||||
|
showPreviewPanel: 1
|
||||||
|
storeSettingsLocation: 0
|
||||||
|
modules:
|
||||||
|
showPanel: 0
|
||||||
|
audioEnabled: 1
|
||||||
|
physicsEnabled: 1
|
||||||
|
physics2DEnabled: 1
|
||||||
|
spriteEnabled: 1
|
||||||
|
uiEnabled: 1
|
||||||
|
uiToolkitEnabled: 0
|
||||||
|
textMeshProEnabled: 0
|
||||||
|
tk2DEnabled: 0
|
||||||
|
deAudioEnabled: 0
|
||||||
|
deUnityExtendedEnabled: 0
|
||||||
|
epoOutlineEnabled: 0
|
||||||
|
createASMDEF: 0
|
||||||
|
showPlayingTweens: 0
|
||||||
|
showPausedTweens: 0
|
||||||
8
Assets/Resources/DOTweenSettings.asset.meta
Normal file
8
Assets/Resources/DOTweenSettings.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1bea73b6051da7d4384c014f0ac34f9d
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
2131
Assets/Scenes/MainScene.unity
Normal file
2131
Assets/Scenes/MainScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,714 +0,0 @@
|
|||||||
%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: 10
|
|
||||||
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: 3
|
|
||||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
|
||||||
m_SkyboxMaterial: {fileID: 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: 0}
|
|
||||||
m_UseRadianceAmbientProbe: 0
|
|
||||||
--- !u!157 &3
|
|
||||||
LightmapSettings:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 13
|
|
||||||
m_BakeOnSceneLoad: 0
|
|
||||||
m_GISettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_BounceScale: 1
|
|
||||||
m_IndirectOutputScale: 1
|
|
||||||
m_AlbedoBoost: 1
|
|
||||||
m_EnvironmentLightingMode: 0
|
|
||||||
m_EnableBakedLightmaps: 0
|
|
||||||
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_ReflectionCompression: 2
|
|
||||||
m_MixedBakeMode: 2
|
|
||||||
m_BakeBackend: 1
|
|
||||||
m_PVRSampling: 1
|
|
||||||
m_PVRDirectSampleCount: 32
|
|
||||||
m_PVRSampleCount: 512
|
|
||||||
m_PVRBounces: 2
|
|
||||||
m_PVREnvironmentSampleCount: 256
|
|
||||||
m_PVREnvironmentReferencePointCount: 2048
|
|
||||||
m_PVRFilteringMode: 1
|
|
||||||
m_PVRDenoiserTypeDirect: 1
|
|
||||||
m_PVRDenoiserTypeIndirect: 1
|
|
||||||
m_PVRDenoiserTypeAO: 1
|
|
||||||
m_PVRFilterTypeDirect: 0
|
|
||||||
m_PVRFilterTypeIndirect: 0
|
|
||||||
m_PVRFilterTypeAO: 0
|
|
||||||
m_PVREnvironmentMIS: 1
|
|
||||||
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: 3
|
|
||||||
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
|
|
||||||
buildHeightMesh: 0
|
|
||||||
maxJobWorkers: 0
|
|
||||||
preserveTilesOutsideBounds: 0
|
|
||||||
debug:
|
|
||||||
m_Flags: 0
|
|
||||||
m_NavMeshData: {fileID: 0}
|
|
||||||
--- !u!1 &68822291
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 68822293}
|
|
||||||
- component: {fileID: 68822292}
|
|
||||||
- component: {fileID: 68822294}
|
|
||||||
- component: {fileID: 68822295}
|
|
||||||
- component: {fileID: 68822296}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Player
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!212 &68822292
|
|
||||||
SpriteRenderer:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 68822291}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 0
|
|
||||||
m_ReceiveShadows: 0
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_StaticShadowCaster: 0
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 0
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
|
||||||
m_SmallMeshCulling: 1
|
|
||||||
m_ForceMeshLod: -1
|
|
||||||
m_MeshLodSelectionBias: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 0
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_GlobalIlluminationMeshLod: 0
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 1
|
|
||||||
m_MaskInteraction: 0
|
|
||||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
|
||||||
m_Color: {r: 1, g: 0.28773582, b: 0.28773582, a: 1}
|
|
||||||
m_FlipX: 0
|
|
||||||
m_FlipY: 0
|
|
||||||
m_DrawMode: 0
|
|
||||||
m_Size: {x: 1, y: 1}
|
|
||||||
m_AdaptiveModeThreshold: 0.5
|
|
||||||
m_SpriteTileMode: 0
|
|
||||||
m_WasSpriteAssigned: 1
|
|
||||||
m_SpriteSortPoint: 0
|
|
||||||
--- !u!4 &68822293
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 68822291}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -2.18, y: -0.93, z: 0}
|
|
||||||
m_LocalScale: {x: 0.25, y: 0.25, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!61 &68822294
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 68822291}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_ForceSendLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ForceReceiveLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ContactCaptureLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_CallbackLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_CompositeOperation: 0
|
|
||||||
m_CompositeOrder: 0
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0.5, y: 0.5}
|
|
||||||
oldSize: {x: 1, y: 1}
|
|
||||||
newSize: {x: 1, y: 1}
|
|
||||||
adaptiveTilingThreshold: 0.5
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
m_Size: {x: 1, y: 1}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!50 &68822295
|
|
||||||
Rigidbody2D:
|
|
||||||
serializedVersion: 5
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 68822291}
|
|
||||||
m_BodyType: 0
|
|
||||||
m_Simulated: 1
|
|
||||||
m_UseFullKinematicContacts: 0
|
|
||||||
m_UseAutoMass: 0
|
|
||||||
m_Mass: 1
|
|
||||||
m_LinearDamping: 0
|
|
||||||
m_AngularDamping: 0.05
|
|
||||||
m_GravityScale: 10
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_Interpolate: 0
|
|
||||||
m_SleepingMode: 1
|
|
||||||
m_CollisionDetection: 1
|
|
||||||
m_Constraints: 0
|
|
||||||
--- !u!114 &68822296
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 68822291}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: db8b3864bdcf65d40b42ee58c17e87aa, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerMovement
|
|
||||||
moveSpeed: 8
|
|
||||||
jumpForce: 20
|
|
||||||
--- !u!1 &519420028
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 519420032}
|
|
||||||
- component: {fileID: 519420031}
|
|
||||||
- component: {fileID: 519420029}
|
|
||||||
- component: {fileID: 519420030}
|
|
||||||
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 &519420029
|
|
||||||
AudioListener:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 519420028}
|
|
||||||
m_Enabled: 1
|
|
||||||
--- !u!114 &519420030
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 519420028}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_RenderShadows: 1
|
|
||||||
m_RequiresDepthTextureOption: 2
|
|
||||||
m_RequiresOpaqueTextureOption: 2
|
|
||||||
m_CameraType: 0
|
|
||||||
m_Cameras: []
|
|
||||||
m_RendererIndex: -1
|
|
||||||
m_VolumeLayerMask:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 1
|
|
||||||
m_VolumeTrigger: {fileID: 0}
|
|
||||||
m_VolumeFrameworkUpdateModeOption: 2
|
|
||||||
m_RenderPostProcessing: 0
|
|
||||||
m_Antialiasing: 0
|
|
||||||
m_AntialiasingQuality: 2
|
|
||||||
m_StopNaN: 0
|
|
||||||
m_Dithering: 0
|
|
||||||
m_ClearDepth: 1
|
|
||||||
m_AllowXRRendering: 1
|
|
||||||
m_AllowHDROutput: 1
|
|
||||||
m_UseScreenCoordOverride: 0
|
|
||||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
m_RequiresDepthTexture: 0
|
|
||||||
m_RequiresColorTexture: 0
|
|
||||||
m_TaaSettings:
|
|
||||||
m_Quality: 3
|
|
||||||
m_FrameInfluence: 0.1
|
|
||||||
m_JitterScale: 1
|
|
||||||
m_MipBias: 0
|
|
||||||
m_VarianceClampScale: 0.9
|
|
||||||
m_ContrastAdaptiveSharpening: 0
|
|
||||||
m_Version: 2
|
|
||||||
--- !u!20 &519420031
|
|
||||||
Camera:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 519420028}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 2
|
|
||||||
m_ClearFlags: 2
|
|
||||||
m_BackGroundColor: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
|
|
||||||
m_projectionMatrixMode: 1
|
|
||||||
m_GateFitMode: 2
|
|
||||||
m_FOVAxisMode: 0
|
|
||||||
m_Iso: 200
|
|
||||||
m_ShutterSpeed: 0.005
|
|
||||||
m_Aperture: 16
|
|
||||||
m_FocusDistance: 10
|
|
||||||
m_FocalLength: 50
|
|
||||||
m_BladeCount: 5
|
|
||||||
m_Curvature: {x: 2, y: 11}
|
|
||||||
m_BarrelClipping: 0.25
|
|
||||||
m_Anamorphism: 0
|
|
||||||
m_SensorSize: {x: 36, y: 24}
|
|
||||||
m_LensShift: {x: 0, y: 0}
|
|
||||||
m_NormalizedViewPortRect:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 1
|
|
||||||
height: 1
|
|
||||||
near clip plane: 0.3
|
|
||||||
far clip plane: 1000
|
|
||||||
field of view: 34
|
|
||||||
orthographic: 1
|
|
||||||
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: 0
|
|
||||||
m_HDR: 1
|
|
||||||
m_AllowMSAA: 0
|
|
||||||
m_AllowDynamicResolution: 0
|
|
||||||
m_ForceIntoRT: 0
|
|
||||||
m_OcclusionCulling: 0
|
|
||||||
m_StereoConvergence: 10
|
|
||||||
m_StereoSeparation: 0.022
|
|
||||||
--- !u!4 &519420032
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 519420028}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &603434663
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 603434665}
|
|
||||||
- component: {fileID: 603434664}
|
|
||||||
- component: {fileID: 603434666}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Square
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!212 &603434664
|
|
||||||
SpriteRenderer:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 603434663}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 0
|
|
||||||
m_ReceiveShadows: 0
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_StaticShadowCaster: 0
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 0
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
|
||||||
m_SmallMeshCulling: 1
|
|
||||||
m_ForceMeshLod: -1
|
|
||||||
m_MeshLodSelectionBias: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 0
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_GlobalIlluminationMeshLod: 0
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_MaskInteraction: 0
|
|
||||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
m_FlipX: 0
|
|
||||||
m_FlipY: 0
|
|
||||||
m_DrawMode: 0
|
|
||||||
m_Size: {x: 1, y: 1}
|
|
||||||
m_AdaptiveModeThreshold: 0.5
|
|
||||||
m_SpriteTileMode: 0
|
|
||||||
m_WasSpriteAssigned: 1
|
|
||||||
m_SpriteSortPoint: 0
|
|
||||||
--- !u!4 &603434665
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 603434663}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: -5, z: 0}
|
|
||||||
m_LocalScale: {x: 17.777779, y: 1, z: 11.111112}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!61 &603434666
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 603434663}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_ForceSendLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ForceReceiveLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ContactCaptureLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_CallbackLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_CompositeOperation: 0
|
|
||||||
m_CompositeOrder: 0
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0.5, y: 0.5}
|
|
||||||
oldSize: {x: 1, y: 1}
|
|
||||||
newSize: {x: 1, y: 1}
|
|
||||||
adaptiveTilingThreshold: 0.5
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
m_Size: {x: 1, y: 1}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!1 &619394800
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 619394802}
|
|
||||||
- component: {fileID: 619394801}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Global Light 2D
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!114 &619394801
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 619394800}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_ComponentVersion: 2
|
|
||||||
m_LightType: 4
|
|
||||||
m_BlendStyleIndex: 0
|
|
||||||
m_FalloffIntensity: 0.5
|
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
m_Intensity: 1
|
|
||||||
m_LightVolumeIntensity: 1
|
|
||||||
m_LightVolumeEnabled: 0
|
|
||||||
m_ApplyToSortingLayers: 00000000
|
|
||||||
m_LightCookieSprite: {fileID: 0}
|
|
||||||
m_DeprecatedPointLightCookieSprite: {fileID: 0}
|
|
||||||
m_LightOrder: 0
|
|
||||||
m_AlphaBlendOnOverlap: 0
|
|
||||||
m_OverlapOperation: 0
|
|
||||||
m_NormalMapDistance: 3
|
|
||||||
m_NormalMapQuality: 2
|
|
||||||
m_UseNormalMap: 0
|
|
||||||
m_ShadowsEnabled: 0
|
|
||||||
m_ShadowIntensity: 0.75
|
|
||||||
m_ShadowSoftness: 0
|
|
||||||
m_ShadowSoftnessFalloffIntensity: 0.5
|
|
||||||
m_ShadowVolumeIntensityEnabled: 0
|
|
||||||
m_ShadowVolumeIntensity: 0.75
|
|
||||||
m_LocalBounds:
|
|
||||||
m_Center: {x: 0, y: -0.00000011920929, z: 0}
|
|
||||||
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
|
|
||||||
m_PointLightInnerAngle: 360
|
|
||||||
m_PointLightOuterAngle: 360
|
|
||||||
m_PointLightInnerRadius: 0
|
|
||||||
m_PointLightOuterRadius: 1
|
|
||||||
m_ShapeLightParametricSides: 5
|
|
||||||
m_ShapeLightParametricAngleOffset: 0
|
|
||||||
m_ShapeLightParametricRadius: 1
|
|
||||||
m_ShapeLightFalloffSize: 0.5
|
|
||||||
m_ShapeLightFalloffOffset: {x: 0, y: 0}
|
|
||||||
m_ShapePath:
|
|
||||||
- {x: -0.5, y: -0.5, z: 0}
|
|
||||||
- {x: 0.5, y: -0.5, z: 0}
|
|
||||||
- {x: 0.5, y: 0.5, z: 0}
|
|
||||||
- {x: -0.5, y: 0.5, z: 0}
|
|
||||||
--- !u!4 &619394802
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 619394800}
|
|
||||||
serializedVersion: 2
|
|
||||||
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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &1472544503
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1472544505}
|
|
||||||
- component: {fileID: 1472544504}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: UnicornInput
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!114 &1472544504
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1472544503}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: caadd15da6c47e04a83c5441344e74c0, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::UnicornInput
|
|
||||||
--- !u!4 &1472544505
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1472544503}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -0.67683, y: 0.09318, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1660057539 &9223372036854775807
|
|
||||||
SceneRoots:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_Roots:
|
|
||||||
- {fileID: 519420032}
|
|
||||||
- {fileID: 619394802}
|
|
||||||
- {fileID: 68822293}
|
|
||||||
- {fileID: 603434665}
|
|
||||||
- {fileID: 1472544505}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.InputSystem;
|
|
||||||
|
|
||||||
public class PlayerMovement : MonoBehaviour
|
|
||||||
{
|
|
||||||
public float moveSpeed;
|
|
||||||
public float jumpForce;
|
|
||||||
|
|
||||||
private Rigidbody2D _rb;
|
|
||||||
private UnicornInputSystem _unicorn;
|
|
||||||
|
|
||||||
private void OnDisable()
|
|
||||||
{
|
|
||||||
_unicorn.Player.Jump.performed -= Jump;
|
|
||||||
}
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
_rb = GetComponent<Rigidbody2D>();
|
|
||||||
_unicorn = UnicornInput.Unicorn;
|
|
||||||
_unicorn.Player.Jump.performed += Jump;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void Jump(InputAction.CallbackContext obj)
|
|
||||||
{
|
|
||||||
_rb.linearVelocityY = jumpForce;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FixedUpdate()
|
|
||||||
{
|
|
||||||
var readValue = _unicorn.Player.Horizontal.ReadValue<float>();
|
|
||||||
_rb.linearVelocityX = readValue * moveSpeed;
|
|
||||||
if (_unicorn.Player.Down.IsPressed() && _rb.linearVelocityY < jumpForce/1.5)
|
|
||||||
_rb.linearVelocityY = Math.Min(0, _rb.linearVelocityY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
3
Assets/Scripts/Unicorn.meta
Normal file
3
Assets/Scripts/Unicorn.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1316cb6934774df09c36c65373697ba8
|
||||||
|
timeCreated: 1777908793
|
||||||
8
Assets/Scripts/Unicorn/Boss.meta
Normal file
8
Assets/Scripts/Unicorn/Boss.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dfcbc90cc7a0c014e81c445f114b9772
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
49
Assets/Scripts/Unicorn/Boss/AttackManager.cs
Normal file
49
Assets/Scripts/Unicorn/Boss/AttackManager.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Unicorn.Hitbox;
|
||||||
|
using Unity.Collections;
|
||||||
|
using Unity.Collections.LowLevel.Unsafe;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.Boss
|
||||||
|
{
|
||||||
|
public class AttackManager: MonoBehaviour
|
||||||
|
{
|
||||||
|
public static Dictionary<EntityId, float> _projMap;
|
||||||
|
public static Dictionary<EntityId, UnicornHitbox> _projHitboxMap;
|
||||||
|
private const float Lifetime = 5f;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_projMap = new Dictionary<EntityId, float>();
|
||||||
|
_projHitboxMap = new Dictionary<EntityId, UnicornHitbox>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
foreach (Transform o in transform)
|
||||||
|
{
|
||||||
|
var entityId = o.GetEntityId();
|
||||||
|
if (_projMap.TryAdd(entityId, 0f))
|
||||||
|
{
|
||||||
|
if (o.TryGetComponent(out UnicornHitbox hitbox))
|
||||||
|
_projHitboxMap.Add(entityId, hitbox);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o.gameObject.activeInHierarchy)
|
||||||
|
_projMap[entityId] += Time.fixedDeltaTime;
|
||||||
|
else continue;
|
||||||
|
|
||||||
|
if (_projMap[entityId] > Lifetime)
|
||||||
|
{
|
||||||
|
o.gameObject.SetActive(false);
|
||||||
|
_projMap[entityId] = 0f;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_projHitboxMap.TryGetValue(entityId, out var unicornHitbox)) continue;
|
||||||
|
o.transform.Translate(o.right * (unicornHitbox.hitboxData.hitboxSpeed * Time.fixedDeltaTime), Space.World);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/Boss/AttackManager.cs.meta
Normal file
3
Assets/Scripts/Unicorn/Boss/AttackManager.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 88e10741af6249658ff3e467495bf561
|
||||||
|
timeCreated: 1778331143
|
||||||
106
Assets/Scripts/Unicorn/Boss/Tuna.cs
Normal file
106
Assets/Scripts/Unicorn/Boss/Tuna.cs
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using DG.Tweening;
|
||||||
|
using Unicorn.Hitbox;
|
||||||
|
using UnityEngine;
|
||||||
|
using NotImplementedException = System.NotImplementedException;
|
||||||
|
|
||||||
|
namespace Unicorn.Boss
|
||||||
|
{
|
||||||
|
internal enum UnicornPhase
|
||||||
|
{
|
||||||
|
Start, P1, P2, P3, End
|
||||||
|
}
|
||||||
|
public class Tuna : LivingEntity
|
||||||
|
{
|
||||||
|
|
||||||
|
private UnicornPhase _unicornPhase = UnicornPhase.Start;
|
||||||
|
private Queue<GameObject> _p1Ps = new Queue<GameObject>();
|
||||||
|
private SpriteRenderer _renderer;
|
||||||
|
private const float P1PC = 50;
|
||||||
|
|
||||||
|
public Transform projContainer;
|
||||||
|
public GameObject phase1Proj;
|
||||||
|
|
||||||
|
|
||||||
|
private new void Start()
|
||||||
|
{
|
||||||
|
_renderer = GetComponent<SpriteRenderer>();
|
||||||
|
StartCoroutine(Started());
|
||||||
|
base.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator Started()
|
||||||
|
{
|
||||||
|
Invulnerable = true;
|
||||||
|
const float target = P1PC*5;
|
||||||
|
while (_p1Ps.Count < target)
|
||||||
|
{
|
||||||
|
var instantiate = Instantiate(phase1Proj, projContainer);
|
||||||
|
_p1Ps.Enqueue(instantiate);
|
||||||
|
instantiate.SetActive(false);
|
||||||
|
yield return new WaitForFixedUpdate();
|
||||||
|
}
|
||||||
|
StartCoroutine(Phase1());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 수정된 Phase1 로직
|
||||||
|
private IEnumerator Phase1()
|
||||||
|
{
|
||||||
|
Invulnerable = false;
|
||||||
|
_unicornPhase = UnicornPhase.P1;
|
||||||
|
const float angleStep = 360f / P1PC; // 각도 간격 (30도)
|
||||||
|
|
||||||
|
for (var i = 0; i < P1PC; i++)
|
||||||
|
{
|
||||||
|
var dequeue = _p1Ps.Dequeue();
|
||||||
|
dequeue.SetActive(true);
|
||||||
|
dequeue.transform.position = transform.position;
|
||||||
|
var targetAngle = transform.rotation.eulerAngles.z + (angleStep * i);
|
||||||
|
dequeue.transform.rotation = Quaternion.Euler(0, 0, targetAngle);
|
||||||
|
_p1Ps.Enqueue(dequeue);
|
||||||
|
}
|
||||||
|
yield return new WaitForSeconds(1);
|
||||||
|
if (health < maxHealth / 2)
|
||||||
|
{
|
||||||
|
StartCoroutine(Phase2());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
StartCoroutine(Phase1());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator Phase2()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnKnockback(DamageInfo info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDeath()
|
||||||
|
{
|
||||||
|
transform.DOScale(0f, 3f).SetEase(Ease.Linear).OnComplete(() =>
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
base.OnDeath();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDamaged(DamageInfo info)
|
||||||
|
{
|
||||||
|
StopCoroutine(HitColor());
|
||||||
|
StartCoroutine(HitColor());
|
||||||
|
base.OnDamaged(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator HitColor()
|
||||||
|
{
|
||||||
|
_renderer.color = new Color(1f, 0.8f, 0.8f);
|
||||||
|
yield return new WaitForSeconds(0.5f);
|
||||||
|
_renderer.color = Color.white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unicorn/Boss/Tuna.cs.meta
Normal file
2
Assets/Scripts/Unicorn/Boss/Tuna.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0f3078fdd3458bf459c4463291b07499
|
||||||
10
Assets/Scripts/Unicorn/GameManager.cs
Normal file
10
Assets/Scripts/Unicorn/GameManager.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn
|
||||||
|
{
|
||||||
|
|
||||||
|
public class GameManager: MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/GameManager.cs.meta
Normal file
3
Assets/Scripts/Unicorn/GameManager.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cc10e4b8623544638c8e15879ff85de7
|
||||||
|
timeCreated: 1778342698
|
||||||
3
Assets/Scripts/Unicorn/Hitbox.meta
Normal file
3
Assets/Scripts/Unicorn/Hitbox.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 271b8726c0e0470bbe992a207e5da700
|
||||||
|
timeCreated: 1777908913
|
||||||
11
Assets/Scripts/Unicorn/Hitbox/DamageInfo.cs
Normal file
11
Assets/Scripts/Unicorn/Hitbox/DamageInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.Hitbox
|
||||||
|
{
|
||||||
|
public struct DamageInfo
|
||||||
|
{
|
||||||
|
public float Damage;
|
||||||
|
public float KnockbackForce;
|
||||||
|
public Vector3 HitPoint; // 넉백 방향 계산을 위해 필요
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/Hitbox/DamageInfo.cs.meta
Normal file
3
Assets/Scripts/Unicorn/Hitbox/DamageInfo.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d01fae1e974b477591fb12d00e8c10ba
|
||||||
|
timeCreated: 1777908924
|
||||||
32
Assets/Scripts/Unicorn/Hitbox/UnicornHitbox.cs
Normal file
32
Assets/Scripts/Unicorn/Hitbox/UnicornHitbox.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.Hitbox
|
||||||
|
{
|
||||||
|
public class UnicornHitbox : MonoBehaviour
|
||||||
|
{
|
||||||
|
public UnicornHitboxDataSObj hitboxData;
|
||||||
|
|
||||||
|
private SpriteRenderer _spriteRenderer;
|
||||||
|
private bool _hitable = false;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_spriteRenderer = GetComponent<SpriteRenderer>();
|
||||||
|
_hitable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTriggerEnter2D(Collider2D other)
|
||||||
|
{
|
||||||
|
if (!other.TryGetComponent(out LivingEntity target)) return;
|
||||||
|
var info = new DamageInfo
|
||||||
|
{
|
||||||
|
Damage = hitboxData.damage,
|
||||||
|
KnockbackForce = hitboxData.knockbackForce,
|
||||||
|
HitPoint = transform.position
|
||||||
|
};
|
||||||
|
|
||||||
|
target.Damage(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unicorn/Hitbox/UnicornHitbox.cs.meta
Normal file
2
Assets/Scripts/Unicorn/Hitbox/UnicornHitbox.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bdb9c585da578ee408fc4177ce2010e1
|
||||||
12
Assets/Scripts/Unicorn/Hitbox/UnicornHitboxDataSObj.cs
Normal file
12
Assets/Scripts/Unicorn/Hitbox/UnicornHitboxDataSObj.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.Hitbox
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "NewAttackData", menuName = "Unicorn/AttackData")]
|
||||||
|
public class UnicornHitboxDataSObj: ScriptableObject
|
||||||
|
{
|
||||||
|
public float damage;
|
||||||
|
public float knockbackForce;
|
||||||
|
public float hitboxSpeed;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4de4d4a74d5b4258863a8173560a93ab
|
||||||
|
timeCreated: 1777908942
|
||||||
31
Assets/Scripts/Unicorn/HpBar.cs
Normal file
31
Assets/Scripts/Unicorn/HpBar.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn
|
||||||
|
{
|
||||||
|
public class HpBar : MonoBehaviour
|
||||||
|
{
|
||||||
|
private LivingEntity _parent;
|
||||||
|
public GameObject fill;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
if (!transform.parent.TryGetComponent(out _parent))
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateHealth();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateHealth()
|
||||||
|
{
|
||||||
|
var scale = Math.Max(_parent.health, 0f) / _parent.maxHealth;
|
||||||
|
fill.transform.localScale = new Vector3(scale, 1, 1);
|
||||||
|
fill.transform.localPosition = new Vector3((scale-1) / 2, 0, 0);
|
||||||
|
|
||||||
|
//1 -> 0
|
||||||
|
//0 -> -0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unicorn/HpBar.cs.meta
Normal file
2
Assets/Scripts/Unicorn/HpBar.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 177f745ebb3c415e8e5c73b53c18636b
|
||||||
50
Assets/Scripts/Unicorn/LivingEntity.cs
Normal file
50
Assets/Scripts/Unicorn/LivingEntity.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using Unicorn.Hitbox;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn
|
||||||
|
{
|
||||||
|
public partial class LivingEntity : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float maxHealth = 20.0f;
|
||||||
|
public float health = 20.0f;
|
||||||
|
public GameObject hpBarPrefab;
|
||||||
|
|
||||||
|
|
||||||
|
protected bool Invulnerable = false;
|
||||||
|
|
||||||
|
private Rigidbody2D Rb { get; set; }
|
||||||
|
private HpBar _hpBar;
|
||||||
|
|
||||||
|
protected void Start()
|
||||||
|
{
|
||||||
|
Rb = TryGetComponent(out Rigidbody2D rb) ? rb : null;
|
||||||
|
var hpBar = Instantiate(hpBarPrefab, transform);
|
||||||
|
hpBar.TryGetComponent(out _hpBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Damage(DamageInfo info)
|
||||||
|
{
|
||||||
|
if (Invulnerable) return;
|
||||||
|
health -= info.Damage;
|
||||||
|
OnDamaged(info);
|
||||||
|
OnKnockback(info);
|
||||||
|
if (health <= 0.0f) OnDeath();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected virtual void OnDeath() { }
|
||||||
|
|
||||||
|
|
||||||
|
protected virtual void OnDamaged(DamageInfo info)
|
||||||
|
{
|
||||||
|
if (_hpBar) _hpBar.UpdateHealth();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnKnockback(DamageInfo info)
|
||||||
|
{
|
||||||
|
|
||||||
|
var dir = transform.position - info.HitPoint;
|
||||||
|
Rb.AddForce(dir.normalized * info.KnockbackForce, ForceMode2D.Impulse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unicorn/LivingEntity.cs.meta
Normal file
2
Assets/Scripts/Unicorn/LivingEntity.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fe858eccb62e2294f91ad1a4291f2b10
|
||||||
3
Assets/Scripts/Unicorn/Player.meta
Normal file
3
Assets/Scripts/Unicorn/Player.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5614445efa7d41dc8cc9af23def94c20
|
||||||
|
timeCreated: 1777908834
|
||||||
20
Assets/Scripts/Unicorn/Player/Player.cs
Normal file
20
Assets/Scripts/Unicorn/Player/Player.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Unicorn.Hitbox;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.Player
|
||||||
|
{
|
||||||
|
public class Player: LivingEntity
|
||||||
|
{
|
||||||
|
protected override void OnDamaged(DamageInfo info)
|
||||||
|
{
|
||||||
|
Debug.Log(health);
|
||||||
|
base.OnDamaged(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDeath()
|
||||||
|
{
|
||||||
|
Debug.Log("주것서영.");
|
||||||
|
base.OnDeath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/Player/Player.cs.meta
Normal file
3
Assets/Scripts/Unicorn/Player/Player.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 28098bcb033145e7aed508aa64877be6
|
||||||
|
timeCreated: 1777820261
|
||||||
40
Assets/Scripts/Unicorn/Player/PlayerAttack.cs
Normal file
40
Assets/Scripts/Unicorn/Player/PlayerAttack.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using Unicorn.System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
namespace Unicorn.Player
|
||||||
|
{
|
||||||
|
public class PlayerAttack: MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject attackHitbox;
|
||||||
|
private UnicornInputSystem _unicornInput;
|
||||||
|
private bool _attackAvailable = true;
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_unicornInput = UnicornInput.Unicorn;
|
||||||
|
_unicornInput.Player.Attack.performed += Attack;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
_unicornInput.Player.Attack.performed -= Attack;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Attack(InputAction.CallbackContext obj)
|
||||||
|
{
|
||||||
|
if (!_attackAvailable) return;
|
||||||
|
StartCoroutine(OnAttack());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator OnAttack()
|
||||||
|
{
|
||||||
|
_attackAvailable = false;
|
||||||
|
attackHitbox.SetActive(true);
|
||||||
|
yield return new WaitForSeconds(0.5f);
|
||||||
|
attackHitbox.SetActive(false);
|
||||||
|
yield return new WaitForSeconds(0.1f);
|
||||||
|
_attackAvailable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/Player/PlayerAttack.cs.meta
Normal file
3
Assets/Scripts/Unicorn/Player/PlayerAttack.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 54eed17cf1e34c79b343bc0642ca8797
|
||||||
|
timeCreated: 1777820778
|
||||||
42
Assets/Scripts/Unicorn/Player/PlayerMovement.cs
Normal file
42
Assets/Scripts/Unicorn/Player/PlayerMovement.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using Unicorn.System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
namespace Unicorn.Player
|
||||||
|
{
|
||||||
|
public class PlayerMovement : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float moveSpeed;
|
||||||
|
public float jumpForce;
|
||||||
|
|
||||||
|
private Rigidbody2D _rb;
|
||||||
|
private UnicornInputSystem _unicorn;
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
_unicorn.Player.Jump.performed -= Jump;
|
||||||
|
}
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
_rb = GetComponent<Rigidbody2D>();
|
||||||
|
_unicorn = UnicornInput.Unicorn;
|
||||||
|
_unicorn.Player.Jump.performed += Jump;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void Jump(InputAction.CallbackContext obj)
|
||||||
|
{
|
||||||
|
_rb.linearVelocityY = jumpForce;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
var readValue = _unicorn.Player.Horizontal.ReadValue<float>();
|
||||||
|
_rb.linearVelocityX = readValue * moveSpeed;
|
||||||
|
if (_unicorn.Player.Down.IsPressed() && _rb.linearVelocityY < jumpForce/1.5)
|
||||||
|
_rb.linearVelocityY = Math.Min(0, _rb.linearVelocityY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Unicorn/System.meta
Normal file
3
Assets/Scripts/Unicorn/System.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8401e6c224a64b938938375ee5061879
|
||||||
|
timeCreated: 1777908811
|
||||||
33
Assets/Scripts/Unicorn/System/UnicornInput.cs
Normal file
33
Assets/Scripts/Unicorn/System/UnicornInput.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Unicorn.System
|
||||||
|
{
|
||||||
|
public class UnicornInput : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static UnicornInputSystem Unicorn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
_unicorn ??= new UnicornInputSystem();
|
||||||
|
return _unicorn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static UnicornInputSystem _unicorn;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_unicorn ??= new UnicornInputSystem();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
Unicorn.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
Unicorn.Disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class UnicornInput : MonoBehaviour
|
|
||||||
{
|
|
||||||
public static UnicornInputSystem Unicorn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
_unicorn ??= new UnicornInputSystem();
|
|
||||||
return _unicorn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static UnicornInputSystem _unicorn;
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
_unicorn ??= new UnicornInputSystem();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
|
||||||
{
|
|
||||||
Unicorn.Enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDisable()
|
|
||||||
{
|
|
||||||
Unicorn.Disable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
8
Assets/ScritableObjects.meta
Normal file
8
Assets/ScritableObjects.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 64fa6e6de39c4aa418339d93d6f9c418
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
17
Assets/ScritableObjects/ExampleAD.asset
Normal file
17
Assets/ScritableObjects/ExampleAD.asset
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: 4de4d4a74d5b4258863a8173560a93ab, type: 3}
|
||||||
|
m_Name: ExampleAD
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.Game.Hitbox.UnicornAttackDataSO
|
||||||
|
damage: 10
|
||||||
|
knockbackForce: 15
|
||||||
|
hitboxSpeed: 0
|
||||||
8
Assets/ScritableObjects/ExampleAD.asset.meta
Normal file
8
Assets/ScritableObjects/ExampleAD.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 67ddb0901f4c7754a9e47e5cf5cac286
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/ScritableObjects/Tuna.meta
Normal file
8
Assets/ScritableObjects/Tuna.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9b4dc8f9edf4d63479993d6d64715301
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
17
Assets/ScritableObjects/Tuna/TunaP1.asset
Normal file
17
Assets/ScritableObjects/Tuna/TunaP1.asset
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: 4de4d4a74d5b4258863a8173560a93ab, type: 3}
|
||||||
|
m_Name: TunaP1
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.Hitbox.UnicornAttackDataSObj
|
||||||
|
damage: 1
|
||||||
|
knockbackForce: 15
|
||||||
|
hitboxSpeed: 2
|
||||||
8
Assets/ScritableObjects/Tuna/TunaP1.asset.meta
Normal file
8
Assets/ScritableObjects/Tuna/TunaP1.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b6eb28167ca507f4097a624f0cc29d54
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
17
Assets/ScritableObjects/Tuna/TunaP2.asset
Normal file
17
Assets/ScritableObjects/Tuna/TunaP2.asset
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: 4de4d4a74d5b4258863a8173560a93ab, type: 3}
|
||||||
|
m_Name: TunaP2
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::Unicorn.Hitbox.UnicornHitboxDataSObj
|
||||||
|
damage: 3
|
||||||
|
knockbackForce: 1
|
||||||
|
hitboxSpeed: 0
|
||||||
8
Assets/ScritableObjects/Tuna/TunaP2.asset.meta
Normal file
8
Assets/ScritableObjects/Tuna/TunaP2.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 248f48de9b829c64486e3828c25cb9fc
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user