mirror of https://github.com/SolarLune/tetra3d.git
Merge pull request #31 from karl-tye/karl-tye/play-animation-error
Only Return Error on Animation Not Foundmain
commit
03b14876c9
|
@ -375,10 +375,11 @@ func (ap *AnimationPlayer) PlayAnim(animation *Animation) {
|
|||
// it will return an error.
|
||||
func (ap *AnimationPlayer) Play(animationName string) error {
|
||||
anim, ok := ap.RootNode.Library().Animations[animationName]
|
||||
if ok {
|
||||
ap.PlayAnim(anim)
|
||||
if !ok {
|
||||
return errors.New("Animation named {" + animationName + "} not found in node's owning Library")
|
||||
}
|
||||
return errors.New("Animation named {" + animationName + "} not found in node's owning Library")
|
||||
ap.PlayAnim(anim)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Stop stops the AnimationPlayer's playback. Note that this is fundamentally the same as calling ap.Playing = false (for now).
|
||||
|
|
|
@ -4,8 +4,6 @@ import (
|
|||
"bytes"
|
||||
"embed"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/solarlune/tetra3d"
|
||||
"github.com/solarlune/tetra3d/colors"
|
||||
"github.com/solarlune/tetra3d/examples"
|
||||
|
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
|
||||
"github.com/solarlune/tetra3d"
|
||||
"github.com/solarlune/tetra3d/colors"
|
||||
|
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
|
||||
"github.com/solarlune/tetra3d"
|
||||
"github.com/solarlune/tetra3d/colors"
|
||||
|
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
|
||||
"github.com/solarlune/tetra3d"
|
||||
"github.com/solarlune/tetra3d/colors"
|
||||
|
|
|
@ -4,8 +4,6 @@ import (
|
|||
"embed"
|
||||
"strings"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/solarlune/tetra3d"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
|
|
Loading…
Reference in New Issue