Skip to content

Commit

Permalink
update control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtueSky committed Feb 8, 2024
1 parent 114aef7 commit 826fe1a
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

### Add the line below to `Packages/manifest.json`

for version `2.4.3`
for version `2.4.4`
```csharp
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#2.4.3",
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#2.4.4",
```

#### Note:

- [See Document](https://github.com/VirtueSky/sunflower/wiki)

(Reference: https://github.com/pancake-llc/foundation)
(Reference: https://github.com/pancake-llc/foundation/tree/main/Assets/Heart)
12 changes: 6 additions & 6 deletions VirtueSky/ControlPanel/CPAboutDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace VirtueSky.ControlPanel.Editor
{
public class CPAboutDrawer
{
public static void OnDrawAbout(Rect position, Action drawSetting)
public static void OnDrawAbout(Rect position, Action drawSetting = null)
{
GUILayout.Space(10);
GUILayout.BeginVertical();
Expand All @@ -30,12 +30,12 @@ public static void OnDrawAbout(Rect position, Action drawSetting)
Application.OpenURL("https://github.com/VirtueSky/sunflower/wiki");
}

Handles.DrawAAPolyLine(3, new Vector3(ConstantControlPanel.POSITION_X_START_CONTENT, 195),
new Vector3(position.width, 195));
GUILayout.Space(20);
GUILayout.Label("SETUP THEME", EditorStyles.boldLabel);
GUILayout.Space(10);
drawSetting?.Invoke();
CPUtility.DrawLineLastRectY(3, ConstantControlPanel.POSITION_X_START_CONTENT, position.width);
// GUILayout.Space(20);
// GUILayout.Label("SETUP THEME", EditorStyles.boldLabel);
// GUILayout.Space(10);
// drawSetting?.Invoke();
GUILayout.EndVertical();
}
}
Expand Down
2 changes: 1 addition & 1 deletion VirtueSky/ControlPanel/CPInAppReviewDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void OnDrawInAppReview(Rect position)
GUILayout.BeginVertical();
GUILayout.Label("IN APP REVIEW", EditorStyles.boldLabel);
GUILayout.Space(10);
if (GUILayout.Button("Create In App Review"))
if (GUILayout.Button("Create Scriptable In App Review"))
{
RatingWindowEditor.CreateInAppReview();
}
Expand Down
17 changes: 16 additions & 1 deletion VirtueSky/ControlPanel/CPUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void DrawButtonInstallPackage(string labelInstall, string labelRem
bool isInstall = RegistryManager.IsInstalledPackage(packageName);
if (isInstall)
{
GUI.backgroundColor = CustomColor.Red.ToColor();
if (GUILayout.Button(labelRemove, GUILayout.Width(withButton)))
{
RegistryManager.Remove(packageName);
Expand All @@ -22,13 +23,16 @@ public static void DrawButtonInstallPackage(string labelInstall, string labelRem
}
else
{
GUI.backgroundColor = CustomColor.Green.ToColor();
if (GUILayout.Button(labelInstall, GUILayout.Width(withButton)))
{
RegistryManager.AddOverrideVersion(packageName,
packageVersion);
}
}

GUI.backgroundColor = GameDataEditor.ColorContentWindowSunflower.ToColor();

GUILayout.Space(10);
GUILayout.Toggle(isInstall, TextIsInstallPackage(isInstall));
EditorGUILayout.EndHorizontal();
Expand All @@ -38,12 +42,23 @@ public static void DrawButtonAddDefineSymbols(string flagSymbols, float withButt
{
GUILayout.BeginHorizontal();
bool isAddSymbols = EditorScriptDefineSymbols.IsFlagEnabled(flagSymbols);
string labelButton = isAddSymbols ? "Remove Symbols ---> " : "Add Symbols ---> ";
string labelButton = isAddSymbols ? "Remove ---> " : "Add ---> ";
if (isAddSymbols)
{
GUI.backgroundColor = CustomColor.Red.ToColor();
}
else
{
GUI.backgroundColor = CustomColor.Green.ToColor();
}

if (GUILayout.Button(labelButton + flagSymbols, GUILayout.Width(withButton)))
{
EditorScriptDefineSymbols.SwitchFlag(flagSymbols);
}

GUI.backgroundColor = GameDataEditor.ColorContentWindowSunflower.ToColor();

GUILayout.Space(10);
GUILayout.Toggle(isAddSymbols, TextIsEnable(isAddSymbols));
GUILayout.EndHorizontal();
Expand Down
2 changes: 1 addition & 1 deletion VirtueSky/ControlPanel/ConstantPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class ConstantPackage
{
public const string VersionSunflower = "2.4.3";
public const string VersionSunflower = "2.4.4";
public const string PackageNameInAppPurchase = "com.unity.purchasing";
public const string MaxVersionInAppPurchase = "4.10.0";
public const string PackageNameNewtonsoftJson = "com.unity.nuget.newtonsoft-json";
Expand Down
6 changes: 3 additions & 3 deletions VirtueSky/ControlPanel/ControlPanelWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void DrawButton()
{
DrawButtonChooseState("Advertising", StatePanelControl.Advertising);
DrawButtonChooseState("In App Purchase", StatePanelControl.InAppPurchase);
DrawButtonChooseState("ScriptableObject Event", StatePanelControl.SO_Event);
DrawButtonChooseState("ScriptableObject Variable", StatePanelControl.SO_Variable);
DrawButtonChooseState("Scriptable Event", StatePanelControl.SO_Event);
DrawButtonChooseState("Scriptable Variable", StatePanelControl.SO_Variable);
DrawButtonChooseState("Audio", StatePanelControl.Audio);
DrawButtonChooseState("Pools", StatePanelControl.Pools);
DrawButtonChooseState("Firebase", StatePanelControl.Firebase);
Expand Down Expand Up @@ -136,7 +136,7 @@ void DrawContent()
CPGameServiceDrawer.OnDrawGameService();
break;
case StatePanelControl.About:
CPAboutDrawer.OnDrawAbout(position, () => { OnSettingColorTheme(); });
CPAboutDrawer.OnDrawAbout(position);
break;
}
}
Expand Down
5 changes: 3 additions & 2 deletions VirtueSky/DataStorage/Editor/DataWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class DataWindowEditor : EditorWindow
{
#region Data

[MenuItem("GameBase/Clear Data")]
[MenuItem("Sunflower/Game Data/Clear Data")]
public static void ClearAllData()
{
GameData.DelDataInStorage();
Expand All @@ -17,10 +17,11 @@ public static void ClearAllData()
Debug.Log($"<color=Green>Clear data succeed</color>");
}

[MenuItem("GameBase/Save Data")]
[MenuItem("Sunflower/Game Data/Save Data")]
public static void SaveData()
{
GameData.Save();
Debug.Log($"<color=Green>Save data succeed</color>");
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion VirtueSky/Events/Editor/EventWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class EventWindowEditor : EditorWindow
#region Create ScriptableObject Event

private const string pathEvent = "/Event";
private const string menuEvent = "Sunflower/Create Event/";
private const string menuEvent = "Sunflower/Scriptable/Create Event/";

[MenuItem(menuEvent + "EventNoParam")]
public static void CreateEventNoParam()
Expand Down
2 changes: 1 addition & 1 deletion VirtueSky/Variables/Editor/VariableWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class VariableWindowEditor : EditorWindow
#region Create ScriptableObject Variable

private const string pathVariable = "/Variable";
private const string menuVariable = "Sunflower/Create Variable/";
private const string menuVariable = "Sunflower/Scriptable/Create Variable/";

[MenuItem(menuVariable + "Transform Variable")]
public static void CreateVariableTransform()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.virtuesky.sunflower",
"displayName": "Sunflower",
"description": "Core ScriptableObject Architecture for building Unity games",
"version": "2.4.3",
"version": "2.4.4",
"unity": "2022.3",
"category": "virtuesky",
"keywords": [
Expand Down

0 comments on commit 826fe1a

Please sign in to comment.