// Create clicked
        private void createButton_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.Assert(uidBox.Text.Length > 0);

            try
            {
                if (EditorResourceManager.exists(uidBox.Text))
                {
                    MessageBox.Show("That uid already exists.", "Duplicate UID");
                }
                else
                {
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    Close();
                }
            }
            catch (InvalidResourceException resourceException)
            {
                MessageBox.Show(String.Format("Invalid resource:\n {0}", resourceException.StackTrace), "Resource Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (ResourceNotFoundException resourceException)
            {
                MessageBox.Show(String.Format("Resource not found:\n {0}", resourceException.StackTrace), "Resource Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        public void saveBackgrounds()
        {
            XElement data = new XElement("Backgrounds");

            foreach (EditorBackground background in _backgrounds)
            {
                data.Add(background.data);
            }

            EditorResourceManager.saveBackgroundResources(data, true);
        }
        public GameResourceManager()
        {
            FrameWorkEntry m_FrameWork = GameEntry.Singleton.FrameWork;

            if (GameEntry.Singleton.IsEditor)
            {
                m_FrameManager = new EditorResourceManager();
                //m_FrameWork.AddManager<EditorResourceManager>(m_FrameManager as EditorResourceManager);
            }
            else
            {
                m_FrameManager = new ResourceManager();
                //m_FrameWork.AddManager<ResourceManager>(m_FrameManager as ResourceManager);
            }
        }
Exemple #4
0
        // Clone material
        public void cloneMaterial(EditorMaterial source)
        {
            EditorMaterial material = source.clone();
            string         newUID   = material.uid + "_copy";

            while (EditorResourceManager.exists(newUID))
            {
                newUID = newUID + "_copy";
            }
            while (materialExists(newUID))
            {
                newUID = newUID + "_copy";
            }
            material.uid = newUID;
            _materials.Add(material);
        }
        protected override void SetFrameManager()
        {
            FrameWorkEntry frmWork = GameEntry.Singleton.FrameWork;

            if (GameEntry.Singleton.IsEditor)
            {
                EditorResourceManager resourceManager = new EditorResourceManager();
                //frmWork.AddManager<EditorResourceManager>(resourceManager);
                m_FrameManager = resourceManager;
            }
            else
            {
                ResourceManager resourceManager = new ResourceManager();
                //frmWork.AddManager<ResourceManager>(resourceManager);
                m_FrameManager = resourceManager;
            }
        }
Exemple #6
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();

            EditorResourceManager t = target as EditorResourceManager;

            if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
            {
                EditorGUILayout.LabelField("Load Waiting Asset Count", t.LoadWaitingAssetCount.ToString());
            }

            EditorGUILayout.PropertyField(m_LoadAssetCountPerFrame);
            EditorGUILayout.PropertyField(m_MinLoadAssetRandomDelaySeconds);
            EditorGUILayout.PropertyField(m_MaxLoadAssetRandomDelaySeconds);

            serializedObject.ApplyModifiedProperties();

            Repaint();
        }
Exemple #7
0
 // saveMaterials
 public void saveMaterials()
 {
     EditorResourceManager.saveMaterialResources(new List <Material>(_materials), true);
 }
 // saveBlueprints
 public void saveBlueprints()
 {
     EditorResourceManager.saveBlueprintResources(new List <Blueprint>(_blueprints), true);
 }
Exemple #9
0
 // "Push Resources" menu item clicked
 private void pushResourcesMenuItem_Click(object sender, EventArgs e)
 {
     EditorResourceManager.pushResources();
     MessageBox.Show("Resources pushed.");
 }
 // Save circuits
 public void saveCircuits()
 {
     EditorResourceManager.saveCircuitResources(new List <Circuit>(_circuits), true);
     _editorController.levelController.updateCircuitActorConnections();
 }