Exemplo n.º 1
0
    public static void OpenWithAsset(TextAsset textAsset)
    {
        OOFormEditor window = (OOFormEditor)ScriptableObject.CreateInstance(typeof(OOFormEditor));

        window.SetAsset(textAsset);
        window.Show();
    }
Exemplo n.º 2
0
    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);
        }
    }