Baste-RainGames / AnimationPlayer

An animation player for Unity, to replace the Animator/AnimatorController.
MIT License
89 stars 7 forks source link

AnimationPlayer

An animation player for Unity, to replace the Animator/AnimatorController.

Very much WIP! I'm developing this to use in a real Unity game, to ease the workload for implementing animations in that game.

This means that this isn't in any way stable! Use at your own caution, don't expect upgrades to work yet.

Installation

Minimum required Unity version is 2018.4

Add this line to Packages/manifest.json: "com.baste.animationplayer": "https://github.com/Baste-RainGames/AnimationPlayer.git"

See this forum thread on the Unity forums for info about getting packages from urls: https://forum.unity.com/threads/git-support-on-package-manager.573673/

If you want to make changes to the projects (to fork or for pull requests), you would clone this project into some other Unity project's Packages folder. If that project is already under project control with git, you'd instead add it as a submodule in the same location.

Core idea

The AnimationPlayer is a Unity Component which is used to play animations. Like the built-in Animator Controller, you define both which animations states exist, and how to transition between them.

Unlike the AnimatorController, the AnimationPlayer does not listen for variables to trigger transitions between states. Instead, you tell it to play a state. The AnimationPlayer checks if there's a transition defined from the current state to the state you told it to play. If a transition is defined, it's used. If not, a (user-defined) default transition is used.

This both makes the API a lot simpler, and makes the player a lot less bug prone. When you call Play("Attack"), you're guaranteed that the animation player will start transitioning to "Attack" right away.

Both animators and the programmers should at all times feel like they know what's going on.

Goals (long term)

Contributions

Yes, please! If you have a bug fix, or have a feature, I'd be happy to take pull requests! If you submit one, It'd be great if you could try to at least vaguely follow the code style (four spaces for indents, brackets on the next line)

Before you start working on something, please check Assets/Docs/ATTODO.txt, which contains a more comprehensive list of tasks I'm working on. If the thing you want to do is listed there, I might already have finished it, but not moved it over from the game I'm working on to this repository. Also, if you have an idea for a feature that's not listed under Goals above or in ATTODO, it's probably a good idea to create an issue on Github to ask if it's something I think fits the project.

Motivation, aka. "Why I think you need to replace the AnimatorController in the first place."

See Docs/Motivation.txt if you care