private int _B_key_dropdown_slot = -1; //B key dropdown slot //Contructors ================= public PropertySelectMenu_GS(ActionNode_GS_Editor new_target_action_node_editor, PropertyUIMode new_property_UI_mode) { //Set property UI mode _property_UI_mode = new_property_UI_mode; //Set menu title if (_property_UI_mode == PropertyUIMode.IS_CONDITION) { //Condition title case _menu_title = "Condition Select"; } else if (_property_UI_mode == PropertyUIMode.IS_EFFECT) { //Effect title case _menu_title = "Effect Select"; } //Set the action node is this menu working with _target_action_node_editor = new_target_action_node_editor; //Get local blackboard variables keys string[] local_keys = NodeEditor_GS.Instance.selected_agent.blackboard.GetKeys(); //Get global blackboard variables keys string[] global_keys = GlobalBlackboard_GS.blackboard.GetKeys(); //Allocate string array to store all the keys _A_variable_keys = new string[local_keys.Length + global_keys.Length]; _original_A_variable_keys = new string[local_keys.Length + global_keys.Length]; //Add the local keys with a prefix for the dropdown for (int k = 0; k < local_keys.Length; k++) { _A_variable_keys[k] = "Local/" + local_keys[k]; _original_A_variable_keys[k] = local_keys[k]; } //Add the global keys with a prefix for the dropdown for (int k = local_keys.Length, i = 0; k < _A_variable_keys.Length; k++, i++) { _A_variable_keys[k] = "Global/" + global_keys[i]; _original_A_variable_keys[k] = global_keys[i]; } //Get dropdown slots _A_key_dropdown_slot = ProTools.GetDropdownSlot(); _operator_dropdown_slot = ProTools.GetDropdownSlot(); _B_key_dropdown_slot = ProTools.GetDropdownSlot(); }
private object value = null; //Value selected by user in property using value case //Constructors public Property_GS_Editor(Property_GS new_property, ActionNode_GS_Editor new_action_node_editor, Blackboard_GS new_bb, PropertyUIMode new_ui_mode) { //Set target property _target_property = new_property; //Set target action node editor _target_action_node_editor = new_action_node_editor; //Set property editor UI mode _property_UI_mode = new_ui_mode; //Allocate the valid operators if (_property_UI_mode == PropertyUIMode.IS_CONDITION) { _valid_operators = _target_property.variable_type.GetValidPassiveOperatorTypes(); } else if (_property_UI_mode == PropertyUIMode.IS_EFFECT) { _valid_operators = _target_property.variable_type.GetValidActiveOperatorTypes(); } //Check if the target property has a B key to adapt UI edit_value = string.IsNullOrEmpty(_target_property.B_key); }