public void ChangeState(string newState, bool startState = true)
    {
        Debug.Log("Changing States: AudienceState-" + newState);

        switch (newState)
        {
        case "Idle":
            currentState = idleState;
            break;

        case "Focused":
            currentState = focusedState;
            break;


        case "Exit":
            currentState = exitState;
            break;
        }

        if (startState)
        {
            currentState.StartState(this);
        }
    }
예제 #2
0
        public IAudienceState Get(string id)
        {
            IAudienceState state = CurrentSession.Get <AudienceState> (id);

            if (state == null)
            {
                state = new AudienceState();
                (state as AudienceState).ClientId = id;
            }
            return(state);
        }
        public IAudienceState Get(string id, bool nullAllowed)
        {
            IAudienceState state = CurrentSession.Get <AudienceState> (id);

            if (!nullAllowed && state == null)
            {
                state = new AudienceState();
                (state as AudienceState).ClientId = id;
            }
            if (ReadOnlyProxyGenerator != null && state != null)
            {
                return(ReadOnlyProxyGenerator.CreateProxy <IAudienceState>(state, new Type[] {  }, _readOnlyPropertyNames));
            }
            return(state);
        }
    public void ChangeState(AudienceStates newState, bool startState = true)
    {
        switch (newState)
        {
        case AudienceStates.AUDIENCE_IDLE:
            currentState = idleState;
            break;

        case AudienceStates.AUDIENCE_FOCUSED:
            currentState = focusedState;
            break;

        case AudienceStates.AUDIENCE_EXIT:
            currentState = exitState;
            break;
        }

        if (startState)
        {
            currentState.StartState(this);
        }
    }
 public void VisualizeState(AudienceState audienceState)
 {
     WriteText(audienceState.ToString());
 }
 public AudienceStateChangedEvent(AudienceState previousState, AudienceState currentState)
 {
     PreviousState = previousState;
     CurrentState  = currentState;
 }