Skip to content

Commit

Permalink
change: change namespace
Browse files Browse the repository at this point in the history
BREAKING CHANGE: If your code contained the SoftMask API, it would fail to compile. Please change the namespace from `Coffee.UIExtensions` to `Coffee.UISoftMask`.
  • Loading branch information
mob-sakai committed May 11, 2020
1 parent 3451521 commit 0347b04
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Packages/SoftMaskForUGUI/Samples/Demo/SoftMask_Demo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEngine;
using UnityEngine.UI;

namespace Coffee.UIExtensions.Demos
namespace Coffee.UISoftMask.Demos
{
public class SoftMask_Demo : MonoBehaviour
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
using UnityEditor.SceneManagement;


namespace Coffee.UIExtensions.Editors
namespace Coffee.UISoftMask
{
public static class Utils
public static class EditorUtils
{
public static void MarkPrefabDirty ()
{
#if UNITY_2018_3_OR_NEWER
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage ();
if (prefabStage != null)
if (prefabStage != null)
{
EditorSceneManager.MarkSceneDirty (prefabStage.scene);
}
#endif
}
}
}
}
4 changes: 2 additions & 2 deletions Packages/SoftMaskForUGUI/Scripts/Editor/ImportSampleMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Text.RegularExpressions;
using UnityEditor;

namespace Coffee.UIExtensions
namespace Coffee.UISoftMask
{
public static class ImportSampleMenu_UISoftMask
public static class ImportSampleMenu
{
[MenuItem("Assets/Samples/Import UISoftMask Sample")]
private static void ImportSample()
Expand Down
8 changes: 4 additions & 4 deletions Packages/SoftMaskForUGUI/Scripts/Editor/SoftMaskEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;


namespace Coffee.UIExtensions.Editors
namespace Coffee.UISoftMask
{
/// <summary>
/// SoftMask editor.
Expand Down Expand Up @@ -41,8 +41,8 @@ public override void OnInspectorGUI ()
{
p.gameObject.AddComponent<SoftMaskable> ();
}
Utils.MarkPrefabDirty ();

EditorUtils.MarkPrefabDirty ();
}
if (GUILayout.Button ("Ping"))
{
Expand Down Expand Up @@ -131,4 +131,4 @@ protected static void ConvertTo<T>(Object context) where T : MonoBehaviour
(so.targetObject as MonoBehaviour).enabled = oldEnable;
}
}
}
}
12 changes: 6 additions & 6 deletions Packages/SoftMaskForUGUI/Scripts/Editor/SoftMaskableEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using MaskIntr = UnityEngine.SpriteMaskInteraction;
using System.IO;

namespace Coffee.UIExtensions.Editors
namespace Coffee.UISoftMask
{
/// <summary>
/// SoftMaskable editor.
Expand Down Expand Up @@ -98,7 +98,7 @@ void OnEnable ()

s_MaskWarning = new GUIContent(EditorGUIUtility.FindTexture("console.warnicon.sml"), "This component is not SoftMask. Use SoftMask instead of Mask.");
}

void OnDisable ()
{
ClearMaterialEditors ();
Expand Down Expand Up @@ -235,16 +235,16 @@ public override void OnInspectorGUI ()
ShowMaterialEditors (fontSharedMaterials, 1, fontSharedMaterials.Length - 1);
}
}

if (!DetectMask (current.transform.parent))
{
GUILayout.BeginHorizontal ();
EditorGUILayout.HelpBox ("This is unnecessary SoftMaskable.\nCan't find any SoftMask components above.", MessageType.Warning);
if (GUILayout.Button ("Remove", GUILayout.Height (40)))
{
DestroyImmediate (current);
Utils.MarkPrefabDirty ();

EditorUtils.MarkPrefabDirty ();
}
GUILayout.EndHorizontal ();
}
Expand Down Expand Up @@ -410,4 +410,4 @@ object ModifyTMProSpriteAsset (Material baseMaterial, Shader shader, System.Acti
return spriteAsset;
}
}
}
}
2 changes: 1 addition & 1 deletion Packages/SoftMaskForUGUI/Scripts/GraphicConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEngine;
using UnityEngine.UI;

namespace Coffee.UIExtensions
namespace Coffee.UISoftMask
{
internal static class GraphicConnectorExtension
{
Expand Down
2 changes: 1 addition & 1 deletion Packages/SoftMaskForUGUI/Scripts/MaterialCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEngine;
using UnityEngine.UI;

namespace Coffee.UIExtensions
namespace Coffee.UISoftMask
{
internal class MaterialCache
{
Expand Down
2 changes: 1 addition & 1 deletion Packages/SoftMaskForUGUI/Scripts/SoftMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEngine.Rendering;
using UnityEngine.UI;

namespace Coffee.UIExtensions
namespace Coffee.UISoftMask
{
/// <summary>
/// Soft mask.
Expand Down
2 changes: 1 addition & 1 deletion Packages/SoftMaskForUGUI/Scripts/SoftMaskable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine.UI;
using MaskIntr = UnityEngine.SpriteMaskInteraction;

namespace Coffee.UIExtensions
namespace Coffee.UISoftMask
{
/// <summary>
/// Soft maskable.
Expand Down

0 comments on commit 0347b04

Please sign in to comment.