Exemplo n.º 1
0
        public void SetState(UIStateScriptable state, bool isActive = true)
        {
            _proc = state.Hash;
            int index = _states.IndexOf(IsEqual);

            if (index < 0)
            {
                _states.Add(new RuntimeState()
                {
                    Scriptable = state, Layer = NotSharedLayer, Active = isActive
                });
                return;
            }
            _layer = _states[index].Layer;
            _states.ForEach(DisableIfNecessary);
            _states[index].Active = isActive;
        }
Exemplo n.º 2
0
        public void RegisterState(UIStateScriptable state, int layer = NotSharedLayer)
        {
            _proc = state.Hash;
            int index = _states.IndexOf(IsEqual);

            if (index < 0)
            {
                _states.Add(new RuntimeState()
                {
                    Scriptable = state, Layer = layer, Active = false
                });
            }
            else if (layer >= 0)
            {
                _states[index].Layer = layer;
            }
        }
Exemplo n.º 3
0
 public bool IsStateActive(UIStateScriptable state)
 {
     _proc = state.Hash;
     return(_states.Any(IsActive));
 }