From bfaba5d397f5758be5707cfc2d248bac59cb10f9 Mon Sep 17 00:00:00 2001 From: "Simon (darkside) Jackson" Date: Tue, 1 Dec 2015 16:01:01 +0000 Subject: [PATCH] Moved effects to their own folder Finished testing of UI Image Crop control --HG-- branch : develop_4.6 --- Materials/UIImageCropMaterial.mat | Bin 4264 -> 0 bytes Materials/UIImageCropMaterial.mat.meta | 4 ---- Materials.meta => Scripts/Effects.meta | 2 +- Scripts/{ => Effects}/BestFitOutline.cs | 0 Scripts/{ => Effects}/BestFitOutline.cs.meta | 0 Scripts/{ => Effects}/CurvedText.cs | 0 Scripts/{ => Effects}/CurvedText.cs.meta | 0 Scripts/{ => Effects}/Gradient.cs | 0 Scripts/{ => Effects}/Gradient.cs.meta | 0 Scripts/{ => Effects}/LetterSpacing.cs | 0 Scripts/{ => Effects}/LetterSpacing.cs.meta | 0 Scripts/{ => Effects}/NicerOutline.cs | 0 Scripts/{ => Effects}/NicerOutline.cs.meta | 0 Scripts/{ => Effects}/UIFlippable.cs | 0 Scripts/{ => Effects}/UIFlippable.cs.meta | 0 Scripts/{ => Effects}/UIImageCrop.cs | 15 +++++++++++---- Scripts/{ => Effects}/UIImageCrop.cs.meta | 0 17 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 Materials/UIImageCropMaterial.mat delete mode 100644 Materials/UIImageCropMaterial.mat.meta rename Materials.meta => Scripts/Effects.meta (63%) rename Scripts/{ => Effects}/BestFitOutline.cs (100%) rename Scripts/{ => Effects}/BestFitOutline.cs.meta (100%) rename Scripts/{ => Effects}/CurvedText.cs (100%) rename Scripts/{ => Effects}/CurvedText.cs.meta (100%) rename Scripts/{ => Effects}/Gradient.cs (100%) rename Scripts/{ => Effects}/Gradient.cs.meta (100%) rename Scripts/{ => Effects}/LetterSpacing.cs (100%) rename Scripts/{ => Effects}/LetterSpacing.cs.meta (100%) rename Scripts/{ => Effects}/NicerOutline.cs (100%) rename Scripts/{ => Effects}/NicerOutline.cs.meta (100%) rename Scripts/{ => Effects}/UIFlippable.cs (100%) rename Scripts/{ => Effects}/UIFlippable.cs.meta (100%) rename Scripts/{ => Effects}/UIImageCrop.cs (74%) rename Scripts/{ => Effects}/UIImageCrop.cs.meta (100%) diff --git a/Materials/UIImageCropMaterial.mat b/Materials/UIImageCropMaterial.mat deleted file mode 100644 index c1fa6e75f98d673efb940b41b4c9811703216bf4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4264 zcmeHKOOqQl5Y_@AVG~G5cs~u{{a8pg>bLU+0w|%Iw$`C zs`4|Ed#;?|%8dj6fjd`Bf8C>5c~%K$s@zpG(^7xxZhdNLW|W#=QtH?}rPLGjq=!;x z7S1l5@19csOeT{#YClWYb?uBzbYHFL+$b_kfP_4X+gPbX^cbdj(o0RJmZVM%+BY_S zG@I_rq+=R=-OJTu1c5^co?dUYoV~QxNnB>vcAX(7Sz4#@Eo-`Zqou7$o%rG?kFW#p zVosqg0UJr*G_P_TPOFR~kp$GzZmR$xA&4X+AWlXi@8!@;Y5FNmAG18bWA;Wx<3C;j zp}8;q!3ZdKHc5Ll`>*vtm_|$pXE~PVvbB1o#(i5d45lpo>UL%YrJGxh151jDys6D-AwFrXOKv-0{ z+04?80*`M5P^e&>w-rI%&>HNkLgkJ1W(Dtg9khef?PLJ*8SXn>-im;}nRaTI&yII0b~MF4V*9%hdl2YGx0_Qz;uw3cg2d#)NbgtdXoitK zh}flk8^~9x_rnl0mbI?dz(<4uaZDazJj>+)@i7@8o?YnE)w_T$lF-FNs`nE?mv9WL zR_~_~Of~aUMM#W~R`2P+iO+tzdKV)IVY#SVycf>|ph7K9iq)*2S)ux~5HuDpstKPZ z3?~aLVfImd4h9mREc9ur&!dZk5##?nC@wH~4~}6~sxL+`)yzL9jL$qu^`*dx&wiTf z%Mk?gck_#tWq(ZIZB-9|O4WE@$(mT!uLSlvvO~n)WBU^K_J68i?*mmg@?Y+s4k z(S>Q%4%eWndvxJ#g$w=a_xAkHcmDis?e64{zkWHpDs46P68p8`Ikgmk3_?_#JM44|hr}F5a(m W`v+;?`StHQd~qMY95K%OkmtXFvGPm+ diff --git a/Materials/UIImageCropMaterial.mat.meta b/Materials/UIImageCropMaterial.mat.meta deleted file mode 100644 index 649017b..0000000 --- a/Materials/UIImageCropMaterial.mat.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 7919197bf9b9d854fa3b0b0c116c2152 -NativeFormatImporter: - userData: diff --git a/Materials.meta b/Scripts/Effects.meta similarity index 63% rename from Materials.meta rename to Scripts/Effects.meta index d0db19e..a01b9d9 100644 --- a/Materials.meta +++ b/Scripts/Effects.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9c13e9266c2d4ed4d9dfe8d643b19d09 +guid: cbbc72115bdf3fe4a93d8566634c6e61 folderAsset: yes DefaultImporter: userData: diff --git a/Scripts/BestFitOutline.cs b/Scripts/Effects/BestFitOutline.cs similarity index 100% rename from Scripts/BestFitOutline.cs rename to Scripts/Effects/BestFitOutline.cs diff --git a/Scripts/BestFitOutline.cs.meta b/Scripts/Effects/BestFitOutline.cs.meta similarity index 100% rename from Scripts/BestFitOutline.cs.meta rename to Scripts/Effects/BestFitOutline.cs.meta diff --git a/Scripts/CurvedText.cs b/Scripts/Effects/CurvedText.cs similarity index 100% rename from Scripts/CurvedText.cs rename to Scripts/Effects/CurvedText.cs diff --git a/Scripts/CurvedText.cs.meta b/Scripts/Effects/CurvedText.cs.meta similarity index 100% rename from Scripts/CurvedText.cs.meta rename to Scripts/Effects/CurvedText.cs.meta diff --git a/Scripts/Gradient.cs b/Scripts/Effects/Gradient.cs similarity index 100% rename from Scripts/Gradient.cs rename to Scripts/Effects/Gradient.cs diff --git a/Scripts/Gradient.cs.meta b/Scripts/Effects/Gradient.cs.meta similarity index 100% rename from Scripts/Gradient.cs.meta rename to Scripts/Effects/Gradient.cs.meta diff --git a/Scripts/LetterSpacing.cs b/Scripts/Effects/LetterSpacing.cs similarity index 100% rename from Scripts/LetterSpacing.cs rename to Scripts/Effects/LetterSpacing.cs diff --git a/Scripts/LetterSpacing.cs.meta b/Scripts/Effects/LetterSpacing.cs.meta similarity index 100% rename from Scripts/LetterSpacing.cs.meta rename to Scripts/Effects/LetterSpacing.cs.meta diff --git a/Scripts/NicerOutline.cs b/Scripts/Effects/NicerOutline.cs similarity index 100% rename from Scripts/NicerOutline.cs rename to Scripts/Effects/NicerOutline.cs diff --git a/Scripts/NicerOutline.cs.meta b/Scripts/Effects/NicerOutline.cs.meta similarity index 100% rename from Scripts/NicerOutline.cs.meta rename to Scripts/Effects/NicerOutline.cs.meta diff --git a/Scripts/UIFlippable.cs b/Scripts/Effects/UIFlippable.cs similarity index 100% rename from Scripts/UIFlippable.cs rename to Scripts/Effects/UIFlippable.cs diff --git a/Scripts/UIFlippable.cs.meta b/Scripts/Effects/UIFlippable.cs.meta similarity index 100% rename from Scripts/UIFlippable.cs.meta rename to Scripts/Effects/UIFlippable.cs.meta diff --git a/Scripts/UIImageCrop.cs b/Scripts/Effects/UIImageCrop.cs similarity index 74% rename from Scripts/UIImageCrop.cs rename to Scripts/Effects/UIImageCrop.cs index 22538ae..46c4065 100644 --- a/Scripts/UIImageCrop.cs +++ b/Scripts/Effects/UIImageCrop.cs @@ -4,7 +4,7 @@ namespace UnityEngine.UI.Extensions { - [AddComponentMenu("UI/Extensions/UIImageCrop")] + [AddComponentMenu("UI/Effects/Extensions/UIImageCrop")] [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] public class UIImageCrop : MonoBehaviour @@ -19,9 +19,9 @@ namespace UnityEngine.UI.Extensions // Use this for initialization void Start() { - SetMaterial(); } + public void SetMaterial() { mGraphic = this.GetComponent(); @@ -29,10 +29,17 @@ namespace UnityEngine.UI.Extensions YCropProperty = Shader.PropertyToID("_YCrop"); if (mGraphic != null) { + if (mGraphic.material == null || mGraphic.material.name == "Default UI Material") + { + //Applying default material with UI Image Crop shader + mGraphic.material = new Material(Shader.Find("UI Extensions/UI Image Crop")); + } mat = mGraphic.material; - } - else Debug.LogError("Please attach a UI component"); + else + { + Debug.LogError("Please attach component to a Graphical UI component"); + } } public void OnValidate() { diff --git a/Scripts/UIImageCrop.cs.meta b/Scripts/Effects/UIImageCrop.cs.meta similarity index 100% rename from Scripts/UIImageCrop.cs.meta rename to Scripts/Effects/UIImageCrop.cs.meta