Example #1
0
        static void Combine(MenuCommand command)
        {
            Logger.Instance.AddLog("SuperCombiner", "Combine All...");

            SuperCombiner sc = (SuperCombiner)command.context;

            sc.CombineChildren();
        }
Example #2
0
 static void CombineSelected()
 {
     foreach (GameObject obj in Selection.gameObjects)
     {
         SuperCombiner sc = obj.GetComponent <SuperCombiner> ();
         if (sc != null)
         {
             if (sc._combiningState == SuperCombiner.CombineStatesList.Uncombined)
             {
                 sc.CombineChildren();
             }
         }
     }
 }
Example #3
0
        /// <summary>
        /// Display the combine button.
        /// </summary>
        private void DisplayCombineButton()
        {
            EditorGUILayout.Space();

            if (_superCombiner._combiningState == SuperCombiner.CombineStatesList.Uncombined)
            {
                if (GUILayout.Button(new GUIContent("Combine", "This will launch the combine process of combining materials to create atlas textures and the combine meshes to adjust UVs so that they fit the new atlas."), GUILayout.MinHeight(30)))
                {
                    _superCombiner.CombineChildren();
                }
            }
            else if (_superCombiner._combiningState == SuperCombiner.CombineStatesList.Combining)
            {
                EditorGUILayout.Space();
                if (GUILayout.Button(new GUIContent("Uncombine", "This will revert the combine process so that everything will be back to normal."), GUILayout.MinHeight(30)))
                {
                    _superCombiner.UnCombine();
                }
                Rect r = EditorGUILayout.BeginVertical();
                EditorGUI.ProgressBar(r, 0.1f, "Combining in progress ... ");
                GUILayout.Space(20);
                EditorGUILayout.EndVertical();
            }
            else if (_superCombiner._combiningState == SuperCombiner.CombineStatesList.CombinedMaterials)
            {
                if (GUILayout.Button(new GUIContent("Combine meshes", "This will finish the combine process by combining meshes to adjust UVs so that they fit the new atlas."), GUILayout.MinHeight(30)))
                {
                    _superCombiner.SetTargetParentForCombinedGameObject();
                    _superCombiner.CombineMeshes(_superCombiner._meshList, _superCombiner._skinnedMeshList, _superCombiner._targetParentForCombinedGameObjects.transform);
                }
            }
            else
            {
                if (GUILayout.Button(new GUIContent("Uncombine", "This will revert the combine process so that everything will be back to normal."), GUILayout.MinHeight(30)))
                {
                    _superCombiner.UnCombine();
                }
            }
        }