Example #1
0
        public static void CreateWindow(Vector2 r, CustomIconsDatabase database, string selectedGUID, Object selectedObj)
        {
            if (w != null)
            {
                w.Close();
            }

            w = (CustomIconsWindow)DisplayWizard("Custom Asset Icon", typeof(CustomIconsWindow), "");
            CustomIconsWindow.selectedGUID = selectedGUID;
            CustomIconsWindow.selectedObj  = selectedObj;

            selectedTex    = null;
            selectedTex_16 = null;

            Vector2 size = new Vector2(300, 220);

            Rect correctedRect = new Rect(r.x, r.y, 300, 200);

            correctedRect.y -= correctedRect.size.y + 15;
            correctedRect.x -= 20;
            w.position       = correctedRect;
            w.maxSize        = size;
            w.minSize        = size;

            databaseRef   = database;
            databaseIndex = databaseRef.ContainsGUID(selectedGUID);

            if (databaseRef != null && databaseIndex != -1)
            {
                databaseRef.SetName(databaseIndex, selectedObj.name);
            }

            CreateStyles();
        }
Example #2
0
        private void OnEnable() //EN CASO DE QUE PIERDA REFS AL RECARGAR
        {
            if (databaseRef == null)
            {
                databaseRef = CustomIconsDrawer.GetDatabase();
            }

            databaseIndex = databaseRef.ContainsGUID(selectedGUID);
            if (databaseIndex != -1)
            {
                databaseRef.SetName(databaseIndex, selectedObj.name);
            }
        }