mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-17 20:41:38 +08:00
Remove before adding to mix map.
Because it would be *crazy* to want to overwrite an existing map entry, and it's always better to do moar map lookups.
This commit is contained in:
parent
5b346095cf
commit
e98caf2c50
@ -46,7 +46,9 @@ namespace Spine {
|
||||
public void SetMix (Animation from, Animation to, float duration) {
|
||||
if (from == null) throw new ArgumentNullException("from cannot be null.");
|
||||
if (to == null) throw new ArgumentNullException("to cannot be null.");
|
||||
animationToMixTime.Add(new KeyValuePair<Animation, Animation>(from, to), duration);
|
||||
KeyValuePair<Animation, Animation> key = new KeyValuePair<Animation, Animation>(from, to);
|
||||
animationToMixTime.Remove(key);
|
||||
animationToMixTime.Add(key, duration);
|
||||
}
|
||||
|
||||
public float GetMix (Animation from, Animation to) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user