Пример #1
0
 public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
 {
     if (TextureImported)
     {
         TextureImported = false;
         if (!TextureAutoPacker.InitiateAutoPacking())
         {
             OnAutoPackingEnd();
         }
     }
 }
Пример #2
0
        private void OnGUI()
        {
            serializedObject.Update();
            Color og = GUI.backgroundColor;

            GUI.backgroundColor = _active.boolValue ? Color.green : Color.grey;
            _active.boolValue   = GUILayout.Toggle(_active.boolValue, new GUIContent("Active", "Determine whether the Auto-Packer should initiate on texture import"), "Toolbarbutton");
            GUI.backgroundColor = og;

            EditorGUI.BeginDisabledGroup(!_active.boolValue);
            modulesList.DoLayoutList();
            if (GUILayout.Button(new GUIContent("Force Check", "Initiate the Auto-Packer without having to trigger a texture import")))
            {
                TextureAutoPacker.InitiateAutoPacking();
                TextureAutoPackerProcessor.OnAutoPackingEnd();
            }
            EditorGUI.EndDisabledGroup();

            serializedObject.ApplyModifiedProperties();
        }