-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Included composite animations samples and removed a Debug.Log message that was logging when the animation ended.
- Loading branch information
Showing
13 changed files
with
555 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Assets/SpriteAnimations/Runtime/Scripts/Sampling/CompositeAnimationOnDemand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
namespace SpriteAnimations.Sampling | ||
{ | ||
public class CompositeAnimationOnDemand : MonoBehaviour | ||
{ | ||
public SpriteAnimator _animator; | ||
public int _fps; | ||
|
||
public List<Sprite> _antecipationCycle; | ||
public List<Sprite> _coreCycle; | ||
public List<Sprite> _recoveryCycle; | ||
|
||
private SpriteAnimationComposite _animation; | ||
|
||
private void Awake() | ||
{ | ||
_animation = SpriteAnimationComposite.OnDemand(_fps, _antecipationCycle, _coreCycle, _recoveryCycle); | ||
} | ||
|
||
private void Start() | ||
{ | ||
_animator.Play<CompositeAnimator>(_animation).SetOnEnd(() => | ||
{ | ||
_animator.Play<CompositeAnimator>(_animation).FromStart(); | ||
}); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/SpriteAnimations/Runtime/Scripts/Sampling/CompositeAnimationOnDemand.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
Assets/SpriteAnimations/Runtime/Scripts/Sampling/CompositeAnimationTemplate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
namespace SpriteAnimations.Sampling | ||
{ | ||
public class CompositeAnimationTemplate : MonoBehaviour | ||
{ | ||
public SpriteAnimator _animator; | ||
public SpriteAnimationComposite _template; | ||
|
||
public List<Sprite> _antecipationCycle; | ||
public List<Sprite> _coreCycle; | ||
public List<Sprite> _recoveryCycle; | ||
|
||
private SpriteAnimationComposite _animation; | ||
|
||
private void Awake() | ||
{ | ||
_animation = _template.UseAsTemplate(_antecipationCycle, _coreCycle, _recoveryCycle); | ||
} | ||
|
||
private void Start() | ||
{ | ||
_animator.Play<CompositeAnimator>(_animation).SetOnEnd(() => | ||
{ | ||
_animator.Play<CompositeAnimator>(_animation).FromStart(); | ||
}); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/SpriteAnimations/Runtime/Scripts/Sampling/CompositeAnimationTemplate.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
Assets/SpriteAnimations/Samples/Composite/Animations/Slide_Template.asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 8bed12526f9ecb043ba63c51bdace746, type: 3} | ||
m_Name: Slide_Template | ||
m_EditorClassIdentifier: | ||
_animationName: Slide_Template | ||
_fps: 8 | ||
_antecipationCycle: | ||
_animation: {fileID: 11400000} | ||
_frames: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
_identifiable: 1 | ||
_coreCycle: | ||
_animation: {fileID: 11400000} | ||
_frames: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
_identifiable: 1 | ||
_recoveryCycle: | ||
_animation: {fileID: 11400000} | ||
_frames: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
- _sprite: {fileID: 21300000, guid: d107f48ed94e4f44a87ace124b74a53d, type: 3} | ||
_id: | ||
_identifiable: 1 | ||
_loopableCore: 1 |
8 changes: 8 additions & 0 deletions
8
Assets/SpriteAnimations/Samples/Composite/Animations/Slide_Template.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.