Ejemplo n.º 1
0
        private void OnAddProjectButtonClick()
        {
            var p = MProject.CreateInstance <MProject>();

            p.name        = Guid.NewGuid().ToString();
            p.ProjectName = "Project " + (this.sceneContainer.projects.Count + 1);

            AssetDatabase.AddObjectToAsset(p, this.sceneContainer);
            this.sceneContainer.projects.Add(p);
            EditorUtility.SetDirty(this.sceneContainer);

            AssetDatabase.SaveAssets();

            projectList.selectedIndex = this.sceneContainer.projects.Count - 1;
        }