﻿#if UNITY_EDITOR
using UnityEditor;

namespace JLGames.RocketDriver.Actions.Loaderx
{
    [CustomEditor(typeof(BundleSettings), true)]
    class BundleSettingsEditor : Editor
    {
        SerializedProperty m_Properties;

        public override void OnInspectorGUI()
        {
            DrawAlertView();
            EditorGUILayout.Space(); //-------
            EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Properties"));
            EditorGUILayout.Space(); //-------
            DrawOtherView();
            serializedObject.ApplyModifiedProperties();
        }

        private void DrawAlertView()
        {
            EditorGUILayout.LabelField("Note(注意事项):", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("1.When the Assetbundle is packaged, the resource path will be recorded in the bundle.", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("1.打包Assetbundle时，资源路径会被记录到bundle中。", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("2.Therefore, when the resource path is adjusted, the bundle should be re-exited, even if the content in the bundle is not adjusted.", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("2.因此，当资源路径调整后，要重新出bundle，即使没用调整bundle中的内容。", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("3.The value of ProjectBasePath is the relative path in the project, which will be merged into AssetPath, so it cannot be wrong!", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("3.ProjectBasePath的值为项目中相对路径，会合并到AssetPath中，因此不能填错！", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("4.All path-related content requires the use of the Unity path format, ie backslash '/'.", EditorStyles.largeLabel);
            EditorGUILayout.LabelField("4.全部路径相关内容，要求使用Unity路径格式，即反斜杆'/'。", EditorStyles.largeLabel);
        }

        private void DrawOtherView()
        {
            EditorGUILayout.LabelField("其它信息:", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.LabelField("本地调试");
            EditorGUILayout.TextField("http://localhost:8080");
            EditorGUILayout.LabelField("内网测试");
            EditorGUILayout.TextField("http://exam.example.com");
            EditorGUILayout.LabelField("内网开发");
            EditorGUILayout.TextField("http://dev.exampel.com");
            EditorGUI.indentLevel--;
        }
    }
}
#endif