private void DrawButtons() { if (GUILayout.Button("Preview")) { ImageRefresher = ThemeCreator.gameObject.GetComponentInChildren <RefreshImage>(); if (ImageRefresher != null) { ThemeCreator.ThemePreviewImg = ImageRefresher.GetComponent <Image>(); ThemeCreator.ImageRefresher = ImageRefresher; Debug.Log("Update Preview Material: You may need to hit Ctrl+S to see changes!"); } ThemeCreator.ThemePreviewImg.material = ThemeCreator.ThemePreviewMaterial; ThemeCreator.ThemePreviewImg.SetAllDirty(); ThemeCreator.ImageRefresher.NeedsRefresh = true; Selection.activeObject = ThemeCreator.ThemePreviewImg.gameObject; } if (GUILayout.Button("Build")) { if (String.IsNullOrEmpty(ThemeName)) { InvalidName = true; Debug.Log("Cannot build theme, invalid name!"); } else { InvalidName = false; CheckForExportedThemeFolderThenBuild(TargetWindow); Debug.Log($"Built theme: {ThemeName}"); } } }
private void OnEnable() { _RefreshImage = (RefreshImage)target; }