Exemplo n.º 1
0
    static StatechartEngine GetInstance()
    {
        if (dead)
        {
            return(null);
        }

        if (instance == null)
        {
            GameObject obj = new GameObject();
            DontDestroyOnLoad(obj);
            instance = obj.AddComponent <StatechartEngine>();
        }
        return(instance);
    }
Exemplo n.º 2
0
 void OnDisable()
 {
     StatechartEngine.RemoveInstance(this);
 }
Exemplo n.º 3
0
 void OnEnable()
 {
     StatechartEngine.AddInstance(this);
 }