Exemplo n.º 1
0
    public static void ShowIsoSettingsPopup(IsoSettings instance)
    {
        if (EditorUtility.DisplayDialog("IsoSettings not configured","IsoSettings seems to be not configured properly. ¿Go to IsoSettings? (Ignoring can cause unexpected bugs...)", "Show", "Ignore"))
        {
            Selection.activeObject = instance;
        }

        if (showAgain)
        {
            if (popupActive != null)
                return;

            popupActive = EditorWindow.GetWindow(typeof(IsoSettingsPopup)) as IsoSettingsPopup;
            popupActive.instance = instance;
        }
    }
Exemplo n.º 2
0
    public static void ShowIsoSettingsPopup(IsoSettings instance)
    {
        if (EditorUtility.DisplayDialog("IsoSettings not configured", "IsoSettings seems to be not configured properly. ¿Go to IsoSettings? (Ignoring can cause unexpected bugs...)", "Show", "Ignore"))
        {
            Selection.activeObject = instance;
        }

        if (showAgain)
        {
            if (popupActive != null)
            {
                return;
            }

            popupActive          = EditorWindow.GetWindow(typeof(IsoSettingsPopup)) as IsoSettingsPopup;
            popupActive.instance = instance;
        }
    }
Exemplo n.º 3
0
    void OnEnable()
    {
        this.map = (Map)target;

        /*this.modules = new MapEditorModule[]{
         *      new NothingModule(),
         *      new EditModule(),
         *      new PaintModule(),
         *      new DecorateModule(),
         *      new EntityModule()
         * };*/
        List <MapEditorModule> modules = new List <MapEditorModule>();

        var type = typeof(MapEditorModule);

        Assembly[] assembly = AppDomain.CurrentDomain.GetAssemblies();
        foreach (Assembly a in assembly)
        {
            foreach (Type t in a.GetTypes())
            {
                if (type.IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract)
                {
                    modules.Add(Activator.CreateInstance(t) as MapEditorModule);
                }
            }
        }

        modules.Sort(new ModuleComparision());

        this.modules = modules.ToArray() as MapEditorModule[];

        this.selected = 0;

        toolBarStyle        = new GUIStyle();
        toolBarStyle.margin = new RectOffset(50, 50, 5, 10);

        IsoSettings iso = IsoSettingsManager.getInstance().getIsoSettings();

        if (!iso.Configured)
        {
            IsoSettingsPopup.ShowIsoSettingsPopup(iso);
        }
    }