diff --git a/Assets/Texture/splash/WeatherWidgetHorizontal.png b/Assets/Texture/splash/WeatherWidgetHorizontal.png index b79db3b..bfb47e6 100644 Binary files a/Assets/Texture/splash/WeatherWidgetHorizontal.png and b/Assets/Texture/splash/WeatherWidgetHorizontal.png differ diff --git a/Assets/Texture/splash/WeatherWidgetVertical.png b/Assets/Texture/splash/WeatherWidgetVertical.png index 4f0e7b8..bbb2a43 100644 Binary files a/Assets/Texture/splash/WeatherWidgetVertical.png and b/Assets/Texture/splash/WeatherWidgetVertical.png differ diff --git a/Runtime/Editor/VerticalLayoutEditor.cs b/Runtime/Editor/VerticalLayoutEditor.cs new file mode 100644 index 0000000..6fabc55 --- /dev/null +++ b/Runtime/Editor/VerticalLayoutEditor.cs @@ -0,0 +1,49 @@ +using jp.ootr.common; +using UnityEditor; +using UnityEngine; +using UnityEngine.UI; + +namespace jp.ootr.WeatherWidget.Editor +{ + [CustomEditor(typeof(VerticalLayout))] + public class VerticalLayoutEditor : UnityEditor.Editor + { + private bool _debug; + + public override void OnInspectorGUI() + { + var script = (VerticalLayout)target; + + _debug = EditorGUILayout.ToggleLeft("Debug", _debug); + if (_debug) + { + base.OnInspectorGUI(); + return; + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("WeatherWidget", EditorStyle.UiTitle); + + EditorGUILayout.Space(); + + script.forecastCount = (int)EditorGUILayout.Slider("Forecast Count", script.forecastCount, 3, 7); + + EditorGUILayout.Space(); + + if (EditorGUI.EndChangeCheck()) EditorUtility.SetDirty(script); + if (script.splashImage != null) + { + var texture = (Sprite)EditorGUILayout.ObjectField("Splash Image", + script.splashImage.sprite, typeof(Sprite), false); + if (texture != script.splashImage.sprite) + { + var splashImageProp = serializedObject.FindProperty("splashImage"); + var splashImage = (Image)splashImageProp.objectReferenceValue; + var soImage = new SerializedObject(splashImage); + soImage.FindProperty("m_Texture").objectReferenceValue = texture; + soImage.ApplyModifiedProperties(); + } + } + } + } +} diff --git a/Runtime/Editor/VerticalLayoutEditor.cs.meta b/Runtime/Editor/VerticalLayoutEditor.cs.meta new file mode 100644 index 0000000..ddccf4d --- /dev/null +++ b/Runtime/Editor/VerticalLayoutEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 58505afcbe1345869ee74ab2bee5151b +timeCreated: 1725307360 \ No newline at end of file