static void MenuFunction0() { string path = "Assets/OOForm/Demos/DemoTables.asset"; OOFormManager manager = AssetDatabase.LoadAssetAtPath(path, typeof(OOFormManager)) as OOFormManager; if (manager) { OOFormManagerPop.InitWithManager(manager); } }
public override void OnInspectorGUI() { if (mTarget == null) { mTarget = (OOFormManager)target; } if (GUILayout.Button("Open Manager...")) { OOFormManagerPop.InitWithManager(mTarget); } GUILayout.Space(10); for (int i = 0; i < mTarget.mTableList.Count; i++) { if (mTarget.mTableList[i] == null) { mTarget.mTableList.RemoveAt(i); break; } GUILayout.BeginHorizontal(); mTarget.mTableList[i] = (TextAsset)EditorGUILayout.ObjectField(mTarget.mTableList[i], typeof(UnityEngine.TextAsset), false); if (GUILayout.Button("Open")) { //OOFormEditor.InitWithAsset(mTarget.mTableList[i] ); //OOFormManagerPop.InitWithManager(mTarget, i); OOFormEditor.OpenWithAsset(mTarget.mTableList[i]); } if (OOFormOption.mHasOtherEditor) { if (GUILayout.Button("Other")) { OpenWithExcel(mTarget.mTableList[i]); } } if (GUILayout.Button("X", GUILayout.Width(20))) { mTarget.mTableList.RemoveAt(i); } GUILayout.EndHorizontal(); } if (Event.current.type == EventType.DragExited) { AddObjects(DragAndDrop.objectReferences); } }
/// <summary> /// /// </summary> /// <param name="formManager"></param> /// <param name="idx"></param> public static void InitWithManager(OOFormManager formManager, int idx) { window = (OOFormManagerPop)EditorWindow.GetWindow(typeof(OOFormManagerPop)); window.mFormManager = formManager; window.ShowTableData(idx); }
public static void InitWithAsset() { window = (OOFormManagerPop)EditorWindow.GetWindow(typeof(OOFormManagerPop)); }