void DrawStateSettingGui()
        {
            OperationAssetStatus ops = AssetDatabase.LoadAssetAtPath <OperationAssetStatus>(_stateAssetConfig);

            if (ops != null)
            {
                _allStatNames          = ops._allStates.ToArray();
                _operationAsset.Status = EditorGUILayout.MaskField("State", _operationAsset.Status, _allStatNames);
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("State");
                if (GUILayout.Button("Click Create OperationAssetStatus"))
                {
                    string path = Application.dataPath + "/Resources";
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }

                    OperationAssetStatus operationAssetStatus = ScriptableObject.CreateInstance <OperationAssetStatus>();
                    AssetDatabase.CreateAsset(operationAssetStatus, _stateAssetConfig);
                }
                GUILayout.EndHorizontal();
            }
        }
Esempio n. 2
0
 private void OnEnable()
 {
     operationAssetStatus = target as OperationAssetStatus;
 }