com.wallstop-studios.unity-helpers 2.0.0-rc73.16 → 2.0.0-rc73.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -178,6 +178,37 @@
|
|
|
178
178
|
SerializedObject serializedConfig = new(config);
|
|
179
179
|
serializedConfig.Update();
|
|
180
180
|
EditorGUI.BeginChangeCheck();
|
|
181
|
+
|
|
182
|
+
string currentAssetName = config.name;
|
|
183
|
+
Rect nameRect = EditorGUILayout.GetControlRect();
|
|
184
|
+
EditorGUI.BeginChangeCheck();
|
|
185
|
+
string newAssetName = EditorGUI.TextField(
|
|
186
|
+
new Rect(nameRect.x, nameRect.y, nameRect.width - 60, nameRect.height),
|
|
187
|
+
"Asset Name",
|
|
188
|
+
currentAssetName
|
|
189
|
+
);
|
|
190
|
+
if (EditorGUI.EndChangeCheck())
|
|
191
|
+
{
|
|
192
|
+
if (
|
|
193
|
+
!string.IsNullOrWhiteSpace(newAssetName)
|
|
194
|
+
&& newAssetName != currentAssetName
|
|
195
|
+
&& AssetDatabase.Contains(config)
|
|
196
|
+
)
|
|
197
|
+
{
|
|
198
|
+
string assetPath = AssetDatabase.GetAssetPath(config);
|
|
199
|
+
string error = AssetDatabase.RenameAsset(assetPath, newAssetName);
|
|
200
|
+
if (string.IsNullOrWhiteSpace(error))
|
|
201
|
+
{
|
|
202
|
+
LoadAtlasConfigs();
|
|
203
|
+
GUIUtility.ExitGUI();
|
|
204
|
+
}
|
|
205
|
+
else
|
|
206
|
+
{
|
|
207
|
+
this.LogError($"Failed to rename asset: {error}");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
181
212
|
SerializedProperty scriptProperty = serializedConfig.FindProperty("m_Script");
|
|
182
213
|
if (scriptProperty != null)
|
|
183
214
|
{
|
|
@@ -191,7 +222,7 @@
|
|
|
191
222
|
while (property.NextVisible(enterChildren))
|
|
192
223
|
{
|
|
193
224
|
enterChildren = false;
|
|
194
|
-
if (property.name
|
|
225
|
+
if (string.Equals(property.name, "m_Script", StringComparison.Ordinal))
|
|
195
226
|
{
|
|
196
227
|
continue;
|
|
197
228
|
}
|
package/package.json
CHANGED