public static TileWorldObjectScatterConfiguration Create(string _name, TileWorldObjectScatter __config) { var _path = EditorUtility.SaveFilePanel("new TileWorldCreatorObjectScatter configuration file", "Assets", _name, "asset"); if (string.IsNullOrEmpty(_path)) { return(null); } var _config = ScriptableObject.CreateInstance <TileWorldObjectScatterConfiguration>(); Path.ChangeExtension(_path, ".asset"); //_config.hideFlags = HideFlags.None; AssetDatabase.CreateAsset(_config, makeRelativePath(_path)); AssetDatabase.Refresh(); if (__config != null) { __config.configuration = _config; } else { Selection.activeObject = _config; } return(_config); }
#pragma warning disable CS0618 void OnEnable() { twos = (TileWorldObjectScatter)target; creator = twos.GetComponent <TileWorldCreator>(); placeLayers = twos.GetLayers(); #if UNITY_5_3_OR_NEWER || UNITY_5_3 currentScene = EditorSceneManager.GetActiveScene(); #else currentScene = EditorApplication.currentScene; #endif EditorApplication.hierarchyWindowChanged += HierarchyWindowChanged; }
public static void ShowOSConfigurationEditor(TileWorldObjectScatterConfiguration _config, TileWorldObjectScatter _twos, TileWorldCreator _creator, string[] _placeLayers, Texture2D _iconMaskLayerArrow) { if (_config == null) { EditorGUILayout.HelpBox("Please create or load a configuration file.", MessageType.Info); return; } twos = _twos; creator = _creator; placeLayers = _placeLayers; DragDropArea(_config); ShowPaintObjects(_config); ShowPositionBasedObjects(_config); ShowRuleBasedObjects(_config); }
public static TileWorldObjectScatterConfiguration CreateConfigFile(TileWorldObjectScatter _creator) { return(Create("TileWorldObjectScatterConfiguration", _creator)); }