Exemplo n.º 1
0
        private void OnGUI()
        {
            if (!FindCustomSlot())
            {
                return;
            }
            GUILayout.Space(20);

            EditorGUILayout.LabelField("Quick Tool (" + slot.name + ")");
            GUILayout.Space(10);
            if (GUILayout.Button("Refresh Layout"))
            {
                slot.layout.Refresh();
                EditorUtility.SetDirty(slot);
            }
            SymbolGen gen = slot.symbolGen;

            GUILayout.Space(10);
            if (GUILayout.Button("Open SymbolGen Window"))
            {
                SymbolGenEditorWindow window = GetWindow <SymbolGenEditorWindow>("SymbolGen");
                window.slot = slot;
            }
            GUILayout.Space(10);
            if (GUILayout.Button("Generate new Loadout"))
            {
                if (gen.setting.confirmGeneration && !EditorUtility.DisplayDialog("Warning", "Generating new loadout will replace the current symbol loadout. ", "Yes", "No!"))
                {
                }
                else
                {
                    gen.Generate();
                }
            }

            PayTableGen ptg = slot.GetComponent <PayTableGen>();

            if (ptg)
            {
                GUILayout.Space(10);
                if (GUILayout.Button("Generate PayTable"))
                {
                    ptg.Generate();
                    EditorUtility.SetDirty(ptg);
                }
            }
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            CustomSlot t = target as CustomSlot;

            GUILayout.Space(20);
            if (GUILayout.Button("Refresh Layout"))
            {
                t.layout.Refresh();
                EditorUtility.SetDirty(t);
            }
            if (GUILayout.Button("Open SymbolGen Window"))
            {
                SymbolGenEditorWindow window = EditorWindow.GetWindow <SymbolGenEditorWindow>("SymbolGen");
                window.slot = t;
            }
            if (GUILayout.Button("Open Quick Tool Window"))
            {
                ShortcutToolEditorWindow window = EditorWindow.GetWindow <ShortcutToolEditorWindow>("Quick Tool");
                window.slot = t;
            }
        }