private void ShowState()
    {
        state = rhandor.GetState();
        Vector3 draw_pos = new Vector3(rhandor.transform.position.x, 0, rhandor.transform.position.z - 1);

        //Show the current state in the editor
        if (state == rhandor.idle_state)
        {
            Handles.Label(draw_pos, "IDLE");
        }
        else if (state == rhandor.patrol_state)
        {
            Handles.Label(draw_pos, "PATROL");
        }
        else if (state == rhandor.alert_state)
        {
            Handles.Label(draw_pos, "ALERT");
        }
        else if (state == rhandor.spotted_state)
        {
            Handles.Label(draw_pos, "SPOTTED");
        }
        else if (state == rhandor.support_state)
        {
            Handles.Label(draw_pos, "SUPPORT");
        }
        else if (state == rhandor.corpse_state)
        {
            Handles.Label(draw_pos, "CORPSE");
        }
        else
        {
            Handles.Label(draw_pos, "UNKNOWN");
        }
    }
예제 #2
0
 public void ChangeStateTo(IRhandorStates new_state)
 {
     current_state = new_state;
     current_state.StartState();
 }