PUN Classic (v1)、PUN 2 和 Bolt 處於維護模式。 PUN 2 將支援 Unity 2019 至 2022,但不會添加新功能。 當然,您所有的 PUN & Bolt 專案可以用已知性能繼續運行使用。 對於任何即將開始或新的專案:請切換到 Photon Fusion 或 Quantum。

Animation

If you want to use your animation to process physics or logic, you should enable Always Animate on the Culling Mode of the animator. If you decide you do not want to use the built in Animator support in Bolt you could also just subscribe to state changes and apply the changes to the animator state machine.

For example:

C#

public class MyPlayerController : Bolt.EntityBehaviour<IPlayerState>
{
    private Animator anim;

    private void Start ()
    {
        anim = GetComponent<Animator>();
    }

    public override void Attached()
    {
        BoltConsole.Write("Player Attached");

        state.AddCallback("walking", () => {
            anim.SetBool("walking", state.walking);
        });

        state.AddCallback("dead", () => {
            anim.SetBool("dead", state.dead);
        });
    }
}
Back to top