示例#1
0
    private void DrawSearchButton()
    {
        GUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("Load ACF data from runtime", GUILayout.Width(200), GUILayout.Height(50)))
            {
                if (!EditorApplication.isPlaying)
                {
                    Debug.LogError("Please load acf data in editor playing");
                }
                else
                {
                    acfDataSo = AssetDatabase.LoadAssetAtPath <AcfDataSo>(acfScriptableObjectPath);

                    acfDataSo.categoryInfoList     = LoadCategory();
                    acfDataSo.aisacControlInfoList = LoadAisacControlList();

                    EditorUtility.SetDirty(acfDataSo);
                    AssetDatabase.SaveAssets();
                }
            }

            EditorGUILayout.BeginVertical();

            GUILayout.Space(8f);
            GUILayout.Label("Use the load button when the game playing");

            GUILayout.Space(5f);
            GUILayout.Label("Click each element copies to clipboard");

            EditorGUILayout.EndVertical();
        }
        GUILayout.EndHorizontal();
    }
示例#2
0
    private void OnEnable()
    {
        acfDataSo = AssetDatabase.LoadAssetAtPath <AcfDataSo>(acfScriptableObjectPath);

        if (acfDataSo == null)
        {
            acfDataSo = CreateInstance <AcfDataSo>();
            AssetDatabase.CreateAsset(acfDataSo, acfScriptableObjectPath);
            AssetDatabase.Refresh();
        }
    }