public override void OnEnable()
        {
            base.OnEnable();

            if (target.GetType() != typeof(SceneContainerAsset))
            {
                return;
            }

            _reference = (SceneContainerAsset)target;

            _listOfScene = serializedObject.FindProperty("listOfScene");

            _reorderableListOfScene = new CoreEditorModule.ReorderableList(serializedObject, _listOfScene);
        }
Exemple #2
0
        private void AddSceneContainerAsset()
        {
            if (!Directory.Exists(CoreConstant.DirectoryForSceneContainerAsset))
            {
                Directory.CreateDirectory(CoreConstant.DirectoryForSceneContainerAsset);
            }

            _nameOfSceneContainer = _nameOfSceneContainer.Length == 0 ? _defaultName : _nameOfSceneContainer;
            int    numberOfDuplicateName = IsThereAnySceneContainerWithTheGivenName(_nameOfSceneContainer);
            string absoluteName          = _nameOfSceneContainer + " " + numberOfDuplicateName;

            SceneContainerAsset newSceneContainerAsset = ScriptableObject.CreateInstance <SceneContainerAsset>();

            AssetDatabase.CreateAsset(newSceneContainerAsset, CoreConstant.DirectoryForSceneContainerAsset + "/" + absoluteName + ".asset");
            AssetDatabase.SaveAssets();

            EditorUtility.FocusProjectWindow();

            Selection.activeObject = newSceneContainerAsset;

            UpdateListOfSceneContainerAsset();
        }