Skip to content

Commit

Permalink
Fixed range or_greater, or_lower, cleaned up.
Browse files Browse the repository at this point in the history
  • Loading branch information
JarkkoPar committed Oct 9, 2023
1 parent afd48b5 commit b28a505
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 49 deletions.
2 changes: 1 addition & 1 deletion UtilityAIConsideration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void UtilityAIConsideration::_bind_methods() {

ClassDB::bind_method(D_METHOD("set_activation_input_value", "activation_input_value"), &UtilityAIConsideration::set_activation_input_value);
ClassDB::bind_method(D_METHOD("get_activation_input_value"), &UtilityAIConsideration::get_activation_input_value);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "activation_input_value", PROPERTY_HINT_RANGE, "0.0,1.0,allow_lower,allow_greater"), "set_activation_input_value","get_activation_input_value");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "activation_input_value", PROPERTY_HINT_RANGE, "0.0,1.0,or_less,or_greater"), "set_activation_input_value","get_activation_input_value");

}

Expand Down
47 changes: 0 additions & 47 deletions UtilityAISensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,51 +34,4 @@ double UtilityAISensor::evaluate_sensor_value() {
// Getters and Setters.



/**
// Godot virtuals.
/**
void UtilityAISensor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
// Entered the tree.
} break;
case NOTIFICATION_EXIT_TREE: {
} break;
}
}
void UtilityAISensor::_ready() {
if( !_is_active ) return;
if( Engine::get_singleton()->is_editor_hint() ) return;
// Get the first state as the first child node and enter it.
ERR_FAIL_COND_MSG( get_child_count() < 1, "UtilityAISensor error, no child nodes (states) have been added to the UtilityAISensor '" + get_name() + "'.");
_current_state = Object::cast_to<UtilityAISensorState>(get_child(0));
ERR_FAIL_COND_MSG( _current_state == nullptr, "UtilityAISensor error, the first child is not a UtilityAISensorState node.");
_current_state->_enter_state();
}
void UtilityAISensor::_process(double delta ) {
//if( _update_method != UtilityAISensor_UPDATE_METHOD_PROCESS ) return;
if( !_is_active ) return;
if( Engine::get_singleton()->is_editor_hint() ) return;
if( _current_state == nullptr ) return;
_current_state->_state_process(delta);
//_current_state->_state_execute_Sensor(delta);
}
void UtilityAISensor::_physics_process(double delta ) {
//if( _update_method != UtilityAISensor_UPDATE_METHOD_PHYSICS_PROCESS ) return;
if( !_is_active ) return;
if( Engine::get_singleton()->is_editor_hint() ) return;
if( _current_state == nullptr ) return;
_current_state->_state_physics_process(delta);
//_current_state->_state_execute_Sensor(delta);
}
/**/
2 changes: 1 addition & 1 deletion UtilityAISensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace godot;
void UtilityAISensors::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_sensor_value", "sensor_value"), &UtilityAISensors::set_sensor_value);
ClassDB::bind_method(D_METHOD("get_sensor_value"), &UtilityAISensors::get_sensor_value);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sensor_value", PROPERTY_HINT_RANGE, "0.0,1.0,allow_greater,allow_lower"), "set_sensor_value","get_sensor_value");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sensor_value", PROPERTY_HINT_RANGE, "0.0,1.0"), "set_sensor_value","get_sensor_value");

}

Expand Down

0 comments on commit b28a505

Please sign in to comment.