private void InitSetting()
 {
     mSetting = AssetBundleEditorTools.GetAssetBundleManagerSetting();
     DisposeSerializedObject();
     if (mSetting)
     {
         mSerializedObject      = new SerializedObject(mSetting);
         mShowBuildTarget.value = !mSerializedObject.FindProperty(nameof(AssetBundleManagerSetting.UseActiveBuildTarget)).boolValue;
         mShowBuildTarget.valueChanged.AddListener(Repaint);
     }
 }
        private void OnGUI()
        {
            mPosition = GUILayout.BeginScrollView(mPosition);
            //Deleted or move or change name, reload.
            if (!mSetting || AssetDatabase.GetAssetPath(mSetting) != AssetBundleManager.AssetBundleManagerSettingPath)
            {
                InitSetting();
            }
            if (!mSetting)
            {
                //init or skin changed
                if (mSetupButtonStyle == null || mIsProSkin != EditorGUIUtility.isProSkin)
                {
                    mIsProSkin        = EditorGUIUtility.isProSkin;
                    mSetupButtonStyle = new GUIStyle(GUI.skin.button)
                    {
                        fontSize = 20
                    };
                }
                EditorGUILayout.HelpBox("Click the button below to setup AssetBundleManager.", MessageType.Info);
                if (GUILayout.Button("Setup AssetBundleManager", mSetupButtonStyle, GUILayout.Height(50)))
                {
                    mSetting          = AssetBundleEditorTools.GetOrCreateAssetBundleManagerSetting();
                    mSerializedObject = new SerializedObject(mSetting);
                }
            }
            else
            {
                AssetBundleManagerSettingEditor.Draw(mSerializedObject, mShowBuildTarget, false);

                if (GUILayout.Button("Build"))
                {
                    AssetBundleEditorTools.Build();
                }
                if (GUILayout.Button("Set AssetBundle Name"))
                {
                    AssetBundleEditorTools.SetAssetBundleName();
                }

                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Clear StreamingAssets Bundle Path"))
                {
                    AssetBundleEditorTools.ClearStreamingAssetsBundlePath();
                }
                if (GUILayout.Button("Copy To StreamingAssets Bundle Path"))
                {
                    AssetBundleEditorTools.CopyToStreamingAssetsBundlePath();
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Clear Load AssetBundle Path"))
                {
                    AssetBundleEditorTools.ClearLoadAssetBundlePath();
                }
                if (GUILayout.Button("Copy To Load AssetBundle Path"))
                {
                    AssetBundleEditorTools.CopyToLoadAssetBundlePath();
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndScrollView();
        }