├── .gitignore ├── README.md ├── Source ├── Assets │ ├── SpritedowAnimator.meta │ └── SpritedowAnimator │ │ ├── Examples.meta │ │ ├── Examples │ │ ├── EventExample.meta │ │ ├── EventExample │ │ │ ├── Animations.meta │ │ │ ├── Animations │ │ │ │ ├── Slimedow.asset │ │ │ │ └── Slimedow.asset.meta │ │ │ ├── Scenes.meta │ │ │ ├── Scenes │ │ │ │ ├── EventExample.unity │ │ │ │ └── EventExample.unity.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── EventExample.cs │ │ │ │ └── EventExample.cs.meta │ │ │ ├── Sprites.meta │ │ │ └── Sprites │ │ │ │ ├── Slimedow.png │ │ │ │ └── Slimedow.png.meta │ │ ├── PlatformerExample.meta │ │ └── PlatformerExample │ │ │ ├── Animations.meta │ │ │ ├── Animations │ │ │ ├── AlienClimb.asset │ │ │ ├── AlienClimb.asset.meta │ │ │ ├── AlienDuck.asset │ │ │ ├── AlienDuck.asset.meta │ │ │ ├── AlienJump.asset │ │ │ ├── AlienJump.asset.meta │ │ │ ├── AlienStand.asset │ │ │ ├── AlienStand.asset.meta │ │ │ ├── AlienSwim.asset │ │ │ ├── AlienSwim.asset.meta │ │ │ ├── AlienWalk.asset │ │ │ └── AlienWalk.asset.meta │ │ │ ├── Scenes.meta │ │ │ ├── Scenes │ │ │ ├── PlatformerExample.unity │ │ │ └── PlatformerExample.unity.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ ├── PlayerPlatformer.cs │ │ │ └── PlayerPlatformer.cs.meta │ │ │ ├── Sprites.meta │ │ │ └── Sprites │ │ │ ├── Square.png │ │ │ ├── Square.png.meta │ │ │ ├── alienBeige.png │ │ │ └── alienBeige.png.meta │ │ ├── Readme.pdf │ │ ├── Readme.pdf.meta │ │ ├── Source.meta │ │ └── Source │ │ ├── BaseAnimator.cs │ │ ├── BaseAnimator.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── EditorBaseAnimator.cs │ │ ├── EditorBaseAnimator.cs.meta │ │ ├── EditorSpriteAnimation.cs │ │ ├── EditorSpriteAnimation.cs.meta │ │ ├── EditorSpriteAnimationWindow.cs │ │ ├── EditorSpriteAnimationWindow.cs.meta │ │ ├── EditorSpriteAnimator.cs │ │ ├── EditorSpriteAnimator.cs.meta │ │ ├── EditorUIAnimator.cs │ │ ├── EditorUIAnimator.cs.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── Spritedow.mat │ │ │ ├── Spritedow.mat.meta │ │ │ ├── Spritedow.shader │ │ │ └── Spritedow.shader.meta │ │ ├── SpriteEditorHelper.cs │ │ ├── SpriteEditorHelper.cs.meta │ │ ├── SpriteSorter.cs │ │ └── SpriteSorter.cs.meta │ │ ├── LoopType.cs │ │ ├── LoopType.cs.meta │ │ ├── SpriteAnimation.cs │ │ ├── SpriteAnimation.cs.meta │ │ ├── SpriteAnimationAction.cs │ │ ├── SpriteAnimationAction.cs.meta │ │ ├── SpriteAnimationFrame.cs │ │ ├── SpriteAnimationFrame.cs.meta │ │ ├── SpriteAnimator.cs │ │ ├── SpriteAnimator.cs.meta │ │ ├── SpriteAnimatorEvent.cs │ │ ├── SpriteAnimatorEvent.cs.meta │ │ ├── SpriteAnimatorEventInfo.cs │ │ ├── SpriteAnimatorEventInfo.cs.meta │ │ ├── UIAnimator.cs │ │ └── UIAnimator.cs.meta ├── Logs │ └── Packages-Update.log ├── Packages │ └── manifest.json ├── UserSettings │ └── EditorUserSettings.asset └── obj │ └── Debug │ ├── Assembly-CSharp-Editor.csprojAssemblyReference.cache │ ├── Assembly-CSharp.csprojAssemblyReference.cache │ └── DesignTimeResolveAssemblyReferencesInput.cache └── SpritedowAnimator.unitypackage /.gitignore: -------------------------------------------------------------------------------- 1 | Temp/ 2 | Library/ 3 | Build/ 4 | ProjectSettings/ 5 | TestAssets/ 6 | AssetStoreTools/ 7 | /[Ll]ibrary/ 8 | /[Tt]emp/ 9 | /[Oo]bj/ 10 | /[Bb]uild/ 11 | /[Bb]uilds/ 12 | /[Pp]rojectSettings/ 13 | /[Tt]estAssets/ 14 | /Assets/[Aa]ssetStoreTools/ 15 | ExportedObj/ 16 | *.csproj 17 | *.unityproj 18 | *.sln 19 | *.suo 20 | *.tmp 21 | *.user 22 | *.userprefs 23 | *.pidb 24 | *.booproj 25 | *.svd 26 | sysinfo.txt 27 | Source/Assets/AssetStoreTools.meta 28 | .vs/ 29 | Packages/ 30 | UserSettings/ 31 | Logs/ 32 | obj/ 33 | .vsconfig -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spritedow Animator 2 | A plugin to do simple sprite animations avoiding the big and tedious Unity's Mecanim system. 3 | Oriented to programmers, if you prefer visual scripting you maybe prefer using Mecanim instead of this. 4 | 5 | # Installation Guide 6 | Simply copy the files on your project or use the UnityPackage included. 7 | 8 | # Creating an animation 9 | Use the animation editor to create new animation files. You can open it selecting **Sprite Animation Editor** on **Tools/Elendow** tab. 10 | - Give a name to the animation. This will be also the asset name. 11 | - Select the folder to save. 12 | - Select the framerate of the animation. 13 | - You can also use the animator framerate instead when playing the animation. 14 | - Add frames manually or dropping the sprite to the Drag&Drop box. 15 | - If you drop a Texture instead of a sprite to the Drag&Drop box, the plugin will take all the sprites on that Texture 16 | - You can change the duration of each frame, 1 by default, to any number greater than 0. 17 | - You can sort the frames. 18 | - You can add actions to the frames, this will be triggered when the animation reaches this frame and you can subscribe to the action to do something (for example, spawning a particle or playing a sound). 19 | - Any change is automatically saved. 20 | - You can preview the animation. 21 | - The speed and loop settings of the preview window are only for that window. 22 | 23 | # Inspector properties 24 | - **Ignore time scale** will set the animation to ignore the game TimeScale. 25 | - **Enable render on play** will enable the render each time the animation plays. 26 | - **Disable render on finish** will disable the renderer after every loop cycle if there’s a delay specified or will disable the renderer after the animation ends if it’s not looping. 27 | 28 | - **Play on awake** will start playing when the object awakes. 29 | - **Start at random frame** will set the animation to start at random frame when “Play” is called. 30 | - **Backwards** if true the animation will play backwards. 31 | - **Random Animation** if true the start animation will be random, and the animation will randomly change after every loop cycle. 32 | - **Animation** if the animation is not random, this animation will play on awake. 33 | - **One shot** if false the animation will loop infinite times. 34 | - **Loop Type** repeat will loop the animation resetting it, yoyo will loop going back and forth. 35 | - **Delay** if true a delay between loops will be made 36 | - **Min** minimum delay time 37 | - **Max** maximum delay time 38 | 39 | - **Random Animation List** the list of animations used if the animator has play on awake and random animation. 40 | - **Fallback Animation** if a fallback animation is specified, when any animation finish this animation will be played. Useful for idle animations. 41 | 42 | # UI Image Animator Inspector properties 43 | - **Preserve Aspect Ratio** this option will set the "Preserve Aspect Ratio" property of the image to the desired value, usefull because without an initial sprite assigned this value is not visible on the Image component. 44 | 45 | # Using the animations 46 | Add the **SpriteAnimator** or **UIAnimator** component to the object you want to animate. 47 | This component requires a SpriteRenderer or Image component to work. If the object doesn't have one, the animator will add it automatically. 48 | On your code, use **GetComponent\** or **GetComponent\** to get the reference and start using it. 49 | 50 | # Animator Methods 51 | - **Play(SpriteAnimation animation, bool playOneShot = false, bool playBackwards = false, LoopType loopType = LoopType.repeat)** 52 | - Plays the specified animation. 53 | - **PlayRandom(bool playOneShot = false, bool playBackwards = false, LoopType loopType = LoopType.repeat)** 54 | - Plays a random animation of the random animation list. 55 | - **PlayStartingAtFrame(SpriteAnimation animation, int frame, bool playOneShot = false, bool playBackwards = false, LoopType loopType = LoopType.repeat)** 56 | - Plays an animation starting at the specified frame. 57 | - **PlayStartingAtTime(SpriteAnimation animation, float time, bool playOneShot = false, bool playBackwards = false, LoopType loopType = LoopType.repeat)** 58 | - Plays an animation starting at the specified time (in seconds). 59 | - **PlayStartingAtNormalizedTime(SpriteAnimation animation, float normalizedTime, bool playOneShot = false, bool playBackwards = false, LoopType loopType = LoopType.repeat)** 60 | - Plays an animation starting at the specified normalized time (between 0 and 1). 61 | - **Resume()** 62 | - Resumes the animation. 63 | - **StopAtFrame()** 64 | - Stops when reaches the desired frame. If the desired frame has already passed and the animation is not looped it will stop at the end of the animation anyway. 65 | - **Stop()** 66 | - Stops the animation. 67 | - **SetFallbackAnimation(SpriteAnimation animation, LoopType loopType)** 68 | - Sets the fallback animation to play and its loop type. 69 | - **UseAnimatorFPS(int frameRate)** 70 | - Sets the animator FPS overriding the FPS of the animation. 71 | - **UseAnimationFPS()** 72 | - Sets de animator FPS to the current animation FPS. 73 | - **RemoveFallbackAnimation()** 74 | - Removes the fallback animation. 75 | - **Restart()** 76 | - Restarts the animation. If the animation is not playing the effects will apply when starts playing. 77 | - **AddCustomEvent(SpriteAnimation animation, int frame)** 78 | - Adds a custom event to specified animation on a certain frame. 79 | - Returns the event created. Null if the animation is null or doesn't have enough frames. 80 | - **AddCustomEventAtEnd(SpriteAnimation animation)** 81 | - Adds a custom event to specified animation on the last frame. 82 | - Returns the event created. Null if the animation is null. 83 | - **GetCustomEvent(SpriteAnimation animation, int frame)** 84 | - Gets the custom event of an animation on a certain frame. 85 | - Returns the event of the specified animation on the selected frame. Null if not found. 86 | - **GetCustomEventAtEnd(SpriteAnimation animation)** 87 | - Gets the custom event of an animation on the last frame. 88 | - Returns the event of the specified animation on the last frame. Null if not found. 89 | - **SetActiveRenderer(bool active)** 90 | - Enable or disable the renderer. 91 | - **FlipSpriteX(bool flip)** 92 | - Flip the sprite on the X axis. 93 | - **Not working on the UIAnimator** 94 | - **FlipSpriteY(bool flip)** 95 | - Flip the sprite on the Y axis. 96 | - **Not working on the UIAnimator** 97 | - **SetRandomDelayBetweenLoops(float min, float max)** 98 | - Sets a random delay between loops. 99 | - **SetDelayBetweenLoops(float delay)** 100 | - Sets a delay between loops. 101 | - **SetAnimationTime(float time)** 102 | - Sets the animation time to the specified time, updating de sprite to the correspondent frame at that time. 103 | - **SetAnimationNormalizedTime(float normalizedTime)** 104 | - Sets the animation time to the specified normalized time (between 0 and 1), updating de sprite to the correspondent frame at that time. 105 | 106 | # Animator Properties 107 | - **bool IsPlaying { get; }** 108 | - Gets if the animator is playing an animation or not. 109 | - **bool DisableRenderOnFinish { set; }** 110 | - If true, the animator will disable the renderer when the animation ends. 111 | - **bool RandomAnimation { set; }** 112 | - If true the animator will get a random animation after every loop cycle. 113 | - **bool DelayBetweenLoops { set; }** 114 | - If true a delay will be made between loops. 115 | - **bool IgnoreTimeScale { set; }** 116 | - If true, the timescale of the game will be ignored. 117 | - **bool StartAtRandomFrame { set; }** 118 | - If true, the timescale of the game will be ignored. 119 | - **bool StartAtRandomFrame { set; }** 120 | - The animation will start at a random frame if this is true. 121 | - **int CurrentFrame { get; }** 122 | - The current frame of the animation. 123 | - **int CurrentFrameRate { get; }** 124 | - The current FPS of the animator (it could be the animation FPS or an overrided FPS). 125 | - **float CurrentAnimationTime { get; }** 126 | - The current time in seconds of the playing animation. 127 | - **float CurrentAnimationTimeNormalized { get; }** 128 | - The current time of the playing animation normalized (between 0 and 1). 129 | - **SpriteAnimation PlayingAnimation { get; }** 130 | - The currently playing animation. 131 | 132 | # Animation Actions 133 | - Actions will be called if they are defined on the animation. 134 | ```c# 135 | private SpriteAnimator spriteAnimator; 136 | 137 | private void Awake() 138 | { 139 | spriteAnimator = GetComponent(); 140 | spriteAnimator.OnAnimationAction += OnAnimactionAction; 141 | } 142 | 143 | private void OnAnimactionAction(SpriteAnimationAction action, SpriteAnimation animation) 144 | { 145 | // Do something 146 | } 147 | ``` 148 | 149 | # Animator Events 150 | - Some events will be always triggered. 151 | - **OnFinish** is triggered when the animation reach the last frame. 152 | - **OnPlay** is triggered when the animation starts playing. 153 | - **OnStop** is triggered when the animation is forced to stop. 154 | ```c# 155 | private SpriteAnimator spriteAnimator; 156 | 157 | private void Awake() 158 | { 159 | spriteAnimator = GetComponent(); 160 | spriteAnimator.OnPlay += OnAnimationPlay; 161 | } 162 | 163 | private void OnAnimationPlay() 164 | { 165 | // Do something 166 | } 167 | ``` 168 | 169 | - You can add custom events to be fired. This will not be saved on the animation. 170 | ```c# 171 | public SpriteAnimation walkAnimation; 172 | private SpriteAnimator spriteAnimator; 173 | 174 | private void Awake() 175 | { 176 | spriteAnimator = GetComponent(); 177 | spriteAnimator.AddCustomEvent(walkAnimation, 5).AddListener(StepEvent); 178 | } 179 | 180 | private void StepEvent(BaseAnimator animator) 181 | { 182 | // Do something 183 | } 184 | ``` 185 | 186 | # Animation Methods 187 | - **Sprite GetFrame (int frame)** 188 | - Returns the sprite on the selected frame. 189 | - **int GetFrameDuration(int index)** 190 | - Returns the duration (in frames) of the selected frame. 191 | - **int GetFrameAtTime(float time)** 192 | - Get the frame at the specified time using the animation frame rate. 193 | - **int GetFrameAtTime(float time, int frameRate)** 194 | - Get the frame at the specified time using the specified frame rate. 195 | - **float GetAnimationDurationInSeconds()** 196 | - Get the total duration of the animation in seconds using the animation frame rate. 197 | - **float GetAnimationDurationInSeconds(int frameRate)** 198 | - Get the total duration of the animation in seconds using the specified frame rate. 199 | - **int GetFrameAtNormalizedTime(float normalizedTime)** 200 | - Get the frame index at the specified normalized time (between 0 and 1) using the animation frame rate. 201 | - **int GetFrameAtNormalizedTime(float normalizedTime, int frameRate)** 202 | - Get the frame index at the specified normalized time (between 0 and 1) using the specified frame rate. 203 | 204 | 205 | # Animation Properties 206 | - **int FPS { get; set; }** 207 | - The framerate of the animation. 208 | - **int FramesCount { get; }** 209 | - Frames on this animation. 210 | - **List Frames { get; set; }** 211 | - List of frames. 212 | - **List Actions { get; }** 213 | - List of custom actions added to the animation. 214 | - **int AnimationDuration { get; }** 215 | - The total duration of the animation (in frames) 216 | 217 | # License 218 | MIT 219 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3c61b852399b674b83aee2906e8c40b 3 | folderAsset: yes 4 | timeCreated: 1481150126 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feee008f2b3134f40906f228422c5e52 3 | folderAsset: yes 4 | timeCreated: 1486584203 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da3d94683e77c4b7bba68162401f4324 3 | folderAsset: yes 4 | timeCreated: 1498331875 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 860b66f71ecc34454a79887ffebc24aa 3 | folderAsset: yes 4 | timeCreated: 1498331875 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Animations/Slimedow.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 13 | m_Name: Slimedow 14 | m_EditorClassIdentifier: 15 | fps: 40 16 | totalDuration: 36 17 | frames: 18 | - duration: 1 19 | sprite: {fileID: 21300000, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 20 | - duration: 1 21 | sprite: {fileID: 21300002, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 22 | - duration: 1 23 | sprite: {fileID: 21300004, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 24 | - duration: 1 25 | sprite: {fileID: 21300006, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 26 | - duration: 1 27 | sprite: {fileID: 21300008, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 28 | - duration: 1 29 | sprite: {fileID: 21300010, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 30 | - duration: 1 31 | sprite: {fileID: 21300012, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 32 | - duration: 1 33 | sprite: {fileID: 21300014, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 34 | - duration: 1 35 | sprite: {fileID: 21300016, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 36 | - duration: 2 37 | sprite: {fileID: 21300018, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 38 | - duration: 1 39 | sprite: {fileID: 21300020, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 40 | - duration: 1 41 | sprite: {fileID: 21300022, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 42 | - duration: 1 43 | sprite: {fileID: 21300024, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 44 | - duration: 1 45 | sprite: {fileID: 21300026, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 46 | - duration: 1 47 | sprite: {fileID: 21300028, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 48 | - duration: 1 49 | sprite: {fileID: 21300030, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 50 | - duration: 1 51 | sprite: {fileID: 21300032, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 52 | - duration: 1 53 | sprite: {fileID: 21300034, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 54 | - duration: 1 55 | sprite: {fileID: 21300036, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 56 | - duration: 1 57 | sprite: {fileID: 21300038, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 58 | - duration: 1 59 | sprite: {fileID: 21300040, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 60 | - duration: 1 61 | sprite: {fileID: 21300042, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 62 | - duration: 1 63 | sprite: {fileID: 21300044, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 64 | - duration: 1 65 | sprite: {fileID: 21300046, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 66 | - duration: 1 67 | sprite: {fileID: 21300048, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 68 | - duration: 1 69 | sprite: {fileID: 21300050, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 70 | - duration: 1 71 | sprite: {fileID: 21300052, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 72 | - duration: 1 73 | sprite: {fileID: 21300054, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 74 | - duration: 1 75 | sprite: {fileID: 21300056, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 76 | - duration: 1 77 | sprite: {fileID: 21300058, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 78 | - duration: 1 79 | sprite: {fileID: 21300060, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 80 | - duration: 1 81 | sprite: {fileID: 21300062, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 82 | - duration: 1 83 | sprite: {fileID: 21300064, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 84 | - duration: 1 85 | sprite: {fileID: 21300066, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 86 | - duration: 1 87 | sprite: {fileID: 21300068, guid: fe5a641aeafb9a345ad9cf8a1164be1a, type: 3} 88 | actions: [] 89 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Animations/Slimedow.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 671544aab7a05c9488a41d3194c65307 3 | timeCreated: 1488315223 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e4a266a53435486da1d9c99cac092eb 3 | folderAsset: yes 4 | timeCreated: 1498331922 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Scenes/EventExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0722070f9a7344a6b8f7de7760aa3fe4 3 | timeCreated: 1498331875 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1203283d803d4bf8bcc950c6d0cf600 3 | folderAsset: yes 4 | timeCreated: 1498331911 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Scripts/EventExample.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // http://elendow.com 3 | 4 | using UnityEngine; 5 | 6 | namespace Elendow.SpritedowAnimator.Examples 7 | { 8 | public class EventExample : MonoBehaviour 9 | { 10 | #region Attributes 11 | public SpriteAnimation anim; 12 | 13 | private SpriteAnimator spriteAnimator; 14 | private ParticleSystem particles; 15 | #endregion 16 | 17 | private void Awake() 18 | { 19 | particles = GetComponentInChildren(); 20 | 21 | // Here we add an event to the 9th frame of the animation Slimedow 22 | // After that, we subscribe the method "BurstParticles" 23 | // We can also get the event with spriteAnimator.GetCustomEvent("Slimedow", 9) and suscribe whatever we want 24 | spriteAnimator = GetComponent(); 25 | spriteAnimator.AddCustomEvent(anim, 9).AddListener(BurstParticles); 26 | 27 | // Then we simply play the animation and the magic begins 28 | spriteAnimator.Play(anim, false); 29 | } 30 | 31 | private void BurstParticles(BaseAnimator caller) 32 | { 33 | particles.Play(); 34 | } 35 | 36 | private void Update() 37 | { 38 | if(Input.GetKeyDown(KeyCode.Space)) 39 | { 40 | spriteAnimator.Play(anim, true); 41 | Debug.Break(); 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Scripts/EventExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 941925edfb8434aac870e6df60401758 3 | timeCreated: 1498331875 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6826de4de93fe41babc10b009387783f 3 | folderAsset: yes 4 | timeCreated: 1498331875 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Sprites/Slimedow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/Assets/SpritedowAnimator/Examples/EventExample/Sprites/Slimedow.png -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/EventExample/Sprites/Slimedow.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe5a641aeafb9a345ad9cf8a1164be1a 3 | TextureImporter: 4 | internalIDToNameTable: 5 | - first: 6 | 213: 21300000 7 | second: Slimedow_0 8 | - first: 9 | 213: 21300002 10 | second: Slimedow_1 11 | - first: 12 | 213: 21300004 13 | second: Slimedow_2 14 | - first: 15 | 213: 21300006 16 | second: Slimedow_3 17 | - first: 18 | 213: 21300008 19 | second: Slimedow_4 20 | - first: 21 | 213: 21300010 22 | second: Slimedow_5 23 | - first: 24 | 213: 21300012 25 | second: Slimedow_6 26 | - first: 27 | 213: 21300014 28 | second: Slimedow_7 29 | - first: 30 | 213: 21300016 31 | second: Slimedow_8 32 | - first: 33 | 213: 21300018 34 | second: Slimedow_9 35 | - first: 36 | 213: 21300020 37 | second: Slimedow_10 38 | - first: 39 | 213: 21300022 40 | second: Slimedow_11 41 | - first: 42 | 213: 21300024 43 | second: Slimedow_12 44 | - first: 45 | 213: 21300026 46 | second: Slimedow_13 47 | - first: 48 | 213: 21300028 49 | second: Slimedow_14 50 | - first: 51 | 213: 21300030 52 | second: Slimedow_15 53 | - first: 54 | 213: 21300032 55 | second: Slimedow_16 56 | - first: 57 | 213: 21300034 58 | second: Slimedow_17 59 | - first: 60 | 213: 21300036 61 | second: Slimedow_18 62 | - first: 63 | 213: 21300038 64 | second: Slimedow_19 65 | - first: 66 | 213: 21300040 67 | second: Slimedow_20 68 | - first: 69 | 213: 21300042 70 | second: Slimedow_21 71 | - first: 72 | 213: 21300044 73 | second: Slimedow_22 74 | - first: 75 | 213: 21300046 76 | second: Slimedow_23 77 | - first: 78 | 213: 21300048 79 | second: Slimedow_24 80 | - first: 81 | 213: 21300050 82 | second: Slimedow_25 83 | - first: 84 | 213: 21300052 85 | second: Slimedow_26 86 | - first: 87 | 213: 21300054 88 | second: Slimedow_27 89 | - first: 90 | 213: 21300056 91 | second: Slimedow_28 92 | - first: 93 | 213: 21300058 94 | second: Slimedow_29 95 | - first: 96 | 213: 21300060 97 | second: Slimedow_30 98 | - first: 99 | 213: 21300062 100 | second: Slimedow_31 101 | - first: 102 | 213: 21300064 103 | second: Slimedow_32 104 | - first: 105 | 213: 21300066 106 | second: Slimedow_33 107 | - first: 108 | 213: 21300068 109 | second: Slimedow_34 110 | - first: 111 | 213: 21300070 112 | second: Slimedow_35 113 | - first: 114 | 213: 21300072 115 | second: Slimedow_36 116 | - first: 117 | 213: 21300074 118 | second: Slimedow_37 119 | - first: 120 | 213: 21300076 121 | second: Slimedow_38 122 | - first: 123 | 213: 21300078 124 | second: Slimedow_39 125 | externalObjects: {} 126 | serializedVersion: 11 127 | mipmaps: 128 | mipMapMode: 0 129 | enableMipMap: 0 130 | sRGBTexture: 1 131 | linearTexture: 0 132 | fadeOut: 0 133 | borderMipMap: 0 134 | mipMapsPreserveCoverage: 0 135 | alphaTestReferenceValue: 0.5 136 | mipMapFadeDistanceStart: 1 137 | mipMapFadeDistanceEnd: 3 138 | bumpmap: 139 | convertToNormalMap: 0 140 | externalNormalMap: 0 141 | heightScale: 0.25 142 | normalMapFilter: 0 143 | isReadable: 0 144 | streamingMipmaps: 0 145 | streamingMipmapsPriority: 0 146 | vTOnly: 0 147 | ignoreMasterTextureLimit: 0 148 | grayScaleToAlpha: 0 149 | generateCubemap: 6 150 | cubemapConvolution: 0 151 | seamlessCubemap: 0 152 | textureFormat: 1 153 | maxTextureSize: 2048 154 | textureSettings: 155 | serializedVersion: 2 156 | filterMode: 1 157 | aniso: 1 158 | mipBias: 0 159 | wrapU: 1 160 | wrapV: 1 161 | wrapW: 1 162 | nPOTScale: 0 163 | lightmap: 0 164 | compressionQuality: 50 165 | spriteMode: 2 166 | spriteExtrude: 1 167 | spriteMeshType: 1 168 | alignment: 0 169 | spritePivot: {x: 0.5, y: 0.5} 170 | spritePixelsToUnits: 100 171 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 172 | spriteGenerateFallbackPhysicsShape: 1 173 | alphaUsage: 1 174 | alphaIsTransparency: 1 175 | spriteTessellationDetail: -1 176 | textureType: 8 177 | textureShape: 1 178 | singleChannelComponent: 0 179 | flipbookRows: 1 180 | flipbookColumns: 1 181 | maxTextureSizeSet: 0 182 | compressionQualitySet: 0 183 | textureFormatSet: 0 184 | ignorePngGamma: 0 185 | applyGammaDecoding: 1 186 | platformSettings: 187 | - serializedVersion: 3 188 | buildTarget: DefaultTexturePlatform 189 | maxTextureSize: 2048 190 | resizeAlgorithm: 0 191 | textureFormat: -1 192 | textureCompression: 1 193 | compressionQuality: 50 194 | crunchedCompression: 0 195 | allowsAlphaSplitting: 0 196 | overridden: 0 197 | androidETC2FallbackOverride: 0 198 | forceMaximumCompressionQuality_BC6H_BC7: 1 199 | - serializedVersion: 3 200 | buildTarget: Standalone 201 | maxTextureSize: 2048 202 | resizeAlgorithm: 0 203 | textureFormat: -1 204 | textureCompression: 1 205 | compressionQuality: 50 206 | crunchedCompression: 0 207 | allowsAlphaSplitting: 0 208 | overridden: 0 209 | androidETC2FallbackOverride: 0 210 | forceMaximumCompressionQuality_BC6H_BC7: 1 211 | - serializedVersion: 3 212 | buildTarget: Android 213 | maxTextureSize: 2048 214 | resizeAlgorithm: 0 215 | textureFormat: -1 216 | textureCompression: 1 217 | compressionQuality: 50 218 | crunchedCompression: 0 219 | allowsAlphaSplitting: 0 220 | overridden: 0 221 | androidETC2FallbackOverride: 0 222 | forceMaximumCompressionQuality_BC6H_BC7: 1 223 | - serializedVersion: 3 224 | buildTarget: WebGL 225 | maxTextureSize: 2048 226 | resizeAlgorithm: 0 227 | textureFormat: -1 228 | textureCompression: 1 229 | compressionQuality: 50 230 | crunchedCompression: 0 231 | allowsAlphaSplitting: 0 232 | overridden: 0 233 | androidETC2FallbackOverride: 0 234 | forceMaximumCompressionQuality_BC6H_BC7: 1 235 | spriteSheet: 236 | serializedVersion: 2 237 | sprites: 238 | - serializedVersion: 2 239 | name: Slimedow_0 240 | rect: 241 | serializedVersion: 2 242 | x: 0 243 | y: 779 244 | width: 196 245 | height: 245 246 | alignment: 7 247 | pivot: {x: 0.5, y: 0} 248 | border: {x: 0, y: 0, z: 0, w: 0} 249 | outline: [] 250 | physicsShape: [] 251 | tessellationDetail: 0 252 | bones: [] 253 | spriteID: 02305410000000000800000000000000 254 | internalID: 21300000 255 | vertices: [] 256 | indices: 257 | edges: [] 258 | weights: [] 259 | - serializedVersion: 2 260 | name: Slimedow_1 261 | rect: 262 | serializedVersion: 2 263 | x: 198 264 | y: 779 265 | width: 196 266 | height: 245 267 | alignment: 7 268 | pivot: {x: 0.5, y: 0} 269 | border: {x: 0, y: 0, z: 0, w: 0} 270 | outline: [] 271 | physicsShape: [] 272 | tessellationDetail: 0 273 | bones: [] 274 | spriteID: 22305410000000000800000000000000 275 | internalID: 21300002 276 | vertices: [] 277 | indices: 278 | edges: [] 279 | weights: [] 280 | - serializedVersion: 2 281 | name: Slimedow_2 282 | rect: 283 | serializedVersion: 2 284 | x: 396 285 | y: 779 286 | width: 196 287 | height: 245 288 | alignment: 7 289 | pivot: {x: 0.5, y: 0} 290 | border: {x: 0, y: 0, z: 0, w: 0} 291 | outline: [] 292 | physicsShape: [] 293 | tessellationDetail: 0 294 | bones: [] 295 | spriteID: 42305410000000000800000000000000 296 | internalID: 21300004 297 | vertices: [] 298 | indices: 299 | edges: [] 300 | weights: [] 301 | - serializedVersion: 2 302 | name: Slimedow_3 303 | rect: 304 | serializedVersion: 2 305 | x: 594 306 | y: 779 307 | width: 196 308 | height: 245 309 | alignment: 7 310 | pivot: {x: 0.5, y: 0} 311 | border: {x: 0, y: 0, z: 0, w: 0} 312 | outline: [] 313 | physicsShape: [] 314 | tessellationDetail: 0 315 | bones: [] 316 | spriteID: 62305410000000000800000000000000 317 | internalID: 21300006 318 | vertices: [] 319 | indices: 320 | edges: [] 321 | weights: [] 322 | - serializedVersion: 2 323 | name: Slimedow_4 324 | rect: 325 | serializedVersion: 2 326 | x: 792 327 | y: 779 328 | width: 196 329 | height: 245 330 | alignment: 7 331 | pivot: {x: 0.5, y: 0} 332 | border: {x: 0, y: 0, z: 0, w: 0} 333 | outline: [] 334 | physicsShape: [] 335 | tessellationDetail: 0 336 | bones: [] 337 | spriteID: 82305410000000000800000000000000 338 | internalID: 21300008 339 | vertices: [] 340 | indices: 341 | edges: [] 342 | weights: [] 343 | - serializedVersion: 2 344 | name: Slimedow_5 345 | rect: 346 | serializedVersion: 2 347 | x: 990 348 | y: 779 349 | width: 196 350 | height: 245 351 | alignment: 7 352 | pivot: {x: 0.5, y: 0} 353 | border: {x: 0, y: 0, z: 0, w: 0} 354 | outline: [] 355 | physicsShape: [] 356 | tessellationDetail: 0 357 | bones: [] 358 | spriteID: a2305410000000000800000000000000 359 | internalID: 21300010 360 | vertices: [] 361 | indices: 362 | edges: [] 363 | weights: [] 364 | - serializedVersion: 2 365 | name: Slimedow_6 366 | rect: 367 | serializedVersion: 2 368 | x: 1188 369 | y: 779 370 | width: 196 371 | height: 245 372 | alignment: 7 373 | pivot: {x: 0.5, y: 0} 374 | border: {x: 0, y: 0, z: 0, w: 0} 375 | outline: [] 376 | physicsShape: [] 377 | tessellationDetail: 0 378 | bones: [] 379 | spriteID: c2305410000000000800000000000000 380 | internalID: 21300012 381 | vertices: [] 382 | indices: 383 | edges: [] 384 | weights: [] 385 | - serializedVersion: 2 386 | name: Slimedow_7 387 | rect: 388 | serializedVersion: 2 389 | x: 1386 390 | y: 779 391 | width: 196 392 | height: 245 393 | alignment: 7 394 | pivot: {x: 0.5, y: 0} 395 | border: {x: 0, y: 0, z: 0, w: 0} 396 | outline: [] 397 | physicsShape: [] 398 | tessellationDetail: 0 399 | bones: [] 400 | spriteID: e2305410000000000800000000000000 401 | internalID: 21300014 402 | vertices: [] 403 | indices: 404 | edges: [] 405 | weights: [] 406 | - serializedVersion: 2 407 | name: Slimedow_8 408 | rect: 409 | serializedVersion: 2 410 | x: 1584 411 | y: 779 412 | width: 196 413 | height: 245 414 | alignment: 7 415 | pivot: {x: 0.5, y: 0} 416 | border: {x: 0, y: 0, z: 0, w: 0} 417 | outline: [] 418 | physicsShape: [] 419 | tessellationDetail: 0 420 | bones: [] 421 | spriteID: 03305410000000000800000000000000 422 | internalID: 21300016 423 | vertices: [] 424 | indices: 425 | edges: [] 426 | weights: [] 427 | - serializedVersion: 2 428 | name: Slimedow_9 429 | rect: 430 | serializedVersion: 2 431 | x: 1782 432 | y: 779 433 | width: 196 434 | height: 245 435 | alignment: 7 436 | pivot: {x: 0.5, y: 0} 437 | border: {x: 0, y: 0, z: 0, w: 0} 438 | outline: [] 439 | physicsShape: [] 440 | tessellationDetail: 0 441 | bones: [] 442 | spriteID: 23305410000000000800000000000000 443 | internalID: 21300018 444 | vertices: [] 445 | indices: 446 | edges: [] 447 | weights: [] 448 | - serializedVersion: 2 449 | name: Slimedow_10 450 | rect: 451 | serializedVersion: 2 452 | x: 0 453 | y: 532 454 | width: 196 455 | height: 245 456 | alignment: 7 457 | pivot: {x: 0.5, y: 0} 458 | border: {x: 0, y: 0, z: 0, w: 0} 459 | outline: [] 460 | physicsShape: [] 461 | tessellationDetail: 0 462 | bones: [] 463 | spriteID: 43305410000000000800000000000000 464 | internalID: 21300020 465 | vertices: [] 466 | indices: 467 | edges: [] 468 | weights: [] 469 | - serializedVersion: 2 470 | name: Slimedow_11 471 | rect: 472 | serializedVersion: 2 473 | x: 198 474 | y: 532 475 | width: 196 476 | height: 245 477 | alignment: 7 478 | pivot: {x: 0.5, y: 0} 479 | border: {x: 0, y: 0, z: 0, w: 0} 480 | outline: [] 481 | physicsShape: [] 482 | tessellationDetail: 0 483 | bones: [] 484 | spriteID: 63305410000000000800000000000000 485 | internalID: 21300022 486 | vertices: [] 487 | indices: 488 | edges: [] 489 | weights: [] 490 | - serializedVersion: 2 491 | name: Slimedow_12 492 | rect: 493 | serializedVersion: 2 494 | x: 396 495 | y: 532 496 | width: 196 497 | height: 245 498 | alignment: 7 499 | pivot: {x: 0.5, y: 0} 500 | border: {x: 0, y: 0, z: 0, w: 0} 501 | outline: [] 502 | physicsShape: [] 503 | tessellationDetail: 0 504 | bones: [] 505 | spriteID: 83305410000000000800000000000000 506 | internalID: 21300024 507 | vertices: [] 508 | indices: 509 | edges: [] 510 | weights: [] 511 | - serializedVersion: 2 512 | name: Slimedow_13 513 | rect: 514 | serializedVersion: 2 515 | x: 594 516 | y: 532 517 | width: 196 518 | height: 245 519 | alignment: 7 520 | pivot: {x: 0.5, y: 0} 521 | border: {x: 0, y: 0, z: 0, w: 0} 522 | outline: [] 523 | physicsShape: [] 524 | tessellationDetail: 0 525 | bones: [] 526 | spriteID: a3305410000000000800000000000000 527 | internalID: 21300026 528 | vertices: [] 529 | indices: 530 | edges: [] 531 | weights: [] 532 | - serializedVersion: 2 533 | name: Slimedow_14 534 | rect: 535 | serializedVersion: 2 536 | x: 792 537 | y: 532 538 | width: 196 539 | height: 245 540 | alignment: 7 541 | pivot: {x: 0.5, y: 0} 542 | border: {x: 0, y: 0, z: 0, w: 0} 543 | outline: [] 544 | physicsShape: [] 545 | tessellationDetail: 0 546 | bones: [] 547 | spriteID: c3305410000000000800000000000000 548 | internalID: 21300028 549 | vertices: [] 550 | indices: 551 | edges: [] 552 | weights: [] 553 | - serializedVersion: 2 554 | name: Slimedow_15 555 | rect: 556 | serializedVersion: 2 557 | x: 990 558 | y: 532 559 | width: 196 560 | height: 245 561 | alignment: 7 562 | pivot: {x: 0.5, y: 0} 563 | border: {x: 0, y: 0, z: 0, w: 0} 564 | outline: [] 565 | physicsShape: [] 566 | tessellationDetail: 0 567 | bones: [] 568 | spriteID: e3305410000000000800000000000000 569 | internalID: 21300030 570 | vertices: [] 571 | indices: 572 | edges: [] 573 | weights: [] 574 | - serializedVersion: 2 575 | name: Slimedow_16 576 | rect: 577 | serializedVersion: 2 578 | x: 1188 579 | y: 532 580 | width: 196 581 | height: 245 582 | alignment: 7 583 | pivot: {x: 0.5, y: 0} 584 | border: {x: 0, y: 0, z: 0, w: 0} 585 | outline: [] 586 | physicsShape: [] 587 | tessellationDetail: 0 588 | bones: [] 589 | spriteID: 04305410000000000800000000000000 590 | internalID: 21300032 591 | vertices: [] 592 | indices: 593 | edges: [] 594 | weights: [] 595 | - serializedVersion: 2 596 | name: Slimedow_17 597 | rect: 598 | serializedVersion: 2 599 | x: 1386 600 | y: 532 601 | width: 196 602 | height: 245 603 | alignment: 7 604 | pivot: {x: 0.5, y: 0} 605 | border: {x: 0, y: 0, z: 0, w: 0} 606 | outline: [] 607 | physicsShape: [] 608 | tessellationDetail: 0 609 | bones: [] 610 | spriteID: 24305410000000000800000000000000 611 | internalID: 21300034 612 | vertices: [] 613 | indices: 614 | edges: [] 615 | weights: [] 616 | - serializedVersion: 2 617 | name: Slimedow_18 618 | rect: 619 | serializedVersion: 2 620 | x: 1584 621 | y: 532 622 | width: 196 623 | height: 245 624 | alignment: 7 625 | pivot: {x: 0.5, y: 0} 626 | border: {x: 0, y: 0, z: 0, w: 0} 627 | outline: [] 628 | physicsShape: [] 629 | tessellationDetail: 0 630 | bones: [] 631 | spriteID: 44305410000000000800000000000000 632 | internalID: 21300036 633 | vertices: [] 634 | indices: 635 | edges: [] 636 | weights: [] 637 | - serializedVersion: 2 638 | name: Slimedow_19 639 | rect: 640 | serializedVersion: 2 641 | x: 1782 642 | y: 532 643 | width: 196 644 | height: 245 645 | alignment: 7 646 | pivot: {x: 0.5, y: 0} 647 | border: {x: 0, y: 0, z: 0, w: 0} 648 | outline: [] 649 | physicsShape: [] 650 | tessellationDetail: 0 651 | bones: [] 652 | spriteID: 64305410000000000800000000000000 653 | internalID: 21300038 654 | vertices: [] 655 | indices: 656 | edges: [] 657 | weights: [] 658 | - serializedVersion: 2 659 | name: Slimedow_20 660 | rect: 661 | serializedVersion: 2 662 | x: 0 663 | y: 285 664 | width: 196 665 | height: 245 666 | alignment: 7 667 | pivot: {x: 0.5, y: 0} 668 | border: {x: 0, y: 0, z: 0, w: 0} 669 | outline: [] 670 | physicsShape: [] 671 | tessellationDetail: 0 672 | bones: [] 673 | spriteID: 84305410000000000800000000000000 674 | internalID: 21300040 675 | vertices: [] 676 | indices: 677 | edges: [] 678 | weights: [] 679 | - serializedVersion: 2 680 | name: Slimedow_21 681 | rect: 682 | serializedVersion: 2 683 | x: 198 684 | y: 285 685 | width: 196 686 | height: 245 687 | alignment: 7 688 | pivot: {x: 0.5, y: 0} 689 | border: {x: 0, y: 0, z: 0, w: 0} 690 | outline: [] 691 | physicsShape: [] 692 | tessellationDetail: 0 693 | bones: [] 694 | spriteID: a4305410000000000800000000000000 695 | internalID: 21300042 696 | vertices: [] 697 | indices: 698 | edges: [] 699 | weights: [] 700 | - serializedVersion: 2 701 | name: Slimedow_22 702 | rect: 703 | serializedVersion: 2 704 | x: 396 705 | y: 285 706 | width: 196 707 | height: 245 708 | alignment: 7 709 | pivot: {x: 0.5, y: 0} 710 | border: {x: 0, y: 0, z: 0, w: 0} 711 | outline: [] 712 | physicsShape: [] 713 | tessellationDetail: 0 714 | bones: [] 715 | spriteID: c4305410000000000800000000000000 716 | internalID: 21300044 717 | vertices: [] 718 | indices: 719 | edges: [] 720 | weights: [] 721 | - serializedVersion: 2 722 | name: Slimedow_23 723 | rect: 724 | serializedVersion: 2 725 | x: 594 726 | y: 285 727 | width: 196 728 | height: 245 729 | alignment: 7 730 | pivot: {x: 0.5, y: 0} 731 | border: {x: 0, y: 0, z: 0, w: 0} 732 | outline: [] 733 | physicsShape: [] 734 | tessellationDetail: 0 735 | bones: [] 736 | spriteID: e4305410000000000800000000000000 737 | internalID: 21300046 738 | vertices: [] 739 | indices: 740 | edges: [] 741 | weights: [] 742 | - serializedVersion: 2 743 | name: Slimedow_24 744 | rect: 745 | serializedVersion: 2 746 | x: 792 747 | y: 285 748 | width: 196 749 | height: 245 750 | alignment: 7 751 | pivot: {x: 0.5, y: 0} 752 | border: {x: 0, y: 0, z: 0, w: 0} 753 | outline: [] 754 | physicsShape: [] 755 | tessellationDetail: 0 756 | bones: [] 757 | spriteID: 05305410000000000800000000000000 758 | internalID: 21300048 759 | vertices: [] 760 | indices: 761 | edges: [] 762 | weights: [] 763 | - serializedVersion: 2 764 | name: Slimedow_25 765 | rect: 766 | serializedVersion: 2 767 | x: 990 768 | y: 285 769 | width: 196 770 | height: 245 771 | alignment: 7 772 | pivot: {x: 0.5, y: 0} 773 | border: {x: 0, y: 0, z: 0, w: 0} 774 | outline: [] 775 | physicsShape: [] 776 | tessellationDetail: 0 777 | bones: [] 778 | spriteID: 25305410000000000800000000000000 779 | internalID: 21300050 780 | vertices: [] 781 | indices: 782 | edges: [] 783 | weights: [] 784 | - serializedVersion: 2 785 | name: Slimedow_26 786 | rect: 787 | serializedVersion: 2 788 | x: 1188 789 | y: 285 790 | width: 196 791 | height: 245 792 | alignment: 7 793 | pivot: {x: 0.5, y: 0} 794 | border: {x: 0, y: 0, z: 0, w: 0} 795 | outline: [] 796 | physicsShape: [] 797 | tessellationDetail: 0 798 | bones: [] 799 | spriteID: 45305410000000000800000000000000 800 | internalID: 21300052 801 | vertices: [] 802 | indices: 803 | edges: [] 804 | weights: [] 805 | - serializedVersion: 2 806 | name: Slimedow_27 807 | rect: 808 | serializedVersion: 2 809 | x: 1386 810 | y: 285 811 | width: 196 812 | height: 245 813 | alignment: 7 814 | pivot: {x: 0.5, y: 0} 815 | border: {x: 0, y: 0, z: 0, w: 0} 816 | outline: [] 817 | physicsShape: [] 818 | tessellationDetail: 0 819 | bones: [] 820 | spriteID: 65305410000000000800000000000000 821 | internalID: 21300054 822 | vertices: [] 823 | indices: 824 | edges: [] 825 | weights: [] 826 | - serializedVersion: 2 827 | name: Slimedow_28 828 | rect: 829 | serializedVersion: 2 830 | x: 1584 831 | y: 285 832 | width: 196 833 | height: 245 834 | alignment: 7 835 | pivot: {x: 0.5, y: 0} 836 | border: {x: 0, y: 0, z: 0, w: 0} 837 | outline: [] 838 | physicsShape: [] 839 | tessellationDetail: 0 840 | bones: [] 841 | spriteID: 85305410000000000800000000000000 842 | internalID: 21300056 843 | vertices: [] 844 | indices: 845 | edges: [] 846 | weights: [] 847 | - serializedVersion: 2 848 | name: Slimedow_29 849 | rect: 850 | serializedVersion: 2 851 | x: 1782 852 | y: 285 853 | width: 196 854 | height: 245 855 | alignment: 7 856 | pivot: {x: 0.5, y: 0} 857 | border: {x: 0, y: 0, z: 0, w: 0} 858 | outline: [] 859 | physicsShape: [] 860 | tessellationDetail: 0 861 | bones: [] 862 | spriteID: a5305410000000000800000000000000 863 | internalID: 21300058 864 | vertices: [] 865 | indices: 866 | edges: [] 867 | weights: [] 868 | - serializedVersion: 2 869 | name: Slimedow_30 870 | rect: 871 | serializedVersion: 2 872 | x: 0 873 | y: 38 874 | width: 196 875 | height: 245 876 | alignment: 7 877 | pivot: {x: 0.5, y: 0} 878 | border: {x: 0, y: 0, z: 0, w: 0} 879 | outline: [] 880 | physicsShape: [] 881 | tessellationDetail: 0 882 | bones: [] 883 | spriteID: c5305410000000000800000000000000 884 | internalID: 21300060 885 | vertices: [] 886 | indices: 887 | edges: [] 888 | weights: [] 889 | - serializedVersion: 2 890 | name: Slimedow_31 891 | rect: 892 | serializedVersion: 2 893 | x: 198 894 | y: 38 895 | width: 196 896 | height: 245 897 | alignment: 7 898 | pivot: {x: 0.5, y: 0} 899 | border: {x: 0, y: 0, z: 0, w: 0} 900 | outline: [] 901 | physicsShape: [] 902 | tessellationDetail: 0 903 | bones: [] 904 | spriteID: e5305410000000000800000000000000 905 | internalID: 21300062 906 | vertices: [] 907 | indices: 908 | edges: [] 909 | weights: [] 910 | - serializedVersion: 2 911 | name: Slimedow_32 912 | rect: 913 | serializedVersion: 2 914 | x: 396 915 | y: 38 916 | width: 196 917 | height: 245 918 | alignment: 7 919 | pivot: {x: 0.5, y: 0} 920 | border: {x: 0, y: 0, z: 0, w: 0} 921 | outline: [] 922 | physicsShape: [] 923 | tessellationDetail: 0 924 | bones: [] 925 | spriteID: 06305410000000000800000000000000 926 | internalID: 21300064 927 | vertices: [] 928 | indices: 929 | edges: [] 930 | weights: [] 931 | - serializedVersion: 2 932 | name: Slimedow_33 933 | rect: 934 | serializedVersion: 2 935 | x: 594 936 | y: 38 937 | width: 196 938 | height: 245 939 | alignment: 7 940 | pivot: {x: 0.5, y: 0} 941 | border: {x: 0, y: 0, z: 0, w: 0} 942 | outline: [] 943 | physicsShape: [] 944 | tessellationDetail: 0 945 | bones: [] 946 | spriteID: 26305410000000000800000000000000 947 | internalID: 21300066 948 | vertices: [] 949 | indices: 950 | edges: [] 951 | weights: [] 952 | - serializedVersion: 2 953 | name: Slimedow_34 954 | rect: 955 | serializedVersion: 2 956 | x: 792 957 | y: 38 958 | width: 196 959 | height: 245 960 | alignment: 7 961 | pivot: {x: 0.5, y: 0} 962 | border: {x: 0, y: 0, z: 0, w: 0} 963 | outline: [] 964 | physicsShape: [] 965 | tessellationDetail: 0 966 | bones: [] 967 | spriteID: 46305410000000000800000000000000 968 | internalID: 21300068 969 | vertices: [] 970 | indices: 971 | edges: [] 972 | weights: [] 973 | outline: [] 974 | physicsShape: [] 975 | bones: [] 976 | spriteID: 977 | internalID: 0 978 | vertices: [] 979 | indices: 980 | edges: [] 981 | weights: [] 982 | secondaryTextures: [] 983 | nameFileIdTable: 984 | Slimedow_4: 21300008 985 | Slimedow_18: 21300036 986 | Slimedow_3: 21300006 987 | Slimedow_6: 21300012 988 | Slimedow_7: 21300014 989 | Slimedow_26: 21300052 990 | Slimedow_22: 21300044 991 | Slimedow_28: 21300056 992 | Slimedow_1: 21300002 993 | Slimedow_13: 21300026 994 | Slimedow_24: 21300048 995 | Slimedow_30: 21300060 996 | Slimedow_2: 21300004 997 | Slimedow_29: 21300058 998 | Slimedow_16: 21300032 999 | Slimedow_31: 21300062 1000 | Slimedow_14: 21300028 1001 | Slimedow_20: 21300040 1002 | Slimedow_34: 21300068 1003 | Slimedow_23: 21300046 1004 | Slimedow_27: 21300054 1005 | Slimedow_10: 21300020 1006 | Slimedow_21: 21300042 1007 | Slimedow_5: 21300010 1008 | Slimedow_33: 21300066 1009 | Slimedow_11: 21300022 1010 | Slimedow_32: 21300064 1011 | Slimedow_17: 21300034 1012 | Slimedow_25: 21300050 1013 | Slimedow_0: 21300000 1014 | Slimedow_9: 21300018 1015 | Slimedow_8: 21300016 1016 | Slimedow_19: 21300038 1017 | Slimedow_15: 21300030 1018 | Slimedow_12: 21300024 1019 | spritePackingTag: 1020 | pSDRemoveMatte: 0 1021 | pSDShowRemoveMatteOption: 0 1022 | userData: 1023 | assetBundleName: 1024 | assetBundleVariant: 1025 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0817dbf7f25264be0a46803b0f393a7d 3 | folderAsset: yes 4 | timeCreated: 1498331875 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d844b51e205d8a54f9893a180517d51a 3 | folderAsset: yes 4 | timeCreated: 1498403321 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienClimb.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 13 | m_Name: AlienClimb 14 | m_EditorClassIdentifier: 15 | fps: 9 16 | totalDuration: 0 17 | frames: [] 18 | actions: [] 19 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienClimb.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 617a3bda84df4ab49beaa8dcfa63193a 3 | timeCreated: 1498403367 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienDuck.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 13 | m_Name: AlienDuck 14 | m_EditorClassIdentifier: 15 | fps: 9 16 | totalDuration: 1 17 | frames: 18 | - {fileID: 21300002, guid: fc69b1cc68641924398c626474a656a0, type: 3} 19 | framesDuration: 01000000 20 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienDuck.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3835c5565cd36ce4290eab3da97013d7 3 | timeCreated: 1498403341 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienJump.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 13 | m_Name: AlienJump 14 | m_EditorClassIdentifier: 15 | fps: 9 16 | totalDuration: 0 17 | frames: [] 18 | actions: [] 19 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienJump.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20479c392912bfb438312c49b7edc452 3 | timeCreated: 1498403387 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienStand.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 13 | m_Name: AlienStand 14 | m_EditorClassIdentifier: 15 | fps: 9 16 | totalDuration: 0 17 | frames: [] 18 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienStand.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8dd233e8c3a3264bb363ec2f466b642 3 | timeCreated: 1498403376 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienSwim.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 12 | m_Name: AlienSwim 13 | m_EditorClassIdentifier: 14 | fps: 9 15 | totalDuration: 2 16 | frames: 17 | - {fileID: 21300014, guid: fc69b1cc68641924398c626474a656a0, type: 3} 18 | - {fileID: 21300016, guid: fc69b1cc68641924398c626474a656a0, type: 3} 19 | framesDuration: 0100000001000000 20 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienSwim.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1cbe0019b8fa0a4ea47618d87483fcf 3 | timeCreated: 1498403382 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienWalk.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: d77f76fefc0e73d4184cf86fd1488e0f, type: 3} 12 | m_Name: AlienWalk 13 | m_EditorClassIdentifier: 14 | fps: 9 15 | totalDuration: 2 16 | frames: 17 | - {fileID: 21300018, guid: fc69b1cc68641924398c626474a656a0, type: 3} 18 | - {fileID: 21300020, guid: fc69b1cc68641924398c626474a656a0, type: 3} 19 | framesDuration: 0100000001000000 20 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Animations/AlienWalk.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecbd6c84fcf3b1446aeb37cac0c73fdc 3 | timeCreated: 1498403353 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56173bedf57b64b12a235924308ab04e 3 | folderAsset: yes 4 | timeCreated: 1498331941 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scenes/PlatformerExample.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 7 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SkyboxMaterial: {fileID: 0} 29 | m_HaloStrength: 0.5 30 | m_FlareStrength: 1 31 | m_FlareFadeSpeed: 3 32 | m_HaloTexture: {fileID: 0} 33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 34 | m_DefaultReflectionMode: 0 35 | m_DefaultReflectionResolution: 128 36 | m_ReflectionBounces: 1 37 | m_ReflectionIntensity: 1 38 | m_CustomReflection: {fileID: 0} 39 | m_Sun: {fileID: 0} 40 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 41 | --- !u!157 &3 42 | LightmapSettings: 43 | m_ObjectHideFlags: 0 44 | serializedVersion: 7 45 | m_GIWorkflowMode: 1 46 | m_GISettings: 47 | serializedVersion: 2 48 | m_BounceScale: 1 49 | m_IndirectOutputScale: 1 50 | m_AlbedoBoost: 1 51 | m_TemporalCoherenceThreshold: 1 52 | m_EnvironmentLightingMode: 0 53 | m_EnableBakedLightmaps: 0 54 | m_EnableRealtimeLightmaps: 0 55 | m_LightmapEditorSettings: 56 | serializedVersion: 4 57 | m_Resolution: 2 58 | m_BakeResolution: 40 59 | m_TextureWidth: 1024 60 | m_TextureHeight: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_DirectLightInLightProbes: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_LightingDataAsset: {fileID: 0} 75 | m_RuntimeCPUUsage: 25 76 | --- !u!196 &4 77 | NavMeshSettings: 78 | serializedVersion: 2 79 | m_ObjectHideFlags: 0 80 | m_BuildSettings: 81 | serializedVersion: 2 82 | agentTypeID: 0 83 | agentRadius: 0.5 84 | agentHeight: 2 85 | agentSlope: 45 86 | agentClimb: 0.4 87 | ledgeDropHeight: 0 88 | maxJumpAcrossDistance: 0 89 | minRegionArea: 2 90 | manualCellSize: 0 91 | cellSize: 0.16666667 92 | accuratePlacement: 0 93 | m_NavMeshData: {fileID: 0} 94 | --- !u!1 &161104408 95 | GameObject: 96 | m_ObjectHideFlags: 0 97 | m_PrefabParentObject: {fileID: 0} 98 | m_PrefabInternal: {fileID: 0} 99 | serializedVersion: 5 100 | m_Component: 101 | - component: {fileID: 161104414} 102 | - component: {fileID: 161104413} 103 | - component: {fileID: 161104411} 104 | - component: {fileID: 161104412} 105 | - component: {fileID: 161104410} 106 | - component: {fileID: 161104409} 107 | m_Layer: 0 108 | m_Name: Player 109 | m_TagString: Untagged 110 | m_Icon: {fileID: 0} 111 | m_NavMeshLayer: 0 112 | m_StaticEditorFlags: 0 113 | m_IsActive: 1 114 | --- !u!58 &161104409 115 | CircleCollider2D: 116 | m_ObjectHideFlags: 0 117 | m_PrefabParentObject: {fileID: 0} 118 | m_PrefabInternal: {fileID: 0} 119 | m_GameObject: {fileID: 161104408} 120 | m_Enabled: 1 121 | m_Density: 1 122 | m_Material: {fileID: 0} 123 | m_IsTrigger: 0 124 | m_UsedByEffector: 0 125 | m_Offset: {x: 0, y: 0} 126 | serializedVersion: 2 127 | m_Radius: 0.46 128 | --- !u!50 &161104410 129 | Rigidbody2D: 130 | serializedVersion: 4 131 | m_ObjectHideFlags: 0 132 | m_PrefabParentObject: {fileID: 0} 133 | m_PrefabInternal: {fileID: 0} 134 | m_GameObject: {fileID: 161104408} 135 | m_BodyType: 0 136 | m_Simulated: 1 137 | m_UseFullKinematicContacts: 0 138 | m_UseAutoMass: 0 139 | m_Mass: 1 140 | m_LinearDrag: 5 141 | m_AngularDrag: 0.05 142 | m_GravityScale: 2 143 | m_Material: {fileID: 0} 144 | m_Interpolate: 0 145 | m_SleepingMode: 1 146 | m_CollisionDetection: 0 147 | m_Constraints: 4 148 | --- !u!114 &161104411 149 | MonoBehaviour: 150 | m_ObjectHideFlags: 0 151 | m_PrefabParentObject: {fileID: 0} 152 | m_PrefabInternal: {fileID: 0} 153 | m_GameObject: {fileID: 161104408} 154 | m_Enabled: 1 155 | m_EditorHideFlags: 0 156 | m_Script: {fileID: 11500000, guid: 13a111613b7e1c6498923b16a649bc4f, type: 3} 157 | m_Name: 158 | m_EditorClassIdentifier: 159 | animations: 160 | - {fileID: 11400000, guid: 617a3bda84df4ab49beaa8dcfa63193a, type: 2} 161 | - {fileID: 11400000, guid: 3835c5565cd36ce4290eab3da97013d7, type: 2} 162 | - {fileID: 11400000, guid: 20479c392912bfb438312c49b7edc452, type: 2} 163 | - {fileID: 11400000, guid: b8dd233e8c3a3264bb363ec2f466b642, type: 2} 164 | - {fileID: 11400000, guid: d1cbe0019b8fa0a4ea47618d87483fcf, type: 2} 165 | - {fileID: 11400000, guid: ecbd6c84fcf3b1446aeb37cac0c73fdc, type: 2} 166 | onFinish: 167 | m_PersistentCalls: 168 | m_Calls: [] 169 | m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, 170 | PublicKeyToken=null 171 | onStop: 172 | m_PersistentCalls: 173 | m_Calls: [] 174 | m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, 175 | PublicKeyToken=null 176 | onPlay: 177 | m_PersistentCalls: 178 | m_Calls: [] 179 | m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, 180 | PublicKeyToken=null 181 | playOnAwake: 1 182 | ignoreTimeScale: 0 183 | delayBetweenLoops: 0 184 | oneShot: 0 185 | backwards: 0 186 | randomAnimation: 0 187 | disableRendererOnFinish: 0 188 | startAtRandomFrame: 0 189 | minDelayBetweenLoops: 0 190 | maxDelayBetweenLoops: 2 191 | startAnimation: AlienStand 192 | loopType: 0 193 | fallbackAnimation: {fileID: 0} 194 | fallbackLoopType: 0 195 | --- !u!212 &161104412 196 | SpriteRenderer: 197 | m_ObjectHideFlags: 0 198 | m_PrefabParentObject: {fileID: 0} 199 | m_PrefabInternal: {fileID: 0} 200 | m_GameObject: {fileID: 161104408} 201 | m_Enabled: 1 202 | m_CastShadows: 0 203 | m_ReceiveShadows: 0 204 | m_MotionVectors: 1 205 | m_LightProbeUsage: 0 206 | m_ReflectionProbeUsage: 0 207 | m_Materials: 208 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 209 | m_StaticBatchInfo: 210 | firstSubMesh: 0 211 | subMeshCount: 0 212 | m_StaticBatchRoot: {fileID: 0} 213 | m_ProbeAnchor: {fileID: 0} 214 | m_LightProbeVolumeOverride: {fileID: 0} 215 | m_ScaleInLightmap: 1 216 | m_PreserveUVs: 0 217 | m_IgnoreNormalsForChartDetection: 0 218 | m_ImportantGI: 0 219 | m_SelectedEditorRenderState: 0 220 | m_MinimumChartSize: 4 221 | m_AutoUVMaxDistance: 0.5 222 | m_AutoUVMaxAngle: 89 223 | m_LightmapParameters: {fileID: 0} 224 | m_SortingLayerID: 0 225 | m_SortingOrder: 0 226 | m_Sprite: {fileID: 21300022, guid: fc69b1cc68641924398c626474a656a0, type: 3} 227 | m_Color: {r: 1, g: 1, b: 1, a: 1} 228 | m_FlipX: 0 229 | m_FlipY: 0 230 | --- !u!114 &161104413 231 | MonoBehaviour: 232 | m_ObjectHideFlags: 0 233 | m_PrefabParentObject: {fileID: 0} 234 | m_PrefabInternal: {fileID: 0} 235 | m_GameObject: {fileID: 161104408} 236 | m_Enabled: 1 237 | m_EditorHideFlags: 0 238 | m_Script: {fileID: 11500000, guid: 5e69b812ab4954e68b6d2b26e7970fa6, type: 3} 239 | m_Name: 240 | m_EditorClassIdentifier: 241 | duckAnimation: AlienDuck 242 | standAnimation: AlienStand 243 | jumpAnimation: AlienJump 244 | walkAnimation: AlienWalk 245 | --- !u!4 &161104414 246 | Transform: 247 | m_ObjectHideFlags: 0 248 | m_PrefabParentObject: {fileID: 0} 249 | m_PrefabInternal: {fileID: 0} 250 | m_GameObject: {fileID: 161104408} 251 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 252 | m_LocalPosition: {x: -1.9806626, y: 0.5453687, z: 0} 253 | m_LocalScale: {x: 1, y: 1, z: 1} 254 | m_Children: 255 | - {fileID: 397942885} 256 | m_Father: {fileID: 0} 257 | m_RootOrder: 0 258 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 259 | --- !u!1 &397942880 260 | GameObject: 261 | m_ObjectHideFlags: 0 262 | m_PrefabParentObject: {fileID: 0} 263 | m_PrefabInternal: {fileID: 0} 264 | serializedVersion: 5 265 | m_Component: 266 | - component: {fileID: 397942885} 267 | - component: {fileID: 397942884} 268 | - component: {fileID: 397942883} 269 | - component: {fileID: 397942882} 270 | - component: {fileID: 397942881} 271 | m_Layer: 0 272 | m_Name: Main Camera 273 | m_TagString: MainCamera 274 | m_Icon: {fileID: 0} 275 | m_NavMeshLayer: 0 276 | m_StaticEditorFlags: 0 277 | m_IsActive: 1 278 | --- !u!81 &397942881 279 | AudioListener: 280 | m_ObjectHideFlags: 0 281 | m_PrefabParentObject: {fileID: 0} 282 | m_PrefabInternal: {fileID: 0} 283 | m_GameObject: {fileID: 397942880} 284 | m_Enabled: 1 285 | --- !u!124 &397942882 286 | Behaviour: 287 | m_ObjectHideFlags: 0 288 | m_PrefabParentObject: {fileID: 0} 289 | m_PrefabInternal: {fileID: 0} 290 | m_GameObject: {fileID: 397942880} 291 | m_Enabled: 1 292 | --- !u!92 &397942883 293 | Behaviour: 294 | m_ObjectHideFlags: 0 295 | m_PrefabParentObject: {fileID: 0} 296 | m_PrefabInternal: {fileID: 0} 297 | m_GameObject: {fileID: 397942880} 298 | m_Enabled: 1 299 | --- !u!20 &397942884 300 | Camera: 301 | m_ObjectHideFlags: 0 302 | m_PrefabParentObject: {fileID: 0} 303 | m_PrefabInternal: {fileID: 0} 304 | m_GameObject: {fileID: 397942880} 305 | m_Enabled: 1 306 | serializedVersion: 2 307 | m_ClearFlags: 1 308 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 309 | m_NormalizedViewPortRect: 310 | serializedVersion: 2 311 | x: 0 312 | y: 0 313 | width: 1 314 | height: 1 315 | near clip plane: 0.3 316 | far clip plane: 1000 317 | field of view: 60 318 | orthographic: 1 319 | orthographic size: 3 320 | m_Depth: -1 321 | m_CullingMask: 322 | serializedVersion: 2 323 | m_Bits: 4294967295 324 | m_RenderingPath: -1 325 | m_TargetTexture: {fileID: 0} 326 | m_TargetDisplay: 0 327 | m_TargetEye: 3 328 | m_HDR: 1 329 | m_OcclusionCulling: 1 330 | m_StereoConvergence: 10 331 | m_StereoSeparation: 0.022 332 | m_StereoMirrorMode: 0 333 | --- !u!4 &397942885 334 | Transform: 335 | m_ObjectHideFlags: 0 336 | m_PrefabParentObject: {fileID: 0} 337 | m_PrefabInternal: {fileID: 0} 338 | m_GameObject: {fileID: 397942880} 339 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 340 | m_LocalPosition: {x: 0, y: 1, z: -10} 341 | m_LocalScale: {x: 1, y: 1, z: 1} 342 | m_Children: [] 343 | m_Father: {fileID: 161104414} 344 | m_RootOrder: 0 345 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 346 | --- !u!1 &835551267 347 | GameObject: 348 | m_ObjectHideFlags: 0 349 | m_PrefabParentObject: {fileID: 0} 350 | m_PrefabInternal: {fileID: 0} 351 | serializedVersion: 5 352 | m_Component: 353 | - component: {fileID: 835551268} 354 | - component: {fileID: 835551270} 355 | - component: {fileID: 835551269} 356 | m_Layer: 0 357 | m_Name: Obstacle 358 | m_TagString: Untagged 359 | m_Icon: {fileID: 0} 360 | m_NavMeshLayer: 0 361 | m_StaticEditorFlags: 0 362 | m_IsActive: 1 363 | --- !u!4 &835551268 364 | Transform: 365 | m_ObjectHideFlags: 0 366 | m_PrefabParentObject: {fileID: 0} 367 | m_PrefabInternal: {fileID: 0} 368 | m_GameObject: {fileID: 835551267} 369 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 370 | m_LocalPosition: {x: 3, y: 0, z: 0} 371 | m_LocalScale: {x: 2, y: 1, z: 1} 372 | m_Children: [] 373 | m_Father: {fileID: 1870263536} 374 | m_RootOrder: 3 375 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 376 | --- !u!61 &835551269 377 | BoxCollider2D: 378 | m_ObjectHideFlags: 0 379 | m_PrefabParentObject: {fileID: 0} 380 | m_PrefabInternal: {fileID: 0} 381 | m_GameObject: {fileID: 835551267} 382 | m_Enabled: 1 383 | m_Density: 1 384 | m_Material: {fileID: 0} 385 | m_IsTrigger: 0 386 | m_UsedByEffector: 0 387 | m_Offset: {x: 0, y: 0} 388 | serializedVersion: 2 389 | m_Size: {x: 1, y: 1} 390 | --- !u!212 &835551270 391 | SpriteRenderer: 392 | m_ObjectHideFlags: 0 393 | m_PrefabParentObject: {fileID: 0} 394 | m_PrefabInternal: {fileID: 0} 395 | m_GameObject: {fileID: 835551267} 396 | m_Enabled: 1 397 | m_CastShadows: 0 398 | m_ReceiveShadows: 0 399 | m_MotionVectors: 1 400 | m_LightProbeUsage: 0 401 | m_ReflectionProbeUsage: 0 402 | m_Materials: 403 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 404 | m_StaticBatchInfo: 405 | firstSubMesh: 0 406 | subMeshCount: 0 407 | m_StaticBatchRoot: {fileID: 0} 408 | m_ProbeAnchor: {fileID: 0} 409 | m_LightProbeVolumeOverride: {fileID: 0} 410 | m_ScaleInLightmap: 1 411 | m_PreserveUVs: 0 412 | m_IgnoreNormalsForChartDetection: 0 413 | m_ImportantGI: 0 414 | m_SelectedEditorRenderState: 0 415 | m_MinimumChartSize: 4 416 | m_AutoUVMaxDistance: 0.5 417 | m_AutoUVMaxAngle: 89 418 | m_LightmapParameters: {fileID: 0} 419 | m_SortingLayerID: 0 420 | m_SortingOrder: 0 421 | m_Sprite: {fileID: 21300000, guid: b49add3299d2f8a4e8230a7381570120, type: 3} 422 | m_Color: {r: 1, g: 1, b: 1, a: 1} 423 | m_FlipX: 0 424 | m_FlipY: 0 425 | --- !u!1 &1047782632 426 | GameObject: 427 | m_ObjectHideFlags: 0 428 | m_PrefabParentObject: {fileID: 0} 429 | m_PrefabInternal: {fileID: 0} 430 | serializedVersion: 5 431 | m_Component: 432 | - component: {fileID: 1047782633} 433 | - component: {fileID: 1047782635} 434 | - component: {fileID: 1047782634} 435 | m_Layer: 0 436 | m_Name: Wall 437 | m_TagString: Untagged 438 | m_Icon: {fileID: 0} 439 | m_NavMeshLayer: 0 440 | m_StaticEditorFlags: 0 441 | m_IsActive: 1 442 | --- !u!4 &1047782633 443 | Transform: 444 | m_ObjectHideFlags: 0 445 | m_PrefabParentObject: {fileID: 0} 446 | m_PrefabInternal: {fileID: 0} 447 | m_GameObject: {fileID: 1047782632} 448 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 449 | m_LocalPosition: {x: -8.5, y: 1, z: 0} 450 | m_LocalScale: {x: 1, y: 5, z: 1} 451 | m_Children: [] 452 | m_Father: {fileID: 1870263536} 453 | m_RootOrder: 2 454 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 455 | --- !u!61 &1047782634 456 | BoxCollider2D: 457 | m_ObjectHideFlags: 0 458 | m_PrefabParentObject: {fileID: 0} 459 | m_PrefabInternal: {fileID: 0} 460 | m_GameObject: {fileID: 1047782632} 461 | m_Enabled: 1 462 | m_Density: 1 463 | m_Material: {fileID: 0} 464 | m_IsTrigger: 0 465 | m_UsedByEffector: 0 466 | m_Offset: {x: 0, y: 0} 467 | serializedVersion: 2 468 | m_Size: {x: 1, y: 1} 469 | --- !u!212 &1047782635 470 | SpriteRenderer: 471 | m_ObjectHideFlags: 0 472 | m_PrefabParentObject: {fileID: 0} 473 | m_PrefabInternal: {fileID: 0} 474 | m_GameObject: {fileID: 1047782632} 475 | m_Enabled: 1 476 | m_CastShadows: 0 477 | m_ReceiveShadows: 0 478 | m_MotionVectors: 1 479 | m_LightProbeUsage: 0 480 | m_ReflectionProbeUsage: 0 481 | m_Materials: 482 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 483 | m_StaticBatchInfo: 484 | firstSubMesh: 0 485 | subMeshCount: 0 486 | m_StaticBatchRoot: {fileID: 0} 487 | m_ProbeAnchor: {fileID: 0} 488 | m_LightProbeVolumeOverride: {fileID: 0} 489 | m_ScaleInLightmap: 1 490 | m_PreserveUVs: 0 491 | m_IgnoreNormalsForChartDetection: 0 492 | m_ImportantGI: 0 493 | m_SelectedEditorRenderState: 0 494 | m_MinimumChartSize: 4 495 | m_AutoUVMaxDistance: 0.5 496 | m_AutoUVMaxAngle: 89 497 | m_LightmapParameters: {fileID: 0} 498 | m_SortingLayerID: 0 499 | m_SortingOrder: 0 500 | m_Sprite: {fileID: 21300000, guid: b49add3299d2f8a4e8230a7381570120, type: 3} 501 | m_Color: {r: 1, g: 1, b: 1, a: 1} 502 | m_FlipX: 0 503 | m_FlipY: 0 504 | --- !u!1 &1410010146 505 | GameObject: 506 | m_ObjectHideFlags: 0 507 | m_PrefabParentObject: {fileID: 0} 508 | m_PrefabInternal: {fileID: 0} 509 | serializedVersion: 5 510 | m_Component: 511 | - component: {fileID: 1410010147} 512 | - component: {fileID: 1410010149} 513 | - component: {fileID: 1410010148} 514 | m_Layer: 0 515 | m_Name: Floor 516 | m_TagString: Untagged 517 | m_Icon: {fileID: 0} 518 | m_NavMeshLayer: 0 519 | m_StaticEditorFlags: 0 520 | m_IsActive: 1 521 | --- !u!4 &1410010147 522 | Transform: 523 | m_ObjectHideFlags: 0 524 | m_PrefabParentObject: {fileID: 0} 525 | m_PrefabInternal: {fileID: 0} 526 | m_GameObject: {fileID: 1410010146} 527 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 528 | m_LocalPosition: {x: 0, y: -1, z: 0} 529 | m_LocalScale: {x: 16, y: 1, z: 1} 530 | m_Children: [] 531 | m_Father: {fileID: 1870263536} 532 | m_RootOrder: 0 533 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 534 | --- !u!61 &1410010148 535 | BoxCollider2D: 536 | m_ObjectHideFlags: 0 537 | m_PrefabParentObject: {fileID: 0} 538 | m_PrefabInternal: {fileID: 0} 539 | m_GameObject: {fileID: 1410010146} 540 | m_Enabled: 1 541 | m_Density: 1 542 | m_Material: {fileID: 0} 543 | m_IsTrigger: 0 544 | m_UsedByEffector: 0 545 | m_Offset: {x: 0, y: 0} 546 | serializedVersion: 2 547 | m_Size: {x: 1, y: 1} 548 | --- !u!212 &1410010149 549 | SpriteRenderer: 550 | m_ObjectHideFlags: 0 551 | m_PrefabParentObject: {fileID: 0} 552 | m_PrefabInternal: {fileID: 0} 553 | m_GameObject: {fileID: 1410010146} 554 | m_Enabled: 1 555 | m_CastShadows: 0 556 | m_ReceiveShadows: 0 557 | m_MotionVectors: 1 558 | m_LightProbeUsage: 0 559 | m_ReflectionProbeUsage: 0 560 | m_Materials: 561 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 562 | m_StaticBatchInfo: 563 | firstSubMesh: 0 564 | subMeshCount: 0 565 | m_StaticBatchRoot: {fileID: 0} 566 | m_ProbeAnchor: {fileID: 0} 567 | m_LightProbeVolumeOverride: {fileID: 0} 568 | m_ScaleInLightmap: 1 569 | m_PreserveUVs: 0 570 | m_IgnoreNormalsForChartDetection: 0 571 | m_ImportantGI: 0 572 | m_SelectedEditorRenderState: 0 573 | m_MinimumChartSize: 4 574 | m_AutoUVMaxDistance: 0.5 575 | m_AutoUVMaxAngle: 89 576 | m_LightmapParameters: {fileID: 0} 577 | m_SortingLayerID: 0 578 | m_SortingOrder: 0 579 | m_Sprite: {fileID: 21300000, guid: b49add3299d2f8a4e8230a7381570120, type: 3} 580 | m_Color: {r: 1, g: 1, b: 1, a: 1} 581 | m_FlipX: 0 582 | m_FlipY: 0 583 | --- !u!1 &1870263535 584 | GameObject: 585 | m_ObjectHideFlags: 0 586 | m_PrefabParentObject: {fileID: 0} 587 | m_PrefabInternal: {fileID: 0} 588 | serializedVersion: 5 589 | m_Component: 590 | - component: {fileID: 1870263536} 591 | m_Layer: 0 592 | m_Name: Stage 593 | m_TagString: Untagged 594 | m_Icon: {fileID: 0} 595 | m_NavMeshLayer: 0 596 | m_StaticEditorFlags: 0 597 | m_IsActive: 1 598 | --- !u!4 &1870263536 599 | Transform: 600 | m_ObjectHideFlags: 0 601 | m_PrefabParentObject: {fileID: 0} 602 | m_PrefabInternal: {fileID: 0} 603 | m_GameObject: {fileID: 1870263535} 604 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 605 | m_LocalPosition: {x: 0, y: 0, z: 0} 606 | m_LocalScale: {x: 1, y: 1, z: 1} 607 | m_Children: 608 | - {fileID: 1410010147} 609 | - {fileID: 1962229984} 610 | - {fileID: 1047782633} 611 | - {fileID: 835551268} 612 | m_Father: {fileID: 0} 613 | m_RootOrder: 1 614 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 615 | --- !u!1 &1962229983 616 | GameObject: 617 | m_ObjectHideFlags: 0 618 | m_PrefabParentObject: {fileID: 0} 619 | m_PrefabInternal: {fileID: 0} 620 | serializedVersion: 5 621 | m_Component: 622 | - component: {fileID: 1962229984} 623 | - component: {fileID: 1962229986} 624 | - component: {fileID: 1962229985} 625 | m_Layer: 0 626 | m_Name: Wall 627 | m_TagString: Untagged 628 | m_Icon: {fileID: 0} 629 | m_NavMeshLayer: 0 630 | m_StaticEditorFlags: 0 631 | m_IsActive: 1 632 | --- !u!4 &1962229984 633 | Transform: 634 | m_ObjectHideFlags: 0 635 | m_PrefabParentObject: {fileID: 0} 636 | m_PrefabInternal: {fileID: 0} 637 | m_GameObject: {fileID: 1962229983} 638 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 639 | m_LocalPosition: {x: 8.5, y: 1, z: 0} 640 | m_LocalScale: {x: 1, y: 5, z: 1} 641 | m_Children: [] 642 | m_Father: {fileID: 1870263536} 643 | m_RootOrder: 1 644 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 645 | --- !u!61 &1962229985 646 | BoxCollider2D: 647 | m_ObjectHideFlags: 0 648 | m_PrefabParentObject: {fileID: 0} 649 | m_PrefabInternal: {fileID: 0} 650 | m_GameObject: {fileID: 1962229983} 651 | m_Enabled: 1 652 | m_Density: 1 653 | m_Material: {fileID: 0} 654 | m_IsTrigger: 0 655 | m_UsedByEffector: 0 656 | m_Offset: {x: 0, y: 0} 657 | serializedVersion: 2 658 | m_Size: {x: 1, y: 1} 659 | --- !u!212 &1962229986 660 | SpriteRenderer: 661 | m_ObjectHideFlags: 0 662 | m_PrefabParentObject: {fileID: 0} 663 | m_PrefabInternal: {fileID: 0} 664 | m_GameObject: {fileID: 1962229983} 665 | m_Enabled: 1 666 | m_CastShadows: 0 667 | m_ReceiveShadows: 0 668 | m_MotionVectors: 1 669 | m_LightProbeUsage: 0 670 | m_ReflectionProbeUsage: 0 671 | m_Materials: 672 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 673 | m_StaticBatchInfo: 674 | firstSubMesh: 0 675 | subMeshCount: 0 676 | m_StaticBatchRoot: {fileID: 0} 677 | m_ProbeAnchor: {fileID: 0} 678 | m_LightProbeVolumeOverride: {fileID: 0} 679 | m_ScaleInLightmap: 1 680 | m_PreserveUVs: 0 681 | m_IgnoreNormalsForChartDetection: 0 682 | m_ImportantGI: 0 683 | m_SelectedEditorRenderState: 0 684 | m_MinimumChartSize: 4 685 | m_AutoUVMaxDistance: 0.5 686 | m_AutoUVMaxAngle: 89 687 | m_LightmapParameters: {fileID: 0} 688 | m_SortingLayerID: 0 689 | m_SortingOrder: 0 690 | m_Sprite: {fileID: 21300000, guid: b49add3299d2f8a4e8230a7381570120, type: 3} 691 | m_Color: {r: 1, g: 1, b: 1, a: 1} 692 | m_FlipX: 0 693 | m_FlipY: 0 694 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scenes/PlatformerExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dd0ff0ac4554443f80e692d7700537b 3 | timeCreated: 1498331898 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4289ab43f172412b8aaa62f84b25e07 3 | folderAsset: yes 4 | timeCreated: 1498331947 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scripts/PlayerPlatformer.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | 6 | namespace Elendow.SpritedowAnimator.Examples 7 | { 8 | public class PlayerPlatformer : MonoBehaviour 9 | { 10 | public SpriteAnimation duckAnimation; 11 | public SpriteAnimation standAnimation; 12 | public SpriteAnimation walkAnimation; 13 | 14 | private Rigidbody2D rigidBody; 15 | 16 | public SpriteAnimation jumpAnimation; 17 | private SpriteAnimator spriteAnimator; 18 | 19 | private void Awake() 20 | { 21 | spriteAnimator = GetComponent(); 22 | spriteAnimator.AddCustomEvent(jumpAnimation, 5).AddListener(JumpEvent); 23 | } 24 | 25 | private void JumpEvent(BaseAnimator animator) 26 | { 27 | // Do something 28 | } 29 | 30 | private void Update() 31 | { 32 | if(Input.GetKey(KeyCode.LeftArrow)) 33 | { 34 | rigidBody.AddForce(Vector2.left * 50); 35 | spriteAnimator.FlipSpriteX(true); 36 | } 37 | else if (Input.GetKey(KeyCode.RightArrow)) 38 | { 39 | rigidBody.AddForce(Vector2.right * 50); 40 | spriteAnimator.FlipSpriteX(false); 41 | } 42 | else if(Input.GetKey(KeyCode.DownArrow) && rigidBody.velocity.y == 0) 43 | { 44 | spriteAnimator.Play(duckAnimation); 45 | } 46 | else 47 | { 48 | spriteAnimator.Play(standAnimation); 49 | } 50 | 51 | if (Input.GetKeyDown(KeyCode.Space)) 52 | { 53 | rigidBody.AddForce(Vector2.up * 500); 54 | } 55 | 56 | if (!spriteAnimator.PlayingAnimation.Equals(duckAnimation)) 57 | { 58 | if (rigidBody.velocity.y != 0) 59 | { 60 | spriteAnimator.Play(jumpAnimation); 61 | } 62 | else if (rigidBody.velocity.x != 0) 63 | { 64 | spriteAnimator.Play(walkAnimation); 65 | } 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Scripts/PlayerPlatformer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e69b812ab4954e68b6d2b26e7970fa6 3 | timeCreated: 1498331976 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f109e0e892d78e4988d14405886eba7 3 | folderAsset: yes 4 | timeCreated: 1498402693 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/Square.png -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/Square.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b49add3299d2f8a4e8230a7381570120 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 0 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 3 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 4 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 1 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: 4 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 1 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: 80 | - - {x: -2, y: -2} 81 | - {x: -2, y: 2} 82 | - {x: 2, y: 2} 83 | - {x: 2, y: -2} 84 | physicsShape: [] 85 | bones: [] 86 | spriteID: 5e97eb03825dee720800000000000000 87 | internalID: 0 88 | vertices: [] 89 | indices: 90 | edges: [] 91 | weights: [] 92 | secondaryTextures: [] 93 | spritePackingTag: 94 | pSDRemoveMatte: 0 95 | pSDShowRemoveMatteOption: 0 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/alienBeige.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/alienBeige.png -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Examples/PlatformerExample/Sprites/alienBeige.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc69b1cc68641924398c626474a656a0 3 | TextureImporter: 4 | internalIDToNameTable: 5 | - first: 6 | 213: 21300000 7 | second: alienBeige_climb1 8 | - first: 9 | 213: 21300002 10 | second: alienBeige_duck 11 | - first: 12 | 213: 21300004 13 | second: alienBeige_2 14 | - first: 15 | 213: 21300006 16 | second: alienBeige_climb2 17 | - first: 18 | 213: 21300008 19 | second: alienBeige_hurt 20 | - first: 21 | 213: 21300010 22 | second: alienBeige_jump 23 | - first: 24 | 213: 21300012 25 | second: alienBeige_stand 26 | - first: 27 | 213: 21300014 28 | second: alienBeige_swim1 29 | - first: 30 | 213: 21300016 31 | second: alienBeige_swim2 32 | - first: 33 | 213: 21300018 34 | second: alienBeige_walk1 35 | - first: 36 | 213: 21300020 37 | second: alienBeige_walk2 38 | - first: 39 | 213: 21300022 40 | second: alienBeige_idle 41 | externalObjects: {} 42 | serializedVersion: 11 43 | mipmaps: 44 | mipMapMode: 0 45 | enableMipMap: 0 46 | sRGBTexture: 1 47 | linearTexture: 0 48 | fadeOut: 0 49 | borderMipMap: 0 50 | mipMapsPreserveCoverage: 0 51 | alphaTestReferenceValue: 0.5 52 | mipMapFadeDistanceStart: 1 53 | mipMapFadeDistanceEnd: 3 54 | bumpmap: 55 | convertToNormalMap: 0 56 | externalNormalMap: 0 57 | heightScale: 0.25 58 | normalMapFilter: 0 59 | isReadable: 0 60 | streamingMipmaps: 0 61 | streamingMipmapsPriority: 0 62 | vTOnly: 0 63 | ignoreMasterTextureLimit: 0 64 | grayScaleToAlpha: 0 65 | generateCubemap: 6 66 | cubemapConvolution: 0 67 | seamlessCubemap: 0 68 | textureFormat: 1 69 | maxTextureSize: 2048 70 | textureSettings: 71 | serializedVersion: 2 72 | filterMode: 1 73 | aniso: 1 74 | mipBias: 0 75 | wrapU: 1 76 | wrapV: 1 77 | wrapW: 1 78 | nPOTScale: 0 79 | lightmap: 0 80 | compressionQuality: 50 81 | spriteMode: 2 82 | spriteExtrude: 1 83 | spriteMeshType: 1 84 | alignment: 7 85 | spritePivot: {x: 0.5, y: 0} 86 | spritePixelsToUnits: 100 87 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 88 | spriteGenerateFallbackPhysicsShape: 1 89 | alphaUsage: 1 90 | alphaIsTransparency: 1 91 | spriteTessellationDetail: -1 92 | textureType: 8 93 | textureShape: 1 94 | singleChannelComponent: 0 95 | flipbookRows: 1 96 | flipbookColumns: 1 97 | maxTextureSizeSet: 0 98 | compressionQualitySet: 0 99 | textureFormatSet: 0 100 | ignorePngGamma: 0 101 | applyGammaDecoding: 1 102 | platformSettings: 103 | - serializedVersion: 3 104 | buildTarget: DefaultTexturePlatform 105 | maxTextureSize: 2048 106 | resizeAlgorithm: 0 107 | textureFormat: -1 108 | textureCompression: 1 109 | compressionQuality: 50 110 | crunchedCompression: 0 111 | allowsAlphaSplitting: 0 112 | overridden: 0 113 | androidETC2FallbackOverride: 0 114 | forceMaximumCompressionQuality_BC6H_BC7: 1 115 | - serializedVersion: 3 116 | buildTarget: Standalone 117 | maxTextureSize: 2048 118 | resizeAlgorithm: 0 119 | textureFormat: -1 120 | textureCompression: 1 121 | compressionQuality: 50 122 | crunchedCompression: 0 123 | allowsAlphaSplitting: 0 124 | overridden: 0 125 | androidETC2FallbackOverride: 0 126 | forceMaximumCompressionQuality_BC6H_BC7: 1 127 | spriteSheet: 128 | serializedVersion: 2 129 | sprites: 130 | - serializedVersion: 2 131 | name: alienBeige_climb1 132 | rect: 133 | serializedVersion: 2 134 | x: 70 135 | y: 417 136 | width: 66 137 | height: 95 138 | alignment: 7 139 | pivot: {x: 0.5, y: 0} 140 | border: {x: 0, y: 0, z: 0, w: 0} 141 | outline: [] 142 | physicsShape: [] 143 | tessellationDetail: 0 144 | bones: [] 145 | spriteID: 02305410000000000800000000000000 146 | internalID: 21300000 147 | vertices: [] 148 | indices: 149 | edges: [] 150 | weights: [] 151 | - serializedVersion: 2 152 | name: alienBeige_duck 153 | rect: 154 | serializedVersion: 2 155 | x: 67 156 | y: 53 157 | width: 67 158 | height: 72 159 | alignment: 0 160 | pivot: {x: 0.5, y: 0.5} 161 | border: {x: 0, y: 0, z: 0, w: 0} 162 | outline: [] 163 | physicsShape: [] 164 | tessellationDetail: 0 165 | bones: [] 166 | spriteID: 22305410000000000800000000000000 167 | internalID: 21300002 168 | vertices: [] 169 | indices: 170 | edges: [] 171 | weights: [] 172 | - serializedVersion: 2 173 | name: alienBeige_climb2 174 | rect: 175 | serializedVersion: 2 176 | x: 134 177 | y: 128 178 | width: 66 179 | height: 95 180 | alignment: 7 181 | pivot: {x: 0.5, y: 0} 182 | border: {x: 0, y: 0, z: 0, w: 0} 183 | outline: [] 184 | physicsShape: [] 185 | tessellationDetail: 0 186 | bones: [] 187 | spriteID: 62305410000000000800000000000000 188 | internalID: 21300006 189 | vertices: [] 190 | indices: 191 | edges: [] 192 | weights: [] 193 | - serializedVersion: 2 194 | name: alienBeige_hurt 195 | rect: 196 | serializedVersion: 2 197 | x: 0 198 | y: 33 199 | width: 61 200 | height: 92 201 | alignment: 0 202 | pivot: {x: 0.5, y: 0.5} 203 | border: {x: 0, y: 0, z: 0, w: 0} 204 | outline: [] 205 | physicsShape: [] 206 | tessellationDetail: 0 207 | bones: [] 208 | spriteID: 82305410000000000800000000000000 209 | internalID: 21300008 210 | vertices: [] 211 | indices: 212 | edges: [] 213 | weights: [] 214 | - serializedVersion: 2 215 | name: alienBeige_jump 216 | rect: 217 | serializedVersion: 2 218 | x: 69 219 | y: 223 220 | width: 66 221 | height: 93 222 | alignment: 0 223 | pivot: {x: 0.5, y: 0.5} 224 | border: {x: 0, y: 0, z: 0, w: 0} 225 | outline: [] 226 | physicsShape: [] 227 | tessellationDetail: 0 228 | bones: [] 229 | spriteID: a2305410000000000800000000000000 230 | internalID: 21300010 231 | vertices: [] 232 | indices: 233 | edges: [] 234 | weights: [] 235 | - serializedVersion: 2 236 | name: alienBeige_stand 237 | rect: 238 | serializedVersion: 2 239 | x: 68 240 | y: 126 241 | width: 66 242 | height: 92 243 | alignment: 0 244 | pivot: {x: 0.5, y: 0.5} 245 | border: {x: 0, y: 0, z: 0, w: 0} 246 | outline: [] 247 | physicsShape: [] 248 | tessellationDetail: 0 249 | bones: [] 250 | spriteID: c2305410000000000800000000000000 251 | internalID: 21300012 252 | vertices: [] 253 | indices: 254 | edges: [] 255 | weights: [] 256 | - serializedVersion: 2 257 | name: alienBeige_swim1 258 | rect: 259 | serializedVersion: 2 260 | x: 0 261 | y: 218 262 | width: 69 263 | height: 98 264 | alignment: 0 265 | pivot: {x: 0.5, y: 0.5} 266 | border: {x: 0, y: 0, z: 0, w: 0} 267 | outline: [] 268 | physicsShape: [] 269 | tessellationDetail: 0 270 | bones: [] 271 | spriteID: e2305410000000000800000000000000 272 | internalID: 21300014 273 | vertices: [] 274 | indices: 275 | edges: [] 276 | weights: [] 277 | - serializedVersion: 2 278 | name: alienBeige_swim2 279 | rect: 280 | serializedVersion: 2 281 | x: 0 282 | y: 412 283 | width: 70 284 | height: 100 285 | alignment: 0 286 | pivot: {x: 0.5, y: 0.5} 287 | border: {x: 0, y: 0, z: 0, w: 0} 288 | outline: [] 289 | physicsShape: [] 290 | tessellationDetail: 0 291 | bones: [] 292 | spriteID: 03305410000000000800000000000000 293 | internalID: 21300016 294 | vertices: [] 295 | indices: 296 | edges: [] 297 | weights: [] 298 | - serializedVersion: 2 299 | name: alienBeige_walk1 300 | rect: 301 | serializedVersion: 2 302 | x: 0 303 | y: 125 304 | width: 68 305 | height: 93 306 | alignment: 0 307 | pivot: {x: 0.5, y: 0.5} 308 | border: {x: 0, y: 0, z: 0, w: 0} 309 | outline: [] 310 | physicsShape: [] 311 | tessellationDetail: 0 312 | bones: [] 313 | spriteID: 23305410000000000800000000000000 314 | internalID: 21300018 315 | vertices: [] 316 | indices: 317 | edges: [] 318 | weights: [] 319 | - serializedVersion: 2 320 | name: alienBeige_walk2 321 | rect: 322 | serializedVersion: 2 323 | x: 0 324 | y: 316 325 | width: 70 326 | height: 96 327 | alignment: 0 328 | pivot: {x: 0.5, y: 0.5} 329 | border: {x: 0, y: 0, z: 0, w: 0} 330 | outline: [] 331 | physicsShape: [] 332 | tessellationDetail: 0 333 | bones: [] 334 | spriteID: 43305410000000000800000000000000 335 | internalID: 21300020 336 | vertices: [] 337 | indices: 338 | edges: [] 339 | weights: [] 340 | - serializedVersion: 2 341 | name: alienBeige_idle 342 | rect: 343 | serializedVersion: 2 344 | x: 70 345 | y: 325 346 | width: 66 347 | height: 92 348 | alignment: 0 349 | pivot: {x: 0.5, y: 0.5} 350 | border: {x: 0, y: 0, z: 0, w: 0} 351 | outline: [] 352 | physicsShape: [] 353 | tessellationDetail: 0 354 | bones: [] 355 | spriteID: 63305410000000000800000000000000 356 | internalID: 21300022 357 | vertices: [] 358 | indices: 359 | edges: [] 360 | weights: [] 361 | outline: [] 362 | physicsShape: [] 363 | bones: [] 364 | spriteID: 365 | internalID: 0 366 | vertices: [] 367 | indices: 368 | edges: [] 369 | weights: [] 370 | secondaryTextures: [] 371 | nameFileIdTable: 372 | alienBeige_walk1: 21300018 373 | alienBeige_climb2: 21300006 374 | alienBeige_stand: 21300012 375 | alienBeige_jump: 21300010 376 | alienBeige_swim1: 21300014 377 | alienBeige_duck: 21300002 378 | alienBeige_hurt: 21300008 379 | alienBeige_walk2: 21300020 380 | alienBeige_idle: 21300022 381 | alienBeige_climb1: 21300000 382 | alienBeige_swim2: 21300016 383 | spritePackingTag: 384 | pSDRemoveMatte: 0 385 | pSDShowRemoveMatteOption: 0 386 | userData: 387 | assetBundleName: 388 | assetBundleVariant: 389 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/Assets/SpritedowAnimator/Readme.pdf -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Readme.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2703fe2353cc03349a0bbbcc9405600e 3 | timeCreated: 1547758958 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97f86d44bd14d074faf6807862aae78c 3 | folderAsset: yes 4 | timeCreated: 1488398440 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/BaseAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d7d095033f13e24981ee08cb8b833a8 3 | timeCreated: 1481150128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f987959787b80dd48a47aed66fd0eec3 3 | folderAsset: yes 4 | timeCreated: 1481150126 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorBaseAnimator.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | [CustomEditor(typeof(BaseAnimator))] 10 | public class EditorBaseAnimator : Editor 11 | { 12 | private bool init; 13 | 14 | private SerializedProperty playOnAwake; 15 | private SerializedProperty ignoreTimeScale; 16 | private SerializedProperty delayBetweenLoops; 17 | private SerializedProperty minDelayBetweenLoops; 18 | private SerializedProperty maxDelayBetweenLoops; 19 | private SerializedProperty oneShot; 20 | private SerializedProperty backwards; 21 | private SerializedProperty randomAnimation; 22 | private SerializedProperty disableRendererOnFinish; 23 | private SerializedProperty startAtRandomFrame; 24 | private SerializedProperty loopType; 25 | private SerializedProperty fallbackAnimation; 26 | private SerializedProperty fallbackLoopType; 27 | private SerializedProperty enableRenderOnPlay; 28 | private SerializedProperty startAnimation; 29 | private SerializedProperty randomAnimationList; 30 | 31 | private GUIContent emptyContent; 32 | 33 | /// Initialize again on enable. 34 | private void OnEnable() 35 | { 36 | init = false; 37 | } 38 | 39 | /// Initializes the inspector. 40 | private void Init(BaseAnimator targetAnimator) 41 | { 42 | init = true; 43 | 44 | playOnAwake = serializedObject.FindProperty("playOnAwake"); 45 | ignoreTimeScale = serializedObject.FindProperty("ignoreTimeScale"); 46 | delayBetweenLoops = serializedObject.FindProperty("delayBetweenLoops"); 47 | minDelayBetweenLoops = serializedObject.FindProperty("minDelayBetweenLoops"); 48 | maxDelayBetweenLoops = serializedObject.FindProperty("maxDelayBetweenLoops"); 49 | oneShot = serializedObject.FindProperty("oneShot"); 50 | backwards = serializedObject.FindProperty("backwards"); 51 | randomAnimation = serializedObject.FindProperty("randomAnimation"); 52 | disableRendererOnFinish = serializedObject.FindProperty("disableRendererOnFinish"); 53 | startAtRandomFrame = serializedObject.FindProperty("startAtRandomFrame"); 54 | loopType = serializedObject.FindProperty("loopType"); 55 | fallbackLoopType = serializedObject.FindProperty("fallbackLoopType"); 56 | enableRenderOnPlay = serializedObject.FindProperty("enableRenderOnPlay"); 57 | startAnimation = serializedObject.FindProperty("startAnimation"); 58 | randomAnimationList = serializedObject.FindProperty("randomAnimationList"); 59 | fallbackAnimation = serializedObject.FindProperty("fallbackAnimation"); 60 | 61 | emptyContent = new GUIContent(""); 62 | } 63 | 64 | /// Draws a common inspector. 65 | protected void DrawInspector(BaseAnimator targetAnimator) 66 | { 67 | if (!init) 68 | Init(targetAnimator); 69 | 70 | EditorGUILayout.Space(); 71 | 72 | EditorGUILayout.BeginVertical(EditorStyles.helpBox); 73 | { 74 | EditorGUILayout.Space(); 75 | DrawField("Ignore time scale", ignoreTimeScale); 76 | DrawField("Enable render on play", enableRenderOnPlay); 77 | DrawField("Disable render on finish", disableRendererOnFinish); 78 | EditorGUILayout.Space(); 79 | } 80 | EditorGUILayout.EndVertical(); 81 | 82 | EditorGUILayout.Space(); 83 | 84 | EditorGUILayout.BeginVertical(EditorStyles.helpBox); 85 | { 86 | EditorGUILayout.Space(); 87 | DrawField("Play on awake", playOnAwake); 88 | if (playOnAwake.boolValue) 89 | { 90 | EditorGUI.indentLevel++; 91 | DrawField("Start at random frame", startAtRandomFrame); 92 | DrawField("Backwards", backwards); 93 | DrawField("Random animation", randomAnimation); 94 | if (!randomAnimation.boolValue) 95 | { 96 | DrawField("Animation", startAnimation); 97 | } 98 | 99 | EditorGUILayout.Space(); 100 | 101 | DrawField("One shot", oneShot); 102 | if (!oneShot.boolValue) 103 | { 104 | EditorGUI.indentLevel++; 105 | EditorGUILayout.PropertyField(loopType); 106 | delayBetweenLoops.boolValue = EditorGUILayout.BeginToggleGroup("Delay", delayBetweenLoops.boolValue); 107 | { 108 | EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); 109 | EditorGUIUtility.labelWidth = 65; 110 | EditorGUILayout.PropertyField(minDelayBetweenLoops, new GUIContent("Min")); 111 | EditorGUILayout.PropertyField(maxDelayBetweenLoops, new GUIContent("Max")); 112 | EditorGUIUtility.labelWidth = 0; 113 | EditorGUILayout.EndHorizontal(); 114 | } 115 | EditorGUILayout.EndToggleGroup(); 116 | 117 | if (minDelayBetweenLoops.floatValue < 0) 118 | minDelayBetweenLoops.floatValue = 0; 119 | 120 | if (maxDelayBetweenLoops.floatValue < minDelayBetweenLoops.floatValue) 121 | maxDelayBetweenLoops.floatValue = minDelayBetweenLoops.floatValue; 122 | 123 | EditorGUI.indentLevel--; 124 | } 125 | EditorGUI.indentLevel--; 126 | } 127 | EditorGUILayout.Space(); 128 | } 129 | EditorGUILayout.EndVertical(); 130 | 131 | EditorGUILayout.Space(); 132 | 133 | EditorGUILayout.BeginVertical(EditorStyles.helpBox); 134 | { 135 | EditorGUILayout.Space(); 136 | 137 | EditorGUI.indentLevel++; 138 | EditorGUILayout.PropertyField( 139 | randomAnimationList, 140 | new GUIContent("Random Animation List"), 141 | GUILayout.ExpandWidth(true)); 142 | EditorGUI.indentLevel--; 143 | 144 | EditorGUILayout.Space(); 145 | DrawField("Fallback animation", fallbackAnimation); 146 | if (fallbackAnimation.objectReferenceValue != null) 147 | { 148 | EditorGUI.indentLevel++; 149 | DrawField("Loop type", fallbackLoopType); 150 | EditorGUI.indentLevel--; 151 | } 152 | EditorGUILayout.Space(); 153 | } 154 | EditorGUILayout.EndVertical(); 155 | 156 | EditorGUILayout.Space(); 157 | 158 | if (GUI.changed) 159 | { 160 | serializedObject.ApplyModifiedProperties(); 161 | EditorUtility.SetDirty(targetAnimator); 162 | } 163 | } 164 | 165 | /// Draws a single field. 166 | private void DrawField(string label, SerializedProperty property) 167 | { 168 | EditorGUILayout.BeginHorizontal(); 169 | EditorGUILayout.LabelField(label); 170 | GUILayout.FlexibleSpace(); 171 | EditorGUILayout.PropertyField(property, emptyContent); 172 | EditorGUILayout.EndHorizontal(); 173 | } 174 | } 175 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorBaseAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10e58eb4839c4114fa1bea3b6ea8a48c 3 | timeCreated: 1481150127 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimation.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEditor; 5 | using UnityEngine; 6 | using UnityEditorInternal; 7 | using System.Collections.Generic; 8 | 9 | namespace Elendow.SpritedowAnimator 10 | { 11 | /// Editor class to show the animation preview. 12 | [CustomEditor(typeof(SpriteAnimation))] 13 | public class EditorSpriteAnimation : Editor 14 | { 15 | private const float PANNING_SPEED = 0.5f; 16 | private const string FPS_EDITOR_PREFS = "spritedowFPSpreviewWindow"; 17 | 18 | private bool init = false; 19 | private bool enabled = false; 20 | private bool isPlaying = false; 21 | private bool forceRepaint = false; 22 | private bool loop = true; 23 | private bool isPanning = false; 24 | private bool saveToDisk = false; 25 | private int currentFrame = 0; 26 | private int loadedFPS = 30; 27 | private int framesPerSecond = 30; 28 | private int frameDurationCounter = 0; 29 | private int frameListSelectedIndex = -1; 30 | private float animationTimer = 0; 31 | private float lastFrameEditorTime = 0; 32 | private float deltaTime; 33 | private Vector2 scrollWindowPosition; 34 | private SpriteAnimation animation = null; 35 | private ReorderableList frameList; 36 | private List frames; 37 | private List actions; 38 | 39 | // Styles 40 | private GUIStyle previewButtonSettings; 41 | private GUIStyle preSlider; 42 | private GUIStyle preSliderThumb; 43 | private GUIStyle preLabel; 44 | private GUIContent speedScale; 45 | private GUIContent playButtonContent; 46 | private GUIContent pauseButtonContent; 47 | private GUIContent loopIcon; 48 | private GUIContent loopIconActive; 49 | 50 | private GameObject go; 51 | private GameObject cameraGO; 52 | private Camera pc; 53 | private SpriteRenderer sr; 54 | 55 | #if !UNITY_5 56 | private Material linearMaterial; 57 | private Material defaultMaterial; 58 | #endif 59 | 60 | private void OnEnable() 61 | { 62 | if (!enabled) 63 | { 64 | enabled = true; 65 | 66 | if (target == null) 67 | { 68 | return; 69 | } 70 | 71 | if (animation == null) 72 | { 73 | animation = (SpriteAnimation)target; 74 | animation.Setup(); 75 | } 76 | 77 | EditorApplication.update += Update; 78 | 79 | // Load last used settings 80 | loadedFPS = framesPerSecond = EditorPrefs.GetInt(FPS_EDITOR_PREFS, 30); 81 | 82 | // Setup preview object and camera 83 | go = EditorUtility.CreateGameObjectWithHideFlags("previewGO", HideFlags.HideAndDontSave, typeof(SpriteRenderer)); 84 | cameraGO = EditorUtility.CreateGameObjectWithHideFlags("cameraGO", HideFlags.HideAndDontSave, typeof(Camera)); 85 | sr = go.GetComponent(); 86 | pc = cameraGO.GetComponent(); 87 | 88 | #if !UNITY_5 89 | // Colorspace correction is only needed after Unity 5 for some reasons 90 | linearMaterial = Resources.Load("Spritedow"); 91 | defaultMaterial = sr.sharedMaterial; 92 | if (PlayerSettings.colorSpace == ColorSpace.Linear) 93 | { 94 | sr.sharedMaterial = linearMaterial; 95 | } 96 | else 97 | { 98 | sr.sharedMaterial = defaultMaterial; 99 | } 100 | #endif 101 | 102 | // Set camera 103 | pc.cameraType = CameraType.Preview; 104 | pc.clearFlags = CameraClearFlags.Depth; 105 | pc.backgroundColor = Color.clear; 106 | pc.orthographic = true; 107 | pc.orthographicSize = 3; 108 | pc.nearClipPlane = -10; 109 | pc.farClipPlane = 10; 110 | pc.targetDisplay = -1; 111 | pc.depth = -999; 112 | 113 | // Set renderer 114 | if (animation != null && animation.FramesCount > 0) 115 | { 116 | sr.sprite = animation.Frames[0].Sprite; 117 | cameraGO.transform.position = Vector2.zero; 118 | } 119 | 120 | // Get preview culling layer in order to render only the preview object and nothing more 121 | pc.cullingMask = -2147483648; 122 | go.layer = 0x1f; 123 | 124 | // Also, disable the object to prevent render on scene/game views 125 | go.SetActive(false); 126 | } 127 | } 128 | 129 | private void OnDisable() 130 | { 131 | if (enabled) 132 | { 133 | enabled = false; 134 | EditorApplication.update -= Update; 135 | 136 | if (frameList != null) 137 | { 138 | frameList.drawHeaderCallback -= DrawFrameListHeader; 139 | frameList.drawElementCallback -= DrawFrameListElement; 140 | frameList.onAddCallback -= AddFrameListItem; 141 | frameList.onRemoveCallback -= RemoveFrameListItem; 142 | frameList.onSelectCallback -= SelectFrameListItem; 143 | frameList.onReorderCallback -= ReorderFrameListItem; 144 | } 145 | 146 | if (go != null) 147 | { 148 | DestroyImmediate(go); 149 | } 150 | 151 | if (cameraGO != null) 152 | { 153 | DestroyImmediate(cameraGO); 154 | } 155 | } 156 | } 157 | 158 | private void Update() 159 | { 160 | #if !UNITY_5 161 | if (sr != null) 162 | { 163 | if (PlayerSettings.colorSpace == ColorSpace.Linear) 164 | { 165 | sr.sharedMaterial = linearMaterial; 166 | } 167 | else 168 | { 169 | sr.sharedMaterial = defaultMaterial; 170 | } 171 | } 172 | #endif 173 | 174 | // Calculate deltaTime 175 | float timeSinceStartup = (float)EditorApplication.timeSinceStartup; 176 | deltaTime = timeSinceStartup - lastFrameEditorTime; 177 | lastFrameEditorTime = timeSinceStartup; 178 | 179 | if (animation == null) 180 | { 181 | return; 182 | } 183 | 184 | if (frameList == null || SpriteEditorHelper.CheckListOutOfSync(frames, actions, animation)) 185 | { 186 | InitializeReorderableList(); 187 | } 188 | 189 | // Check animation bounds 190 | if (currentFrame < 0) 191 | { 192 | currentFrame = 0; 193 | } 194 | else if (currentFrame > animation.FramesCount) 195 | { 196 | currentFrame = animation.FramesCount - 1; 197 | } 198 | 199 | // Check if playing and use the editor time to change frames 200 | if (isPlaying) 201 | { 202 | animationTimer += deltaTime; 203 | float timePerFrame = 1f / framesPerSecond; 204 | if (timePerFrame < animationTimer) 205 | { 206 | frameDurationCounter++; 207 | animationTimer -= timePerFrame; 208 | if (frameDurationCounter >= animation.Frames[currentFrame].Duration) 209 | { 210 | // Change frame and repaint the preview 211 | currentFrame++; 212 | if (currentFrame >= animation.FramesCount) 213 | { 214 | currentFrame = 0; 215 | 216 | if (!loop) 217 | { 218 | isPlaying = false; 219 | } 220 | } 221 | 222 | frameDurationCounter = 0; 223 | Repaint(); 224 | forceRepaint = true; 225 | } 226 | } 227 | } 228 | 229 | // Save preview FPS value on the editorPrefs 230 | if (framesPerSecond != loadedFPS) 231 | { 232 | loadedFPS = framesPerSecond; 233 | EditorPrefs.SetInt(FPS_EDITOR_PREFS, framesPerSecond); 234 | } 235 | } 236 | 237 | public override void OnInspectorGUI() 238 | { 239 | saveToDisk = false; 240 | 241 | FPSDrawer(); 242 | 243 | Buttons(); 244 | 245 | if (frameList != null) 246 | { 247 | scrollWindowPosition = EditorGUILayout.BeginScrollView(scrollWindowPosition); 248 | 249 | // Individual frames 250 | frameList.displayRemove = (animation.FramesCount > 0); 251 | frameList.DoLayoutList(); 252 | EditorGUILayout.Space(); 253 | 254 | EditorGUILayout.EndScrollView(); 255 | } 256 | 257 | Buttons(); 258 | 259 | if (GUI.changed || saveToDisk) 260 | { 261 | animation.Setup(); 262 | serializedObject.ApplyModifiedProperties(); 263 | EditorUtility.SetDirty(animation); 264 | if(saveToDisk) 265 | { 266 | AssetDatabase.SaveAssets(); 267 | } 268 | } 269 | } 270 | 271 | public override void OnInteractivePreviewGUI(Rect r, GUIStyle background) 272 | { 273 | if (currentFrame >= 0 && 274 | animation != null && 275 | animation.FramesCount > 0 && 276 | currentFrame < animation.FramesCount) 277 | { 278 | // Draw Camera 279 | sr.sprite = animation.Frames[currentFrame].Sprite; 280 | go.SetActive(true); 281 | Handles.DrawCamera(r, pc); 282 | go.SetActive(false); 283 | 284 | // Check Events 285 | Event evt = Event.current; 286 | 287 | // Zoom preview window with scrollwheel 288 | if (evt.type == EventType.ScrollWheel) 289 | { 290 | Vector2 mpos = Event.current.mousePosition; 291 | if (mpos.x >= r.x && mpos.x <= r.x + r.width && 292 | mpos.y >= r.y && mpos.y <= r.y + r.height) 293 | { 294 | Zoom = -evt.delta.y; 295 | } 296 | forceRepaint = true; 297 | Repaint(); 298 | } 299 | // Stop panning on mouse up 300 | else if (evt.type == EventType.MouseUp) 301 | { 302 | isPanning = false; 303 | } 304 | // Pan the camera with mouse drag 305 | else if (evt.type == EventType.MouseDrag) 306 | { 307 | Vector2 mpos = Event.current.mousePosition; 308 | if ((mpos.x >= r.x && mpos.x <= r.x + r.width && 309 | mpos.y >= r.y && mpos.y <= r.y + r.height) || 310 | isPanning) 311 | { 312 | Vector2 panning = Vector2.zero; 313 | panning.x -= Event.current.delta.x; 314 | panning.y += Event.current.delta.y; 315 | cameraGO.transform.Translate(panning * PANNING_SPEED * deltaTime); 316 | forceRepaint = true; 317 | isPanning = true; 318 | Repaint(); 319 | } 320 | } 321 | // Reset camera pressing F 322 | else if (evt.type == EventType.KeyDown && evt.keyCode == KeyCode.F) 323 | { 324 | cameraGO.transform.position = Vector2.zero; 325 | forceRepaint = true; 326 | isPanning = true; 327 | Repaint(); 328 | } 329 | } 330 | } 331 | 332 | public override GUIContent GetPreviewTitle() 333 | { 334 | return new GUIContent("Animation Preview"); 335 | } 336 | 337 | public override void OnPreviewSettings() 338 | { 339 | if (!init) 340 | { 341 | // Define styles 342 | previewButtonSettings = new GUIStyle("preButton"); 343 | preSlider = new GUIStyle("preSlider"); 344 | preSliderThumb = new GUIStyle("preSliderThumb"); 345 | preLabel = new GUIStyle("preLabel"); 346 | speedScale = EditorGUIUtility.IconContent("SpeedScale"); 347 | playButtonContent = EditorGUIUtility.IconContent("PlayButton"); 348 | pauseButtonContent = EditorGUIUtility.IconContent("PauseButton"); 349 | loopIcon = EditorGUIUtility.IconContent("RotateTool"); 350 | loopIconActive = EditorGUIUtility.IconContent("RotateTool On"); 351 | init = true; 352 | } 353 | 354 | // Play Button 355 | GUIContent buttonContent = isPlaying ? pauseButtonContent : playButtonContent; 356 | isPlaying = GUILayout.Toggle(isPlaying, buttonContent, previewButtonSettings); 357 | 358 | // Loop Button 359 | GUIContent loopContent = loop ? loopIconActive : loopIcon; 360 | loop = GUILayout.Toggle(loop, loopContent, previewButtonSettings); 361 | 362 | // FPS Slider 363 | GUILayout.Box(speedScale, preLabel); 364 | framesPerSecond = (int)GUILayout.HorizontalSlider(framesPerSecond, 0, 60, preSlider, preSliderThumb); 365 | GUILayout.Label(framesPerSecond.ToString("0") + " fps", preLabel, GUILayout.Width(50)); 366 | } 367 | 368 | public override bool HasPreviewGUI() 369 | { 370 | // The preview is broken on the inspector right now. 371 | return false; // (animation != null && animation.FramesCount > 0); 372 | } 373 | 374 | #region Drawers 375 | public void FPSDrawer() 376 | { 377 | EditorGUI.BeginChangeCheck(); 378 | int fpsValue = EditorGUILayout.IntField("FPS", animation.FPS); 379 | 380 | if (EditorGUI.EndChangeCheck()) 381 | { 382 | Undo.RecordObject(animation, "Change FPS"); 383 | animation.FPS = fpsValue; 384 | } 385 | } 386 | 387 | private void Buttons() 388 | { 389 | if (animation.FramesCount > 0) 390 | { 391 | EditorGUILayout.Space(); 392 | 393 | EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); 394 | { 395 | if (GUILayout.Button("Delete All Frames")) 396 | { 397 | Undo.RecordObject(animation, "Delete All Frames"); 398 | animation.Frames.Clear(); 399 | InitializeReorderableList(); 400 | saveToDisk = true; 401 | } 402 | 403 | if (GUILayout.Button("Reverse Frames")) 404 | { 405 | Undo.RecordObject(animation, "Reverse Frames"); 406 | List prevFrames = new List(animation.Frames); 407 | animation.Frames.Clear(); 408 | 409 | for (int i = prevFrames.Count - 1; i >= 0; i--) 410 | { 411 | animation.Frames.Add(prevFrames[i]); 412 | } 413 | 414 | InitializeReorderableList(); 415 | saveToDisk = true; 416 | } 417 | } 418 | EditorGUILayout.EndHorizontal(); 419 | 420 | EditorGUILayout.Space(); 421 | } 422 | } 423 | #endregion 424 | 425 | 426 | #region Reorderable List Methods 427 | private void InitializeReorderableList() 428 | { 429 | if (animation == null) 430 | { 431 | return; 432 | } 433 | 434 | if (frames == null) 435 | { 436 | frames = new List(); 437 | } 438 | 439 | if (actions == null) 440 | { 441 | actions = new List(); 442 | } 443 | 444 | frames.Clear(); 445 | actions.Clear(); 446 | 447 | for (int i = 0; i < animation.Actions.Count; i++) 448 | { 449 | actions.Add(animation.Actions[i]); 450 | } 451 | 452 | for (int i = 0; i < animation.FramesCount; i++) 453 | { 454 | frames.Add(animation.Frames[i]); 455 | } 456 | 457 | // Kill listener of the previous list 458 | if (frameList != null) 459 | { 460 | frameList.drawHeaderCallback -= DrawFrameListHeader; 461 | frameList.drawElementCallback -= DrawFrameListElement; 462 | frameList.onAddCallback -= AddFrameListItem; 463 | frameList.onRemoveCallback -= RemoveFrameListItem; 464 | frameList.onSelectCallback -= SelectFrameListItem; 465 | frameList.onReorderCallback -= ReorderFrameListItem; 466 | frameList.elementHeightCallback -= ElementHeightCallback; 467 | } 468 | 469 | frameList = new ReorderableList(frames, typeof(SpriteAnimationFrame)); 470 | frameList.drawHeaderCallback += DrawFrameListHeader; 471 | frameList.drawElementCallback += DrawFrameListElement; 472 | frameList.onAddCallback += AddFrameListItem; 473 | frameList.onRemoveCallback += RemoveFrameListItem; 474 | frameList.onSelectCallback += SelectFrameListItem; 475 | frameList.onReorderCallback += ReorderFrameListItem; 476 | frameList.elementHeightCallback += ElementHeightCallback; 477 | } 478 | 479 | private void DrawFrameListHeader(Rect r) 480 | { 481 | GUI.Label(r, "Frame List"); 482 | } 483 | 484 | private void DrawFrameListElement(Rect r, int i, bool active, bool focused) 485 | { 486 | if(speedScale == null) 487 | { 488 | speedScale = EditorGUIUtility.IconContent("SpeedScale"); 489 | } 490 | 491 | if (i < animation.FramesCount) 492 | { 493 | SpriteEditorHelper.DrawFrameListElement(ref animation, speedScale, r, i, active, focused); 494 | } 495 | } 496 | 497 | private void AddFrameListItem(ReorderableList list) 498 | { 499 | Undo.RecordObject(animation, "Add Frame"); 500 | AddFrame(); 501 | EditorUtility.SetDirty(animation); 502 | } 503 | 504 | private void AddFrame() 505 | { 506 | frameList.list.Add(new SpriteAnimationFrame(null, 1)); 507 | animation.Frames.Add(null); 508 | } 509 | 510 | private void RemoveFrameListItem(ReorderableList list) 511 | { 512 | Undo.RecordObject(animation, "Remove Frame"); 513 | 514 | int i = list.index; 515 | animation.Frames.RemoveAt(i); 516 | frameList.list.RemoveAt(i); 517 | frameListSelectedIndex = frameList.index; 518 | 519 | if (i >= animation.FramesCount) 520 | { 521 | frameList.index -= 1; 522 | frameListSelectedIndex -= 1; 523 | currentFrame = frameListSelectedIndex; 524 | frameList.GrabKeyboardFocus(); 525 | } 526 | 527 | EditorUtility.SetDirty(animation); 528 | Repaint(); 529 | } 530 | 531 | private void ReorderFrameListItem(ReorderableList list) 532 | { 533 | Undo.RecordObject(animation, "Reorder Frames"); 534 | 535 | SpriteAnimationFrame frame = animation.Frames[frameListSelectedIndex]; 536 | 537 | animation.Frames.RemoveAt(frameListSelectedIndex); 538 | animation.Frames.Insert(list.index, frame); 539 | 540 | EditorUtility.SetDirty(animation); 541 | } 542 | 543 | private void SelectFrameListItem(ReorderableList list) 544 | { 545 | currentFrame = list.index; 546 | forceRepaint = true; 547 | frameListSelectedIndex = list.index; 548 | } 549 | 550 | private float ElementHeightCallback(int index) 551 | { 552 | if (index >= animation.FramesCount) 553 | { 554 | return 0; 555 | } 556 | 557 | return SpriteEditorHelper.GetElementHeight(animation, index); 558 | } 559 | #endregion 560 | 561 | #region Properties 562 | public int FramesPerSecond 563 | { 564 | get => framesPerSecond; 565 | set => framesPerSecond = value; 566 | } 567 | 568 | public bool IsPlaying 569 | { 570 | get => isPlaying; 571 | set => isPlaying = value; 572 | } 573 | 574 | public bool ForceRepaint 575 | { 576 | get => forceRepaint; 577 | set => forceRepaint = value; 578 | } 579 | 580 | public SpriteAnimation CurrentAnimation 581 | { 582 | get => animation; 583 | } 584 | 585 | public int CurrentFrame 586 | { 587 | set => currentFrame = value; 588 | } 589 | 590 | public bool Loop 591 | { 592 | get => loop; 593 | set => loop = value; 594 | } 595 | 596 | public float Zoom 597 | { 598 | set 599 | { 600 | if (pc != null) 601 | { 602 | float z = value / 50f; 603 | if (pc.orthographicSize + z >= 0.1f && 604 | pc.orthographicSize + z <= 100) 605 | { 606 | pc.orthographicSize += z; 607 | } 608 | } 609 | } 610 | } 611 | 612 | public bool IsPanning 613 | { 614 | get => isPanning; 615 | set => isPanning = value; 616 | } 617 | #endregion 618 | } 619 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 189bfb474941bb543aad7f9b12aa215d 3 | timeCreated: 1481150127 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimationWindow.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using UnityEditorInternal; 9 | 10 | namespace Elendow.SpritedowAnimator 11 | { 12 | /// 13 | /// Editor window to edit animations 14 | /// 15 | public class EditorSpriteAnimationWindow : EditorWindow 16 | { 17 | private const float DROP_AREA_HEIGHT = 50; 18 | private const float MIN_WINDOW_WIDTH = 650f; 19 | private const float MIN_WINDOW_HEIGHT = 200f; 20 | 21 | private bool init = false; 22 | private bool justCreatedAnim = false; 23 | private int frameListSelectedIndex = -1; 24 | private int fps; 25 | private Texture2D clockIcon = null; 26 | private SpriteAnimation selectedAnimation = null; 27 | private Vector2 scrollWindowPosition = Vector2.zero; 28 | private List draggedSprites = null; 29 | private EditorSpriteAnimation spritePreview = null; 30 | private ReorderableList frameList; 31 | private List frames = new List(); 32 | private List actions = new List(); 33 | 34 | // Styles 35 | private GUIStyle box; 36 | private GUIStyle dragAndDropBox; 37 | private GUIStyle lowPaddingBox; 38 | private GUIStyle buttonStyle; 39 | private GUIStyle sliderStyle; 40 | private GUIStyle sliderThumbStyle; 41 | private GUIStyle labelStyle; 42 | private GUIStyle previewToolBar; 43 | private GUIStyle preview; 44 | private GUIContent playButtonContent; 45 | private GUIContent pauseButtonContent; 46 | private GUIContent speedScaleIcon; 47 | private GUIContent loopIcon; 48 | private GUIContent loopIconActive; 49 | 50 | [MenuItem("Tools/Spritedow/Sprite Animation Editor", false, 0)] 51 | private static void ShowWindow() 52 | { 53 | GetWindow(typeof(EditorSpriteAnimationWindow), false, "Sprite Animation"); 54 | } 55 | 56 | [MenuItem("Assets/Create/Spritedow/Sprite Animation")] 57 | public static void CreateAsset() 58 | { 59 | SpriteAnimation asset = CreateInstance(); 60 | string path = AssetDatabase.GetAssetPath(Selection.activeObject); 61 | if (path == "") 62 | path = "Assets"; 63 | else if (System.IO.Path.GetExtension(path) != "") 64 | path = path.Replace(System.IO.Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); 65 | string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New Animation.asset"); 66 | AssetDatabase.CreateAsset(asset, assetPathAndName); 67 | AssetDatabase.SaveAssets(); 68 | AssetDatabase.Refresh(); 69 | } 70 | 71 | private void OnEnable() 72 | { 73 | // Get clock icon 74 | if (clockIcon == null) 75 | clockIcon = Resources.Load("clockIcon"); 76 | 77 | // Initialize 78 | draggedSprites = new List(); 79 | init = false; 80 | 81 | // Events 82 | EditorApplication.update += Update; 83 | } 84 | 85 | private void OnDisable() 86 | { 87 | EditorApplication.update -= Update; 88 | 89 | if(frameList != null) 90 | { 91 | frameList.drawHeaderCallback -= DrawFrameListHeader; 92 | frameList.drawElementCallback -= DrawFrameListElement; 93 | frameList.onAddCallback -= AddFrameListItem; 94 | frameList.onRemoveCallback -= RemoveFrameListItem; 95 | frameList.onSelectCallback -= SelectFrameListItem; 96 | frameList.onReorderCallback -= ReorderFrameListItem; 97 | } 98 | } 99 | 100 | private void OnSelectionChange() 101 | { 102 | // Change animation if we select an animation on the project 103 | if (Selection.activeObject != null && Selection.activeObject.GetType() == typeof(SpriteAnimation)) 104 | { 105 | SpriteAnimation sa = Selection.activeObject as SpriteAnimation; 106 | if (sa != selectedAnimation) 107 | { 108 | selectedAnimation = sa; 109 | spritePreview = null; 110 | InitializeReorderableList(); 111 | Repaint(); 112 | } 113 | } 114 | } 115 | 116 | private void Update() 117 | { 118 | if(selectedAnimation != null && frames != null) 119 | { 120 | if (selectedAnimation.FPS != fps) 121 | Repaint(); 122 | 123 | if (SpriteEditorHelper.CheckListOutOfSync(frames, actions, selectedAnimation)) 124 | { 125 | InitializeReorderableList(); 126 | Repaint(); 127 | } 128 | } 129 | 130 | if (spritePreview != null) 131 | { 132 | if (spritePreview.IsPlaying && frames.Count == 0) 133 | spritePreview.IsPlaying = false; 134 | } 135 | 136 | // Only force repaint on update if the preview is playing and has changed the frame 137 | if (spritePreview != null && 138 | (spritePreview.IsPlaying || spritePreview.IsPanning) && 139 | spritePreview.ForceRepaint) 140 | { 141 | spritePreview.ForceRepaint = false; 142 | Repaint(); 143 | } 144 | } 145 | 146 | private void OnGUI() 147 | { 148 | // Style initialization 149 | if (!init) 150 | { 151 | Initialize(); 152 | init = true; 153 | } 154 | 155 | // Create animation box 156 | NewAnimationBox(); 157 | 158 | if(justCreatedAnim) 159 | { 160 | justCreatedAnim = false; 161 | return; 162 | } 163 | 164 | // Edit animation box 165 | EditorGUILayout.Space(); 166 | EditorGUILayout.BeginVertical(); 167 | { 168 | // Animation asset field 169 | if (selectedAnimation == null) 170 | { 171 | EditorGUILayout.BeginVertical(box); 172 | selectedAnimation = EditorGUILayout.ObjectField("Animation", selectedAnimation, typeof(SpriteAnimation), false) as SpriteAnimation; 173 | EditorGUILayout.EndVertical(); 174 | } 175 | else 176 | { 177 | // Init reorderable list 178 | if(frameList == null) 179 | InitializeReorderableList(); 180 | 181 | // Add the frames dropped on the drag and drop box 182 | if (draggedSprites != null && draggedSprites.Count > 0) 183 | { 184 | for (int i = 0; i < draggedSprites.Count; i++) 185 | AddFrame(draggedSprites[i]); 186 | draggedSprites.Clear(); 187 | 188 | SaveFile(true); 189 | } 190 | 191 | // Config settings 192 | ConfigBox(); 193 | 194 | EditorGUILayout.Space(); 195 | 196 | EditorGUILayout.BeginHorizontal(); 197 | { 198 | // Preview window setup 199 | Rect previewRect = EditorGUILayout.BeginVertical(lowPaddingBox, GUILayout.MaxWidth(position.width / 2)); 200 | PreviewBox(previewRect); 201 | EditorGUILayout.EndVertical(); 202 | 203 | EditorGUILayout.BeginVertical(); 204 | { 205 | // FPS 206 | EditorGUI.BeginChangeCheck(); 207 | fps = EditorGUILayout.IntField("FPS", selectedAnimation.FPS); 208 | if (EditorGUI.EndChangeCheck()) 209 | { 210 | Undo.RecordObject(selectedAnimation, "Change FPS"); 211 | selectedAnimation.FPS = fps; 212 | if (selectedAnimation.FPS < 0) 213 | selectedAnimation.FPS = 0; 214 | } 215 | 216 | EditorGUILayout.Space(); 217 | 218 | scrollWindowPosition = EditorGUILayout.BeginScrollView(scrollWindowPosition); 219 | { 220 | // Individual frames 221 | frameList.displayRemove = (selectedAnimation.FramesCount > 0); 222 | frameList.DoLayoutList(); 223 | EditorGUILayout.Space(); 224 | } 225 | EditorGUILayout.EndScrollView(); 226 | 227 | if (selectedAnimation.FramesCount > 0) 228 | { 229 | EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); 230 | { 231 | if (GUILayout.Button("Delete All Frames")) 232 | { 233 | Undo.RecordObject(selectedAnimation, "Delete All Frames"); 234 | 235 | spritePreview.IsPlaying = false; 236 | selectedAnimation.Frames.Clear(); 237 | InitializeReorderableList(); 238 | SaveFile(true); 239 | } 240 | 241 | if (GUILayout.Button("Reverse Frames")) 242 | { 243 | Undo.RecordObject(selectedAnimation, "Reverse Frames"); 244 | 245 | List prevFrames = new List(selectedAnimation.Frames); 246 | 247 | selectedAnimation.Frames.Clear(); 248 | 249 | for (int i = prevFrames.Count - 1; i >= 0; i--) 250 | { 251 | selectedAnimation.Frames.Add(prevFrames[i]); 252 | } 253 | 254 | InitializeReorderableList(); 255 | SaveFile(true); 256 | } 257 | } 258 | EditorGUILayout.EndHorizontal(); 259 | } 260 | 261 | EditorGUILayout.Space(); 262 | } 263 | EditorGUILayout.EndVertical(); 264 | 265 | // Check Events 266 | Event evt = Event.current; 267 | switch (evt.type) 268 | { 269 | // Delete frames with supr 270 | case EventType.KeyDown: 271 | if (Event.current.keyCode == KeyCode.Delete && 272 | selectedAnimation.FramesCount > 0 && 273 | frameList.HasKeyboardControl() && 274 | frameListSelectedIndex != -1) 275 | { 276 | RemoveFrameListItem(frameList); 277 | } 278 | break; 279 | // Zoom preview window with scrollwheel 280 | case EventType.ScrollWheel: 281 | if (spritePreview != null) 282 | { 283 | Vector2 mpos = Event.current.mousePosition; 284 | if (mpos.x >= previewRect.x && mpos.x <= previewRect.x + previewRect.width && 285 | mpos.y >= previewRect.y && mpos.y <= previewRect.y + previewRect.height) 286 | { 287 | Repaint(); 288 | spritePreview.Zoom = -evt.delta.y; 289 | } 290 | } 291 | break; 292 | } 293 | } 294 | EditorGUILayout.EndHorizontal(); 295 | } 296 | } 297 | EditorGUILayout.EndVertical(); 298 | 299 | if (GUI.changed && selectedAnimation != null) 300 | { 301 | SaveFile(); 302 | } 303 | } 304 | 305 | private void Initialize() 306 | { 307 | minSize = new Vector2(MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT); 308 | buttonStyle = new GUIStyle("preButton"); 309 | sliderStyle = new GUIStyle("preSlider"); 310 | sliderThumbStyle = new GUIStyle("preSliderThumb"); 311 | labelStyle = new GUIStyle("preLabel"); 312 | box = new GUIStyle(EditorStyles.helpBox); 313 | playButtonContent = EditorGUIUtility.IconContent("PlayButton"); 314 | pauseButtonContent = EditorGUIUtility.IconContent("PauseButton"); 315 | speedScaleIcon = EditorGUIUtility.IconContent("SpeedScale"); 316 | loopIcon = EditorGUIUtility.IconContent("RotateTool"); 317 | loopIconActive = EditorGUIUtility.IconContent("RotateTool On"); 318 | lowPaddingBox = new GUIStyle(EditorStyles.helpBox); 319 | lowPaddingBox.padding = new RectOffset(1, 1, 1, 1); 320 | lowPaddingBox.stretchWidth = true; 321 | lowPaddingBox.stretchHeight = true; 322 | previewToolBar = new GUIStyle("RectangleToolHBar"); 323 | preview = new GUIStyle("CurveEditorBackground"); 324 | 325 | dragAndDropBox = new GUIStyle(EditorStyles.helpBox); 326 | dragAndDropBox.richText = true; 327 | dragAndDropBox.alignment = TextAnchor.MiddleCenter; 328 | } 329 | 330 | private void InitializeReorderableList() 331 | { 332 | if (frames == null) 333 | frames = new List(); 334 | 335 | if (actions == null) 336 | actions = new List(); 337 | 338 | frames.Clear(); 339 | actions.Clear(); 340 | 341 | if (selectedAnimation == null) 342 | return; 343 | 344 | for (int i = 0; i < selectedAnimation.FramesCount; i++) 345 | frames.Add(selectedAnimation.Frames[i]); 346 | 347 | for (int i = 0; i < selectedAnimation.Actions.Count; i++) 348 | actions.Add(selectedAnimation.Actions[i]); 349 | 350 | // Kill listener of the previous list 351 | if (frameList != null) 352 | { 353 | frameList.drawHeaderCallback -= DrawFrameListHeader; 354 | frameList.drawElementCallback -= DrawFrameListElement; 355 | frameList.onAddCallback -= AddFrameListItem; 356 | frameList.onRemoveCallback -= RemoveFrameListItem; 357 | frameList.onSelectCallback -= SelectFrameListItem; 358 | frameList.onReorderCallback -= ReorderFrameListItem; 359 | frameList.elementHeightCallback -= ElementHeightCallback; 360 | } 361 | 362 | frameList = new ReorderableList(frames, typeof(SpriteAnimationFrame)); 363 | frameList.drawHeaderCallback += DrawFrameListHeader; 364 | frameList.drawElementCallback += DrawFrameListElement; 365 | frameList.onAddCallback += AddFrameListItem; 366 | frameList.onRemoveCallback += RemoveFrameListItem; 367 | frameList.onSelectCallback += SelectFrameListItem; 368 | frameList.onReorderCallback += ReorderFrameListItem; 369 | frameList.elementHeightCallback += ElementHeightCallback; 370 | } 371 | 372 | /// 373 | /// Draws the new animation box 374 | /// 375 | private void NewAnimationBox() 376 | { 377 | EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true)); 378 | { 379 | GUILayout.FlexibleSpace(); 380 | 381 | // New animaton button 382 | if (GUILayout.Button("Create Animation", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false))) 383 | { 384 | CreateAnimation(); 385 | } 386 | } 387 | EditorGUILayout.EndHorizontal(); 388 | } 389 | 390 | /// 391 | /// Draws the box with the name and file of the animation 392 | /// 393 | private void ConfigBox() 394 | { 395 | EditorGUILayout.BeginVertical(box); 396 | { 397 | SpriteAnimation newSpriteAnimation = EditorGUILayout.ObjectField("Animation", selectedAnimation, typeof(SpriteAnimation), false) as SpriteAnimation; 398 | if (newSpriteAnimation == null) 399 | return; 400 | 401 | // Reset preview and list if we select a new animation 402 | if (newSpriteAnimation != selectedAnimation) 403 | { 404 | selectedAnimation = newSpriteAnimation; 405 | InitializeReorderableList(); 406 | spritePreview = (EditorSpriteAnimation)Editor.CreateEditor(selectedAnimation, typeof(EditorSpriteAnimation)); 407 | } 408 | 409 | EditorGUILayout.Space(); 410 | DragAndDropBox(); 411 | } 412 | EditorGUILayout.EndVertical(); 413 | } 414 | 415 | /// 416 | /// Draws the drag and drop box and saves the dragged objects 417 | /// 418 | private void DragAndDropBox() 419 | { 420 | // Drag and drop box for sprite frames 421 | Rect dropArea = GUILayoutUtility.GetRect(0f, DROP_AREA_HEIGHT, GUILayout.ExpandWidth(true)); 422 | Event evt = Event.current; 423 | GUI.Box(dropArea, "Drop sprites HERE to add frames automatically.", dragAndDropBox); 424 | switch (evt.type) 425 | { 426 | case EventType.DragUpdated: 427 | case EventType.DragPerform: 428 | if (!dropArea.Contains(evt.mousePosition)) 429 | return; 430 | 431 | DragAndDrop.visualMode = DragAndDropVisualMode.Copy; 432 | 433 | if (evt.type == EventType.DragPerform) 434 | { 435 | if (DragAndDrop.objectReferences.Length > 0) 436 | { 437 | DragAndDrop.AcceptDrag(); 438 | draggedSprites.Clear(); 439 | foreach (Object draggedObject in DragAndDrop.objectReferences) 440 | { 441 | // Get dragged sprites 442 | Sprite s = draggedObject as Sprite; 443 | if (s != null) 444 | draggedSprites.Add(s); 445 | else 446 | { 447 | // If the object is a complete texture, get all the sprites in it 448 | Texture2D t = draggedObject as Texture2D; 449 | if (t != null) 450 | { 451 | string texturePath = AssetDatabase.GetAssetPath(t); 452 | Sprite[] spritesInTexture = AssetDatabase.LoadAllAssetsAtPath(texturePath).OfType().ToArray(); 453 | for (int i = 0; i < spritesInTexture.Length; i++) 454 | draggedSprites.Add(spritesInTexture[i]); 455 | } 456 | } 457 | } 458 | 459 | if (draggedSprites.Count > 1) 460 | { 461 | draggedSprites.Sort(new SpriteSorter()); 462 | } 463 | } 464 | } 465 | break; 466 | } 467 | } 468 | 469 | /// 470 | /// Draws the preview window 471 | /// 472 | /// Draw rect 473 | private void PreviewBox(Rect r) 474 | { 475 | if (spritePreview == null || spritePreview.CurrentAnimation != selectedAnimation) 476 | spritePreview = (EditorSpriteAnimation)Editor.CreateEditor(selectedAnimation, typeof(EditorSpriteAnimation)); 477 | 478 | if (spritePreview != null) 479 | { 480 | EditorGUILayout.BeginVertical(preview, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 481 | { 482 | r.height -= 21; 483 | r.width -= 2; 484 | r.y += 1; 485 | r.x += 1; 486 | spritePreview.OnInteractivePreviewGUI(r, EditorStyles.whiteLabel); 487 | } 488 | EditorGUILayout.EndVertical(); 489 | 490 | EditorGUILayout.BeginHorizontal(previewToolBar); 491 | { 492 | // Play Button 493 | GUIContent buttonContent = spritePreview.IsPlaying ? pauseButtonContent : playButtonContent; 494 | spritePreview.IsPlaying = GUILayout.Toggle(spritePreview.IsPlaying, buttonContent, buttonStyle, GUILayout.Width(40)); 495 | 496 | // Loop Button 497 | GUIContent loopContent = spritePreview.Loop ? loopIconActive : loopIcon; 498 | spritePreview.Loop = GUILayout.Toggle(spritePreview.Loop, loopContent, buttonStyle, GUILayout.Width(40)); 499 | 500 | // FPS Slider 501 | GUILayout.Box(speedScaleIcon, labelStyle, GUILayout.ExpandWidth(false)); 502 | spritePreview.FramesPerSecond = (int)GUILayout.HorizontalSlider(spritePreview.FramesPerSecond, 0, 60, sliderStyle, sliderThumbStyle); 503 | GUILayout.Label(spritePreview.FramesPerSecond.ToString("0") + " fps", labelStyle, GUILayout.Width(50)); 504 | } 505 | EditorGUILayout.EndHorizontal(); 506 | } 507 | } 508 | 509 | #region Reorderable List Methods 510 | private void DrawFrameListHeader(Rect r) 511 | { 512 | GUI.Label(r, "Frame List"); 513 | } 514 | 515 | private void DrawFrameListElement(Rect r, int i, bool active, bool focused) 516 | { 517 | if (i < selectedAnimation.FramesCount) 518 | { 519 | SpriteEditorHelper.DrawFrameListElement(ref selectedAnimation, speedScaleIcon, r, i, active, focused); 520 | } 521 | } 522 | 523 | private void AddFrameListItem(ReorderableList list) 524 | { 525 | Undo.RecordObject(selectedAnimation, "Add Frame"); 526 | AddFrame(); 527 | SaveFile(true); 528 | } 529 | 530 | private void RemoveFrameListItem(ReorderableList list) 531 | { 532 | Undo.RecordObject(selectedAnimation, "Remove Frame"); 533 | 534 | int i = list.index; 535 | selectedAnimation.Frames.RemoveAt(i); 536 | frameList.list.RemoveAt(i); 537 | frameListSelectedIndex = frameList.index; 538 | 539 | if (i >= selectedAnimation.FramesCount) 540 | { 541 | frameList.index -= 1; 542 | frameListSelectedIndex -= 1; 543 | spritePreview.CurrentFrame = frameListSelectedIndex; 544 | frameList.GrabKeyboardFocus(); 545 | } 546 | 547 | Repaint(); 548 | SaveFile(true); 549 | } 550 | 551 | private void ReorderFrameListItem(ReorderableList list) 552 | { 553 | Undo.RecordObject(selectedAnimation, "Reorder Frames"); 554 | 555 | SpriteAnimationFrame s = selectedAnimation.Frames[frameListSelectedIndex]; 556 | selectedAnimation.Frames.RemoveAt(frameListSelectedIndex); 557 | selectedAnimation.Frames.Insert(list.index, s); 558 | 559 | SaveFile(true); 560 | } 561 | 562 | private void SelectFrameListItem(ReorderableList list) 563 | { 564 | spritePreview.CurrentFrame = list.index; 565 | spritePreview.ForceRepaint = true; 566 | frameListSelectedIndex = list.index; 567 | } 568 | 569 | private float ElementHeightCallback(int index) 570 | { 571 | if (index >= selectedAnimation.FramesCount) 572 | return 0; 573 | 574 | return SpriteEditorHelper.GetElementHeight(selectedAnimation, index); 575 | } 576 | #endregion 577 | 578 | /// 579 | /// Adds an empty frame 580 | /// 581 | private void AddFrame() 582 | { 583 | frameList.list.Add(new SpriteAnimationFrame(null, 1)); 584 | selectedAnimation.Frames.Add(null); 585 | } 586 | 587 | /// 588 | /// Adds a frame with specified sprite 589 | /// 590 | /// Sprite to add 591 | private void AddFrame(Sprite s) 592 | { 593 | SpriteAnimationFrame frame = new SpriteAnimationFrame(s, 1); 594 | frameList.list.Add(frame); 595 | selectedAnimation.Frames.Add(frame); 596 | } 597 | 598 | /// 599 | /// Creates the animation asset with a prompt 600 | /// 601 | private void CreateAnimation() 602 | { 603 | string folder = EditorUtility.SaveFilePanel("New Animation", "Assets", "New Animation", "asset"); 604 | string relativeFolder = folder; 605 | 606 | if (folder.Length > 0) 607 | { 608 | int folderPosition = folder.IndexOf("Assets/", System.StringComparison.InvariantCulture); 609 | if (folderPosition > 0) 610 | { 611 | relativeFolder = folder.Substring(folderPosition); 612 | 613 | // Create the animation 614 | SpriteAnimation asset = CreateInstance(); 615 | AssetDatabase.CreateAsset(asset, relativeFolder); 616 | AssetDatabase.SaveAssets(); 617 | AssetDatabase.Refresh(); 618 | 619 | selectedAnimation = AssetDatabase.LoadAssetAtPath(relativeFolder); 620 | InitializeReorderableList(); 621 | justCreatedAnim = true; 622 | } 623 | else 624 | { 625 | EditorUtility.DisplayDialog("Invalid Path", "Select a path inside the Assets folder", "OK"); 626 | } 627 | } 628 | } 629 | 630 | /// 631 | /// Forces serialization of the current animation 632 | /// 633 | /// If true, it forces the asset database to save the file to disk. It causes little freeze, so I only use it on a few moments. Remember to save project before closing Unity!! 634 | private void SaveFile(bool toDisk = false) 635 | { 636 | selectedAnimation.Setup(); 637 | EditorUtility.SetDirty(selectedAnimation); 638 | 639 | if(toDisk) 640 | { 641 | AssetDatabase.SaveAssets(); 642 | } 643 | } 644 | } 645 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimationWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 189bfb474941bb543aad7f9b12aa215d 3 | timeCreated: 1481150127 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimator.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEditor; 5 | 6 | namespace Elendow.SpritedowAnimator 7 | { 8 | [CustomEditor(typeof(SpriteAnimator))] 9 | public class EditorSpriteAnimator : EditorBaseAnimator 10 | { 11 | private SpriteAnimator t; 12 | 13 | public override void OnInspectorGUI() 14 | { 15 | t = (SpriteAnimator)target; 16 | Undo.RecordObject(t, "Edit Sprite Animator"); 17 | DrawInspector(t); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorSpriteAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da9dd9c545413a14f9903a30934c9346 3 | timeCreated: 1481150128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorUIAnimator.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEditor; 5 | 6 | namespace Elendow.SpritedowAnimator 7 | { 8 | [CustomEditor(typeof(UIAnimator))] 9 | public class EditorUIAnimator : EditorBaseAnimator 10 | { 11 | private UIAnimator t; 12 | 13 | public override void OnInspectorGUI() 14 | { 15 | t = (UIAnimator)target; 16 | Undo.RecordObject(t, "Edit UI Animator"); 17 | 18 | EditorGUILayout.Space(); 19 | 20 | EditorGUILayout.BeginVertical(EditorStyles.helpBox); 21 | { 22 | t.preserveAspectRatio = EditorGUILayout.Toggle("Preserve Aspect Ratio", t.preserveAspectRatio); 23 | } 24 | EditorGUILayout.EndVertical(); 25 | 26 | DrawInspector(t); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/EditorUIAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8729596a4c665af41a738d533c021bb5 3 | timeCreated: 1481150128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72f23f6e2ada32848b7359acfd3d122e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/Resources/Spritedow.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Spritedow 11 | m_Shader: {fileID: 4800000, guid: 8b7fbec0c9eb7a04f8403f8ab59d11da, type: 3} 12 | m_ShaderKeywords: ETC1_EXTERNAL_ALPHA 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - : 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _MainTex: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | m_Floats: 31 | - : 0 32 | - _ColorMask: 15 33 | - _Stencil: 0 34 | - _StencilComp: 8 35 | - _StencilOp: 0 36 | - _StencilReadMask: 255 37 | - _StencilWriteMask: 255 38 | m_Colors: 39 | - : {r: 0, g: 1.3466877e-34, b: 0, a: 1.3466803e-34} 40 | - _Color: {r: 1, g: 1, b: 1, a: 1} 41 | m_BuildTextureStacks: [] 42 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/Resources/Spritedow.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2137059b83c69445972d1844728c906 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/Resources/Spritedow.shader: -------------------------------------------------------------------------------- 1 | Shader "Spritedow/Linear" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {} 6 | _Color("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp("Stencil Comparison", Float) = 8 9 | _Stencil("Stencil ID", Float) = 0 10 | _StencilOp("Stencil Operation", Float) = 0 11 | _StencilWriteMask("Stencil Write Mask", Float) = 255 12 | _StencilReadMask("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | Tags 20 | { 21 | "Queue" = "Transparent" 22 | "IgnoreProjector" = "True" 23 | "RenderType" = "Transparent" 24 | "PreviewType" = "Plane" 25 | "CanUseSpriteAtlas" = "True" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref[_Stencil] 31 | Comp[_StencilComp] 32 | Pass[_StencilOp] 33 | ReadMask[_StencilReadMask] 34 | WriteMask[_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest[unity_GUIZTestMode] 41 | Blend SrcAlpha OneMinusSrcAlpha 42 | ColorMask[_ColorMask] 43 | 44 | Pass 45 | { 46 | CGPROGRAM 47 | #pragma vertex vert 48 | #pragma fragment frag 49 | #include "UnityCG.cginc" 50 | 51 | struct appdata_t 52 | { 53 | float4 vertex : POSITION; 54 | float4 color : COLOR; 55 | float2 texcoord : TEXCOORD0; 56 | }; 57 | 58 | struct v2f 59 | { 60 | float4 vertex : SV_POSITION; 61 | fixed4 color : COLOR; 62 | half2 texcoord : TEXCOORD0; 63 | }; 64 | 65 | fixed4 _Color; 66 | 67 | v2f vert(appdata_t IN) 68 | { 69 | v2f OUT; 70 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 71 | OUT.texcoord = IN.texcoord; 72 | #ifdef UNITY_HALF_TEXEL_OFFSET 73 | OUT.vertex.xy += (_ScreenParams.zw - 1.0) * float2(-1,1); 74 | #endif 75 | OUT.color = IN.color * _Color; 76 | 77 | 78 | return OUT; 79 | } 80 | 81 | sampler2D _MainTex; 82 | 83 | fixed4 frag(v2f IN) : SV_Target 84 | { 85 | half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; 86 | clip(color.a - 0.01); 87 | #if !UNITY_COLORSPACE_GAMMA 88 | color = float4(LinearToGammaSpace(color.rgb), color.a); 89 | #endif 90 | return color; 91 | } 92 | ENDCG 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/Resources/Spritedow.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b7fbec0c9eb7a04f8403f8ab59d11da 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/SpriteEditorHelper.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEditor; 5 | using UnityEngine; 6 | using System.Collections.Generic; 7 | 8 | namespace Elendow.SpritedowAnimator 9 | { 10 | public static class SpriteEditorHelper 11 | { 12 | public static void DrawFrameListElement(ref SpriteAnimation animation, GUIContent clockIcon, Rect r, int i, bool active, bool focused) 13 | { 14 | string spriteName = (animation.Frames[i].Sprite != null) ? animation.Frames[i].Sprite.name : "No sprite selected"; 15 | 16 | r.height = 20; 17 | EditorGUIUtility.labelWidth = 0; 18 | 19 | EditorGUI.BeginChangeCheck(); 20 | Sprite spriteValue = EditorGUI.ObjectField(new Rect(r.x, r.y + 2, r.width - 200, r.height - 2), "", animation.Frames[i].Sprite, typeof(Sprite), false) as Sprite; 21 | if (EditorGUI.EndChangeCheck()) 22 | { 23 | Undo.RecordObject(animation, "Change Animation Sprite"); 24 | animation.Frames[i].Sprite = spriteValue; 25 | } 26 | 27 | EditorGUIUtility.labelWidth = 20; 28 | 29 | EditorGUI.BeginChangeCheck(); 30 | int durationValue = EditorGUI.IntField(new Rect(r.x + r.width - 175, r.y + 1, 75, r.height - 4), clockIcon, animation.Frames[i].Duration); 31 | if (EditorGUI.EndChangeCheck()) 32 | { 33 | Undo.RecordObject(animation, "Change Frame Duration"); 34 | animation.Frames[i].Duration = durationValue; 35 | if (durationValue <= 0) 36 | { 37 | animation.Frames[i].Duration = 1; 38 | } 39 | } 40 | 41 | Rect buttonRect = r; 42 | buttonRect.width = 90; 43 | buttonRect.x = r.width - 70; 44 | if (GUI.Button(buttonRect, "Add Action")) 45 | { 46 | animation.Actions.Add(new SpriteAnimationAction(i, "New Action")); 47 | } 48 | 49 | for (int j = animation.Actions.Count - 1; j >= 0; j--) 50 | { 51 | if (animation.Actions[j].Frame == i) 52 | { 53 | r.y += 25; 54 | animation.Actions[j].Data = EditorGUI.TextField(new Rect(50, r.y, r.width - 70, 20), animation.Actions[j].Data); 55 | 56 | if (GUI.Button(new Rect(r.x + r.width - 30, r.y, 30, 20), "-")) 57 | { 58 | animation.Actions.RemoveAt(j); 59 | } 60 | } 61 | } 62 | } 63 | 64 | public static float GetElementHeight(SpriteAnimation animation, int index) 65 | { 66 | float height = 30f; 67 | 68 | for (int i = 0; i < animation.Actions.Count; i++) 69 | { 70 | if (animation.Actions[i].Frame == index) 71 | { 72 | height += 25f; 73 | } 74 | } 75 | 76 | return height; 77 | } 78 | 79 | public static bool CheckListOutOfSync(List frames, List actions, SpriteAnimation animation) 80 | { 81 | if (frames == null || actions == null || animation == null) 82 | { 83 | return true; 84 | } 85 | 86 | if (frames.Count != animation.Frames.Count) 87 | { 88 | return true; 89 | } 90 | else 91 | { 92 | for (int i = 0; i < frames.Count; i++) 93 | { 94 | if (frames[i].Duration != animation.Frames[i].Duration || 95 | frames[i].Sprite != animation.Frames[i].Sprite) 96 | { 97 | return true; 98 | } 99 | } 100 | } 101 | 102 | if (actions.Count != animation.Actions.Count) 103 | { 104 | return true; 105 | } 106 | else 107 | { 108 | for (int i = 0; i < actions.Count; i++) 109 | { 110 | if (actions[i].Data != animation.Actions[i].Data) 111 | { 112 | return true; 113 | } 114 | } 115 | } 116 | 117 | return false; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/SpriteEditorHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d440ddb1232cea34e9c5d91d5eb0f850 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/SpriteSorter.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using System.Collections.Generic; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | public class SpriteSorter : IComparer 10 | { 11 | public int Compare(Sprite x, Sprite y) 12 | { 13 | string s1 = x.name; 14 | if (s1 == null) 15 | { 16 | return 0; 17 | } 18 | string s2 = y.name; 19 | if (s2 == null) 20 | { 21 | return 0; 22 | } 23 | 24 | int len1 = s1.Length; 25 | int len2 = s2.Length; 26 | int marker1 = 0; 27 | int marker2 = 0; 28 | 29 | // Walk through two the strings with two markers. 30 | while (marker1 < len1 && marker2 < len2) 31 | { 32 | char ch1 = s1[marker1]; 33 | char ch2 = s2[marker2]; 34 | 35 | // Some buffers we can build up characters in for each chunk. 36 | char[] space1 = new char[len1]; 37 | int loc1 = 0; 38 | char[] space2 = new char[len2]; 39 | int loc2 = 0; 40 | 41 | // Walk through all following characters that are digits or 42 | // characters in BOTH strings starting at the appropriate marker. 43 | // Collect char arrays. 44 | do 45 | { 46 | space1[loc1++] = ch1; 47 | marker1++; 48 | 49 | if (marker1 < len1) 50 | { 51 | ch1 = s1[marker1]; 52 | } 53 | else 54 | { 55 | break; 56 | } 57 | } while (char.IsDigit(ch1) == char.IsDigit(space1[0])); 58 | 59 | do 60 | { 61 | space2[loc2++] = ch2; 62 | marker2++; 63 | 64 | if (marker2 < len2) 65 | { 66 | ch2 = s2[marker2]; 67 | } 68 | else 69 | { 70 | break; 71 | } 72 | } while (char.IsDigit(ch2) == char.IsDigit(space2[0])); 73 | 74 | // If we have collected numbers, compare them numerically. 75 | // Otherwise, if we have strings, compare them alphabetically. 76 | string str1 = new string(space1); 77 | string str2 = new string(space2); 78 | 79 | int result; 80 | 81 | if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) 82 | { 83 | int thisNumericChunk = int.Parse(str1); 84 | int thatNumericChunk = int.Parse(str2); 85 | result = thisNumericChunk.CompareTo(thatNumericChunk); 86 | } 87 | else 88 | { 89 | result = str1.CompareTo(str2); 90 | } 91 | 92 | if (result != 0) 93 | { 94 | return result; 95 | } 96 | } 97 | return len1 - len2; 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/Editor/SpriteSorter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e615e706247147d4eb547af75f0190c6 3 | timeCreated: 1493757998 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/LoopType.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | namespace Elendow.SpritedowAnimator 5 | { 6 | /// The different modes to loop and animation. 7 | public enum LoopType 8 | { 9 | repeat, 10 | yoyo 11 | } 12 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/LoopType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 381a5fa4653bb7043959c1c2825589e7 3 | timeCreated: 1547499205 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimation.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using System.Collections.Generic; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | /// Asset class to store the animations. 10 | public class SpriteAnimation : ScriptableObject 11 | { 12 | [SerializeField] 13 | private int fps = 30; 14 | [SerializeField] 15 | private int totalDuration = -1; 16 | [SerializeField] 17 | private List frames = new List(); 18 | [SerializeField] 19 | private List actions = new List(); 20 | 21 | /// Initialize values. 22 | public void Setup() 23 | { 24 | totalDuration = 0; 25 | for (int i = 0; i < frames.Count; i++) 26 | { 27 | if (frames[i] == null) 28 | { 29 | frames[i] = new SpriteAnimationFrame(); 30 | } 31 | 32 | totalDuration += frames[i].Duration; 33 | } 34 | } 35 | 36 | /// Creates an empty animation. 37 | public SpriteAnimation() 38 | { 39 | frames = new List(); 40 | } 41 | 42 | /// Returns the sprite on the selected frame. 43 | /// The index of the frame. 44 | /// The sprite of the selected frame. 45 | public Sprite GetFrame(int index) 46 | { 47 | return frames[index].Sprite; 48 | } 49 | 50 | /// Returns the duration (in frames) of the selected frame. 51 | /// The index of the frame. 52 | /// The duration in frames of the selected frame. 53 | public int GetFrameDuration(int index) 54 | { 55 | return frames[index].Duration; 56 | } 57 | 58 | /// Get the frame at the specified time using the animation frame rate. 59 | /// The time in seconds of the frame. 60 | /// The index of the frame at the desierd time. 61 | public int GetFrameAtTime(float time) 62 | { 63 | return GetFrameAtTime(time, fps); 64 | } 65 | 66 | /// Get the frame at the specified time using the specified frame rate. 67 | /// The time in seconds of the frame. 68 | /// The framerate to calculate the time. 69 | /// The index of the frame at the desired time and framerate. 70 | public int GetFrameAtTime(float time, int frameRate) 71 | { 72 | int index = 0; 73 | float timePerFrame = 1f / frameRate; 74 | float totalAnimationTime = totalDuration * timePerFrame; 75 | 76 | if (time >= totalAnimationTime) 77 | { 78 | index = frames.Count - 1; 79 | } 80 | else if (time <= 0) 81 | { 82 | index = 0; 83 | } 84 | else 85 | { 86 | int frameDurationCounter = 0; 87 | 88 | while (time >= timePerFrame) 89 | { 90 | time -= timePerFrame; 91 | frameDurationCounter++; 92 | 93 | if (frameDurationCounter >= frames[index].Duration) 94 | { 95 | index++; 96 | frameDurationCounter = 0; 97 | } 98 | } 99 | 100 | if (index >= frames.Count) 101 | { 102 | index = frames.Count - 1; 103 | } 104 | } 105 | 106 | return index; 107 | } 108 | 109 | /// Get the total duration of the animation in seconds using the animation frame rate. 110 | /// The animation duration in seconds. 111 | public float GetAnimationDurationInSeconds() 112 | { 113 | return GetAnimationDurationInSeconds(fps); 114 | } 115 | 116 | /// Get the total duration of the animation in seconds using the specified frame rate. 117 | /// The framerate to calculate the time. 118 | /// The animation duration in seconds. 119 | public float GetAnimationDurationInSeconds(int frameRate) 120 | { 121 | return (float)AnimationDuration / frameRate; 122 | } 123 | 124 | /// Get the frame index at the specified normalized time (between 0 and 1) using the animation frame rate. 125 | /// The normalized time (bestween 0 and 1) of the desired frame. 126 | /// The frame index of the frame. 127 | public int GetFrameAtNormalizedTime(float normalizedTime) 128 | { 129 | normalizedTime = Mathf.Clamp(normalizedTime, 0f, 1f); 130 | return GetFrameAtTime(totalDuration * (1f / fps) * normalizedTime, fps); 131 | } 132 | 133 | /// Get the frame index at the specified normalized time (between 0 and 1) using the specified frame rate. 134 | /// The normalized time (bestween 0 and 1) of the desired frame. 135 | /// The framerate to calculate the time. 136 | /// The frame index of the frame. 137 | public int GetFrameAtNormalizedTime(float normalizedTime, int frameRate) 138 | { 139 | normalizedTime = Mathf.Clamp(normalizedTime, 0f, 1f); 140 | return GetFrameAtTime(totalDuration * (1f / frameRate) * normalizedTime, frameRate); 141 | } 142 | 143 | #region Properties 144 | /// The framerate of the animation. 145 | public int FPS 146 | { 147 | get => fps; 148 | set => fps = value; 149 | } 150 | 151 | /// Frames on this animation. 152 | public int FramesCount 153 | { 154 | get => frames.Count; 155 | } 156 | 157 | /// List of frames. 158 | public List Frames 159 | { 160 | get => frames; 161 | set => frames = value; 162 | } 163 | 164 | /// List of custom actions added to the animation. 165 | public List Actions 166 | { 167 | get => actions; 168 | } 169 | 170 | /// The total duration of the animation (in frames). 171 | public int AnimationDuration 172 | { 173 | get => totalDuration; 174 | } 175 | #endregion 176 | } 177 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d77f76fefc0e73d4184cf86fd1488e0f 3 | timeCreated: 1481150128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimationAction.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using System; 5 | using UnityEngine; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | [Serializable] 10 | public class SpriteAnimationAction 11 | { 12 | #region Atributes 13 | [SerializeField] 14 | private int frame; 15 | [SerializeField] 16 | private string data; 17 | #endregion 18 | 19 | /// A class to serialize actions on a animation frame. 20 | /// The frame to call the action. 21 | /// A string defining the data of the action. 22 | public SpriteAnimationAction(int frame, string data) 23 | { 24 | this.frame = frame; 25 | this.data = data; 26 | } 27 | 28 | #region Properties 29 | /// The frame to call the action. 30 | public int Frame 31 | { 32 | get => frame; 33 | } 34 | 35 | /// The data that carries this action. 36 | public string Data 37 | { 38 | get => data; 39 | set => data = value; 40 | } 41 | #endregion 42 | } 43 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimationAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3205bfbefef6fd4cb5534d95d4010b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimationFrame.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using System; 5 | using UnityEngine; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | [Serializable] 10 | public class SpriteAnimationFrame 11 | { 12 | #region Atributes 13 | [SerializeField] 14 | private int duration; 15 | [SerializeField] 16 | private Sprite sprite; 17 | #endregion 18 | 19 | public SpriteAnimationFrame() { } 20 | 21 | public SpriteAnimationFrame(Sprite sprite, int duration) 22 | { 23 | this.duration = duration; 24 | this.sprite = sprite; 25 | } 26 | 27 | #region Properties 28 | public int Duration 29 | { 30 | get => duration; 31 | set => duration = value; 32 | } 33 | 34 | public Sprite Sprite 35 | { 36 | get => sprite; 37 | set => sprite = value; 38 | } 39 | #endregion 40 | } 41 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimationFrame.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ceb4f2e51cadd8948b3c348058f0c2f4 3 | timeCreated: 1487983894 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimator.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using System; 6 | 7 | namespace Elendow.SpritedowAnimator 8 | { 9 | /// Animator for Sprite Renderers. 10 | [AddComponentMenu("Spritedow/Sprite Animator")] 11 | [RequireComponent(typeof(SpriteRenderer))] 12 | public class SpriteAnimator : BaseAnimator 13 | { 14 | #region Attributes 15 | [NonSerialized] 16 | private SpriteRenderer spriteRenderer; 17 | #endregion 18 | 19 | protected override void Awake() 20 | { 21 | spriteRenderer = GetComponent(); 22 | base.Awake(); 23 | } 24 | 25 | /// Changes the sprite to the given sprite. 26 | /// The new sprite to render. 27 | protected override void ChangeFrame(Sprite frame) 28 | { 29 | base.ChangeFrame(frame); 30 | spriteRenderer.sprite = frame; 31 | } 32 | 33 | /// Enable or disable the renderer. 34 | /// True to enable the renderer. 35 | public override void SetActiveRenderer(bool active) 36 | { 37 | if (spriteRenderer == null) 38 | spriteRenderer = GetComponent(); 39 | spriteRenderer.enabled = active; 40 | } 41 | 42 | /// Flip the sprite on the X axis. 43 | /// True if the renderer must flip on the X axis. 44 | public override void FlipSpriteX(bool flip) 45 | { 46 | spriteRenderer.flipX = flip; 47 | } 48 | 49 | /// Flip the sprite on the Y axis. 50 | /// True if the renderer must flip on the Y axis. 51 | public override void FlipSpriteY(bool flip) 52 | { 53 | spriteRenderer.flipY = flip; 54 | } 55 | 56 | #region Properties 57 | /// The bounds of the Sprite Renderer. 58 | public Bounds SpriteBounds 59 | { 60 | get => spriteRenderer.bounds; 61 | } 62 | 63 | /// The Sprite Renderer used to render. 64 | public SpriteRenderer SpriteRenderer 65 | { 66 | get => spriteRenderer; 67 | } 68 | #endregion 69 | } 70 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13a111613b7e1c6498923b16a649bc4f 3 | timeCreated: 1481150127 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimatorEvent.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine.Events; 5 | 6 | namespace Elendow.SpritedowAnimator 7 | { 8 | /// 9 | /// UnityEvent with BaseAnimator as argument. 10 | /// 11 | [System.Serializable] 12 | public class SpriteAnimatorEvent : UnityEvent { } 13 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimatorEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 559f9c53191bc7642996a088aedf3325 3 | timeCreated: 1486583308 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimatorEventInfo.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | namespace Elendow.SpritedowAnimator 5 | { 6 | /// 7 | /// Struct used on the events dictionary to store animation and frame. 8 | /// 9 | public struct SpriteAnimatorEventInfo 10 | { 11 | public SpriteAnimation animation; 12 | public int frame; 13 | 14 | public SpriteAnimatorEventInfo(SpriteAnimation animation, int frame) 15 | { 16 | this.animation = animation; 17 | this.frame = frame; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/SpriteAnimatorEventInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 120b0a18e1323f44a8090df5917f3479 3 | timeCreated: 1486583308 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/UIAnimator.cs: -------------------------------------------------------------------------------- 1 | // Spritedow Animation Plugin by Elendow 2 | // https://elendow.com 3 | 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using System; 7 | 8 | namespace Elendow.SpritedowAnimator 9 | { 10 | /// Animator for Image from the Unity UI system. 11 | [AddComponentMenu("Spritedow/UI Image Animator")] 12 | [RequireComponent(typeof(Image))] 13 | public class UIAnimator : BaseAnimator 14 | { 15 | #region Attributes 16 | public bool preserveAspectRatio; 17 | private Image imageRenderer; 18 | #endregion 19 | 20 | protected override void Awake() 21 | { 22 | imageRenderer = GetComponent(); 23 | imageRenderer.preserveAspect = preserveAspectRatio; 24 | base.Awake(); 25 | } 26 | 27 | /// Changes the sprite to the given sprite. 28 | protected override void ChangeFrame(Sprite frame) 29 | { 30 | base.ChangeFrame(frame); 31 | if (frame != null) 32 | { 33 | imageRenderer.sprite = frame; 34 | imageRenderer.enabled = true; 35 | } 36 | else 37 | { 38 | imageRenderer.enabled = false; 39 | } 40 | 41 | } 42 | 43 | /// Enable or disable the renderer. 44 | public override void SetActiveRenderer(bool active) 45 | { 46 | if (imageRenderer == null) 47 | { 48 | imageRenderer = GetComponent(); 49 | } 50 | imageRenderer.enabled = active; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Source/Assets/SpritedowAnimator/Source/UIAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8ba661440e5a8549965568cad28b801 3 | timeCreated: 1481150128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Mon Nov 9 10:04:16 2020 3 | 4 | Packages were changed. 5 | Update Mode: resetToDefaultDependencies 6 | 7 | The following packages were added: 8 | com.unity.collab-proxy@1.3.7 9 | com.unity.ide.rider@1.2.1 10 | com.unity.ide.visualstudio@2.0.0 11 | com.unity.ide.vscode@1.1.4 12 | com.unity.modules.ai@1.0.0 13 | com.unity.modules.androidjni@1.0.0 14 | com.unity.modules.animation@1.0.0 15 | com.unity.modules.assetbundle@1.0.0 16 | com.unity.modules.audio@1.0.0 17 | com.unity.modules.cloth@1.0.0 18 | com.unity.modules.director@1.0.0 19 | com.unity.modules.imageconversion@1.0.0 20 | com.unity.modules.imgui@1.0.0 21 | com.unity.modules.jsonserialize@1.0.0 22 | com.unity.modules.particlesystem@1.0.0 23 | com.unity.modules.physics@1.0.0 24 | com.unity.modules.physics2d@1.0.0 25 | com.unity.modules.screencapture@1.0.0 26 | com.unity.modules.terrain@1.0.0 27 | com.unity.modules.terrainphysics@1.0.0 28 | com.unity.modules.tilemap@1.0.0 29 | com.unity.modules.ui@1.0.0 30 | com.unity.modules.uielements@1.0.0 31 | com.unity.modules.umbra@1.0.0 32 | com.unity.modules.unityanalytics@1.0.0 33 | com.unity.modules.unitywebrequest@1.0.0 34 | com.unity.modules.unitywebrequestassetbundle@1.0.0 35 | com.unity.modules.unitywebrequestaudio@1.0.0 36 | com.unity.modules.unitywebrequesttexture@1.0.0 37 | com.unity.modules.unitywebrequestwww@1.0.0 38 | com.unity.modules.vehicles@1.0.0 39 | com.unity.modules.video@1.0.0 40 | com.unity.modules.vr@1.0.0 41 | com.unity.modules.wind@1.0.0 42 | com.unity.modules.xr@1.0.0 43 | com.unity.test-framework@1.1.11 44 | com.unity.textmeshpro@3.0.0-preview.1 45 | com.unity.timeline@1.3.0 46 | com.unity.ugui@1.0.0 47 | 48 | === Mon Nov 8 20:04:59 2021 49 | 50 | Packages were changed. 51 | Update Mode: updateDependencies 52 | 53 | The following packages were updated: 54 | com.unity.collab-proxy from version 1.3.7 to 1.9.0 55 | com.unity.ide.rider from version 1.2.1 to 3.0.7 56 | com.unity.ide.visualstudio from version 2.0.0 to 2.0.11 57 | com.unity.ide.vscode from version 1.1.4 to 1.2.4 58 | com.unity.test-framework from version 1.1.11 to 1.1.29 59 | com.unity.textmeshpro from version 3.0.0-preview.1 to 3.0.6 60 | com.unity.timeline from version 1.3.0 to 1.6.2 61 | -------------------------------------------------------------------------------- /Source/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.16", 4 | "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.3", 5 | "com.unity.ugui": "1.0.0", 6 | "com.unity.modules.ai": "1.0.0", 7 | "com.unity.modules.androidjni": "1.0.0", 8 | "com.unity.modules.animation": "1.0.0", 9 | "com.unity.modules.assetbundle": "1.0.0", 10 | "com.unity.modules.audio": "1.0.0", 11 | "com.unity.modules.cloth": "1.0.0", 12 | "com.unity.modules.director": "1.0.0", 13 | "com.unity.modules.imageconversion": "1.0.0", 14 | "com.unity.modules.imgui": "1.0.0", 15 | "com.unity.modules.jsonserialize": "1.0.0", 16 | "com.unity.modules.particlesystem": "1.0.0", 17 | "com.unity.modules.physics": "1.0.0", 18 | "com.unity.modules.physics2d": "1.0.0", 19 | "com.unity.modules.screencapture": "1.0.0", 20 | "com.unity.modules.terrain": "1.0.0", 21 | "com.unity.modules.terrainphysics": "1.0.0", 22 | "com.unity.modules.tilemap": "1.0.0", 23 | "com.unity.modules.ui": "1.0.0", 24 | "com.unity.modules.uielements": "1.0.0", 25 | "com.unity.modules.umbra": "1.0.0", 26 | "com.unity.modules.unityanalytics": "1.0.0", 27 | "com.unity.modules.unitywebrequest": "1.0.0", 28 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 29 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 30 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 31 | "com.unity.modules.unitywebrequestwww": "1.0.0", 32 | "com.unity.modules.vehicles": "1.0.0", 33 | "com.unity.modules.video": "1.0.0", 34 | "com.unity.modules.vr": "1.0.0", 35 | "com.unity.modules.wind": "1.0.0", 36 | "com.unity.modules.xr": "1.0.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 22424703114646681d1c053615275007371911272d3c2922620c0532eff0383df1a806e5e62e39332b0fea2e21260032e2060c44c5080f05141db23e1dfe04151ed715c008ed071dc60910cb8308dfeac1cf 10 | flags: 0 11 | RecentlyUsedScenePath-1: 12 | value: 22424703114646681d1c053615275007371911272d3c2922620c0532eff0383df1a813ffe2342b192103e22c083b4e0cf10f070ee5442f1d1400e92b09fe1d031dc056d014c10b05 13 | flags: 0 14 | vcSharedLogLevel: 15 | value: 0a5f5209 16 | flags: 0 17 | m_VCAutomaticAdd: 1 18 | m_VCDebugCom: 0 19 | m_VCDebugCmd: 0 20 | m_VCDebugOut: 0 21 | m_SemanticMergeMode: 2 22 | m_VCShowFailedCheckout: 1 23 | m_VCOverwriteFailedCheckoutAssets: 1 24 | m_VCProjectOverlayIcons: 1 25 | m_VCHierarchyOverlayIcons: 1 26 | m_VCOtherOverlayIcons: 1 27 | m_VCAllowAsyncUpdate: 1 28 | -------------------------------------------------------------------------------- /Source/obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /Source/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SpritedowAnimator.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elendow/SpritedowAnimator/d2c653aa1de07e6549b661defa0fa0279f07028a/SpritedowAnimator.unitypackage --------------------------------------------------------------------------------