Skip to content

tomori-hikage/state-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license release GitHub Twitter

state-machine

Description

state-machineはUniRxをベースにしたステートマシンです

Install

UnityPackage

releases からstate-machine.unitypackageをダウンロードしてプロジェクトにインポートしてください

UPM Package

GitHubから追加

Unity2019.4以上はGitHubから直接追加できます。この方法はPackage Managerから更新を受け取れないので手動で更新します。

  • Package Managerを開きます
  • +をクリックします
  • Add from Git URLを選択します
  • https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts を貼り付けます
  • Addをクリックします
  • https://github.com/tomori-hikage/state-machine.git?path=state-machine/Assets/StateMachine を貼り付けます
  • Addをクリックします

Example

using UnityEngine;
using UniRx;
using HC.AI;


[DisallowMultipleComponent]
public class Example : State
{
    #region event

    private void Start()
    {
        BeginStream.Subscribe(_ => Debug.Log("State Begin"));
        UpdateStream.Subscribe(_ => Debug.Log("State Update"));
        FixedUpdateStream.Subscribe(_ => Debug.Log("State FixedUpdate"));
        LateUpdateStream.Subscribe(_ => Debug.Log("State LateUpdate"));
        EndStream.Subscribe(_ => Debug.Log("State End"));
        OnDrawGizmosStream.Subscribe(_ => Debug.Log("State OnDrawGizmos"));
        OnGUIStream.Subscribe(_ => Debug.Log("State OnGUI"));
    }

    #endregion
}

Author

Use License

state-machineはUniRxをベースに作成しています

Copyright (c) 2014 Yoshifumi Kawai

© Unity Technologies Japan/UCL