Skip to content

Commit 7066ea3

Browse files
committed
- added custom asset type support
1 parent fc3646f commit 7066ea3

File tree

7 files changed

+30
-8
lines changed

7 files changed

+30
-8
lines changed

Assets/Editor/Asset.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ public GameObject Screen
398398
}
399399

400400
#endregion
401+
402+
#region custom assets
403+
public string CustomType { get; set; }
404+
public string CustomData { get; set; }
405+
#endregion
401406

402407
public AspectRatio AspectRatio { get; set; }
403408

Assets/Editor/AssetType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ public enum AssetType
1717
ImageSign,
1818
Train,
1919
ParticleEffect,
20+
Custom,
2021
}
2122
}

Assets/Editor/UI/AssetEditorWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class AssetEditorWindow : EditorWindow
5858
{ AssetType.Trashbin, new DefaultAssetHandler(AssetType.Trashbin) },
5959
{ AssetType.Lamp, new DefaultAssetHandler(AssetType.Lamp) },
6060
{ AssetType.ParticleEffect, new ParticleEffectAssetHandler() },
61+
{ AssetType.Custom, new CustomAssetHandler() },
6162
};
6263

6364
[MenuItem("Window/Parkitect Asset Editor")]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace ParkitectAssetEditor.UI.AssetHandlers
5+
{
6+
public class CustomAssetHandler : IAssetTypeHandler
7+
{
8+
public virtual void DrawDetailsSection(Asset selectedAsset)
9+
{
10+
if (selectedAsset.GameObject == null)
11+
{
12+
return;
13+
}
14+
15+
GUILayout.Label("Custom asset settings", EditorStyles.boldLabel);
16+
selectedAsset.CustomType = EditorGUILayout.TextField("Type: ", selectedAsset.CustomType);
17+
selectedAsset.CustomData = EditorGUILayout.TextArea("Data: ", selectedAsset.CustomData);
18+
}
19+
}
20+
}

Assets/Editor/UI/AssetHandlers/CustomAssetHandler.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Resources/BillingMode.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

Assets/Resources/BillingMode.json.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)