12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- #if UNITY_EDITOR
- using UnityEditor;
- #endif
- namespace ShadowStudio.Model
- {
- /// <summary>
- /// 资源
- /// </summary>
- [InitializeOnLoad]
- [CustomEditor(typeof(ArtResConf))]
- public class ArtResConfEditor : Editor
- {
- private ArtResConf artConf;
- private bool isForceUpdate;
- private void OnEnable()
- {
- artConf = target as ArtResConf;
- }
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- isForceUpdate = GUILayout.Toggle(isForceUpdate, "强制刷新");
- if (GUILayout.Button("资源添加到xml", GUILayout.Width(200)))
- {
- if (artConf.instaceType == InstaceType.UnityBase)
- {
- ArtInfoMgr.Instance.AddDefaultArt(artConf.artType);
- }
- else
- {
- ArtInfoMgr.Instance.AddArtInfo(artConf.resModelList, artConf.artType, artConf.instaceType, isForceUpdate, artConf.name);
- }
- }
- if (GUILayout.Button("删除此列表资源", GUILayout.Width(200)))
- {
- ArtInfoMgr.Instance.RemoveArtInfo(artConf.resModelList);
- }
- }
- }
- }
|