void StartEditingExistingProxy(EventProxyFileDetails details) { currentDefinition.FolderPath = details.projectPath.Substring(0, details.projectPath.Length - (details.className.Length + 3)); currentDefinition.Name = details.className; currentDefinition.PublicMethodName = details.methodName; currentDefinition.NameSpace = details.nameSpace; _currentFileDetails = details; }
void OnGUI_DoEditableEnumItem(string filePath, EventProxyFileDetails details) { bool _isCurrentlyEdited = (currentDefinition.FolderPath + currentDefinition.Name + ".cs").Equals(details.projectPath); // check if this is the item we are currently editing if (_isCurrentlyEdited) { _currentFileDetails = details; GUI.color = Color.green; } GUILayout.BeginHorizontal("box", GUILayout.ExpandHeight(false)); GUI.color = Color.white; string _label = details.nameSpace + "." + details.methodName; if (details.methodParamType != PlayMakerEventProxyCreator.ParameterType.none) { _label += " (" + details.methodParamType + " parameter)"; } GUILayout.Label(_label); GUILayout.FlexibleSpace(); if (GUILayout.Button("Select in Project", "MiniButton")) { var _object = AssetDatabase.LoadAssetAtPath("Assets/" + details.projectPath, typeof(UnityEngine.Object)); EditorGUIUtility.PingObject(_object.GetInstanceID()); Selection.activeInstanceID = _object.GetInstanceID(); } if (!_isCurrentlyEdited) { if (GUILayout.Button("Edit", "MiniButton", GUILayout.Width(40))) { StartEditingExistingProxy(details); } } else { GUI.color = Color.yellow; if (GUILayout.Button("Cancel", "MiniButton", GUILayout.Width(40))) { StartEditingExistingProxy(details); } GUI.color = Color.white; } GUILayout.EndHorizontal(); }