public void RemoveEffectEditor(Property_GS_Editor target_effect_editor) { //First search property editor for (int k = 0; k < _effect_editors_num; k++) { if (_effect_editors[k] == target_effect_editor) { //Last effect editor case if (k == _effect_editors.Length - 1) { _effect_editors[k] = null; } else { //When property is found copy values in front of it a slot backwards for (int n = k; n < _effect_editors.Length - 1; n++) { _effect_editors[n] = _effect_editors[n + 1]; } } //Update effect editors count _effect_editors_num -= 1; //Reset window size _target_action_node.window_size = Vector2.zero; //Mark scene dirty EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene()); //Job is done we dont need to continue the iteration return; } } //Porperty editor not found case Debug.LogWarning("Effect: " + target_effect_editor.target_property.A_key + " not found on remove!"); }
private void AddConditionEditor(Property_GS condition) { if (condition == null) { return; } //Generate an editor for the new condition Property_GS_Editor property_editor = new Property_GS_Editor(condition, this, _target_action_node.agent.blackboard, PropertyUIMode.IS_CONDITION); //Add the editor to the correct array _condition_editors[_condition_editors_num] = property_editor; //Update condition editors count _condition_editors_num += 1; }
private void AddEffectEditor(Property_GS effect) { if (effect == null) { return; } //Generate an editor for the new condition Property_GS_Editor property_editor = new Property_GS_Editor(effect, this, _target_action_node.agent.blackboard, PropertyUIMode.IS_EFFECT); //Add the editor to the correct array _effect_editors[_effect_editors_num] = property_editor; //Update effect editors count _effect_editors_num += 1; }