From d69611d66431e28ea35477c6781a00d57ae04fa3 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 7 Apr 2021 21:13:03 +0800 Subject: =?UTF-8?q?*=E5=9B=A0=E4=B8=BA=E6=B2=A1=E6=9C=89meta=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4missing=EF=BC=8C=E5=88=A0=E9=99=A4UIEffect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Test/UIEffect/Program/UIFlip.cs | 69 ---------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 Assets/Test/UIEffect/Program/UIFlip.cs (limited to 'Assets/Test/UIEffect/Program/UIFlip.cs') diff --git a/Assets/Test/UIEffect/Program/UIFlip.cs b/Assets/Test/UIEffect/Program/UIFlip.cs deleted file mode 100644 index 2cb7055..0000000 --- a/Assets/Test/UIEffect/Program/UIFlip.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -namespace Coffee.UIEffects -{ - [DisallowMultipleComponent] - [AddComponentMenu("UI/UIEffects/UIFlip", 102)] - public class UIFlip : BaseMeshEffect - { - [Tooltip("Flip horizontally.")] [SerializeField] - private bool m_Horizontal = false; - - [Tooltip("Flip vertically.")] [SerializeField] - private bool m_Veritical = false; - - /// - /// Gets or sets a value indicating whether this should be flipped horizontally. - /// - /// true if be flipped horizontally; otherwise, false. - public bool horizontal - { - get { return m_Horizontal; } - set - { - if (m_Horizontal == value) return; - m_Horizontal = value; - SetEffectParamsDirty(); - } - } - - /// - /// Gets or sets a value indicating whether this should be flipped vertically. - /// - /// true if be flipped horizontally; otherwise, false. - public bool vertical - { - get { return m_Veritical; } - set - { - if (m_Veritical == value) return; - m_Veritical = value; - SetEffectParamsDirty(); - } - } - - /// - /// Call used to modify mesh. - /// - /// VertexHelper. - public override void ModifyMesh(VertexHelper vh, Graphic graphic) - { - if (!isActiveAndEnabled) return; - - var vt = default(UIVertex); - for (var i = 0; i < vh.currentVertCount; i++) - { - vh.PopulateUIVertex(ref vt, i); - var pos = vt.position; - vt.position = new Vector3( - m_Horizontal ? -pos.x : pos.x, - m_Veritical ? -pos.y : pos.y - ); - vh.SetUIVertex(vt, i); - } - } - } -} -- cgit v1.1-26-g67d0