LiuQilin 8 years ago
parent
commit
c3825907d2

BIN
.vs/MyLovelyGarden/v14/.suo


BIN
Assets/Resources/Garden.unity


BIN
Assets/Resources/Prefab/PrefabUI/Canvas.prefab


BIN
Assets/Resources/Prefab/PrefabUI/FlowerHouseItem.prefab


BIN
Assets/Resources/Shader/Gray.mat


+ 54 - 5
Assets/Resources/Shader/Gray.shader

@@ -3,43 +3,84 @@
 	Properties
 	Properties
 	{
 	{
 		_MainTex ("Texture", 2D) = "white" {}
 		_MainTex ("Texture", 2D) = "white" {}
+
+		_StencilComp("Stencil Comparison", Float) = 8
+		_Stencil("Stencil ID", Float) = 0
+		_StencilOp("Stencil Operation", Float) = 0
+		_StencilWriteMask("Stencil Write Mask", Float) = 255
+		_StencilReadMask("Stencil Read Mask", Float) = 255
+		_ColorMask("Color Mask", Float) = 15
+
+		[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip("Use Alpha Clip", Float) = 0
 	}
 	}
 
 
 	SubShader
 	SubShader
 	{
 	{
-		Tags { "Queue"="Overlay" }
+		Tags
+		{
+			"Queue" = "Transparent"
+			"IgnoreProjector" = "True"
+			"RenderType" = "Transparent"
+			"PreviewType" = "Plane"
+			"CanUseSpriteAtlas" = "True"
+		}
 
 
-		Pass
+			Stencil
 		{
 		{
+			Ref[_Stencil]
+			Comp[_StencilComp]
+			Pass[_StencilOp]
+			ReadMask[_StencilReadMask]
+			WriteMask[_StencilWriteMask]
+		}
+
+			Cull Off
+			Lighting Off
+			ZWrite Off
+			ZTest[unity_GUIZTestMode]
 			Blend SrcAlpha OneMinusSrcAlpha
 			Blend SrcAlpha OneMinusSrcAlpha
+			ColorMask[_ColorMask]
 
 
+		Pass
+		{
 			CGPROGRAM
 			CGPROGRAM
 
 
 			#pragma vertex vert
 			#pragma vertex vert
 			#pragma fragment frag
 			#pragma fragment frag
 			
 			
+			#pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+			#include "UnityUI.cginc"
 			#include "UnityCG.cginc"
 			#include "UnityCG.cginc"
 
 
 			struct appdata
 			struct appdata
 			{
 			{
-				float4 vertex : POSITION;
 				float2 uv : TEXCOORD0;
 				float2 uv : TEXCOORD0;
+				float4 color : COLOR;
+				float4 vertex : POSITION;
 			};
 			};
 
 
 			struct v2f
 			struct v2f
 			{
 			{
 				float2 uv : TEXCOORD0;
 				float2 uv : TEXCOORD0;
+				float4 color : COLOR;
 				float4 vertex : SV_POSITION;
 				float4 vertex : SV_POSITION;
+				float4 worldPosition : TEXCOORD1;
 			};
 			};
 
 
 			sampler2D _MainTex;
 			sampler2D _MainTex;
 			float4 _MainTex_ST;
 			float4 _MainTex_ST;
-			
+			float4 _ClipRect;
+
 			v2f vert (appdata v)
 			v2f vert (appdata v)
 			{
 			{
 				v2f o;
 				v2f o;
+
+				o.worldPosition = v.vertex;
 				o.vertex = UnityObjectToClipPos(v.vertex);
 				o.vertex = UnityObjectToClipPos(v.vertex);
 				o.uv = TRANSFORM_TEX(v.uv, _MainTex);
 				o.uv = TRANSFORM_TEX(v.uv, _MainTex);
+				o.color = v.color;
+
 				return o;
 				return o;
 			}
 			}
 			
 			
@@ -50,9 +91,17 @@
 				fixed gray = dot(col.rgb, fixed3(0.299, 0.587, 0.114));
 				fixed gray = dot(col.rgb, fixed3(0.299, 0.587, 0.114));
 
 
 				col.rgb = fixed3(gray, gray, gray);
 				col.rgb = fixed3(gray, gray, gray);
+				col.a *= i.color.a; //CanvasGroup
+
+				col.a *= UnityGet2DClipping(i.worldPosition.xy, _ClipRect); //RectMask
+
+				#ifdef UNITY_UI_ALPHACLIP
+				clip(col.a - 0.001);
+				#endif
+
 				return col;
 				return col;
 			}
 			}
 			ENDCG
 			ENDCG
 		}
 		}
 	}
 	}
-}
+}

+ 9 - 0
Assets/Resources/Temp.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 0dcf62c8561c02f479195703efe90da2
+folderAsset: yes
+timeCreated: 1486173350
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/Resources/XML/Config/PlayerConfig.xml

@@ -3,7 +3,7 @@
   <Level value="0" />
   <Level value="0" />
   <Person value="1" />
   <Person value="1" />
   <Diamond value="0" />
   <Diamond value="0" />
-  <QuitTime value="3/20/2017 8:05:29 AM" />
+  <QuitTime value="3/20/2017 2:10:55 PM" />
   <CoinPerson value="1" />
   <CoinPerson value="1" />
   <CircleTimer value="0" />
   <CircleTimer value="0" />
   <PlantList FlowerTraA1="1" FlowerTraA2="2" FlowerTraA3="3" FlowerTraA4="4" FlowerTraA5="5" FlowerTraA6="6" FlowerTraA7="7" FlowerTraA8="8" FlowerTraA9="9" />
   <PlantList FlowerTraA1="1" FlowerTraA2="2" FlowerTraA3="3" FlowerTraA4="4" FlowerTraA5="5" FlowerTraA6="6" FlowerTraA7="7" FlowerTraA8="8" FlowerTraA9="9" />

+ 92 - 0
Assets/Script/Manage/ManaAnim.cs

@@ -34,6 +34,7 @@ public class ManaAnim : MonoBehaviour
     public static Dictionary<Transform, TweenCG> TweenCgDic;
     public static Dictionary<Transform, TweenCG> TweenCgDic;
     public static Dictionary<Transform, TweenGra> TweenGraDic;
     public static Dictionary<Transform, TweenGra> TweenGraDic;
     public static Dictionary<Transform, TweenVec> TweenVecDic;
     public static Dictionary<Transform, TweenVec> TweenVecDic;
+    public static Dictionary<Transform, TweenRect> TweenRectDic;
     public static Dictionary<Transform, TweenScale> TweenScaleDic;
     public static Dictionary<Transform, TweenScale> TweenScaleDic;
     public static Dictionary<Transform, TweenAudio> TweenAudioDic;
     public static Dictionary<Transform, TweenAudio> TweenAudioDic;
 
 
@@ -86,6 +87,7 @@ public class ManaAnim : MonoBehaviour
         TweenCgDic = new Dictionary<Transform, TweenCG>();
         TweenCgDic = new Dictionary<Transform, TweenCG>();
         TweenGraDic = new Dictionary<Transform, TweenGra>();
         TweenGraDic = new Dictionary<Transform, TweenGra>();
         TweenVecDic = new Dictionary<Transform, TweenVec>();
         TweenVecDic = new Dictionary<Transform, TweenVec>();
+        TweenRectDic = new Dictionary<Transform, TweenRect>();
         TweenScaleDic = new Dictionary<Transform, TweenScale>();
         TweenScaleDic = new Dictionary<Transform, TweenScale>();
         TweenAudioDic = new Dictionary<Transform, TweenAudio>();
         TweenAudioDic = new Dictionary<Transform, TweenAudio>();
 
 
@@ -212,6 +214,20 @@ public class ManaAnim : MonoBehaviour
         }
         }
     }
     }
 
 
+    public static void TweenForRect(Transform target)
+    {
+        TweenRect tweenRect;
+
+        if (TweenRectDic.TryGetValue(target, out tweenRect))
+        {
+            tweenRect.StartForward();
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
     public static void TweenForScale(Transform target)
     public static void TweenForScale(Transform target)
     {
     {
         TweenScale tweenScale;
         TweenScale tweenScale;
@@ -283,6 +299,20 @@ public class ManaAnim : MonoBehaviour
         }
         }
     }
     }
 
 
+    public static void TweenBacRect(Transform target)
+    {
+        TweenRect tweenRect;
+
+        if (TweenRectDic.TryGetValue(target, out tweenRect))
+        {
+            tweenRect.StartBackward();
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
     public static void TweenBacScale(Transform target)
     public static void TweenBacScale(Transform target)
     {
     {
         TweenScale tweenScale;
         TweenScale tweenScale;
@@ -372,6 +402,20 @@ public class ManaAnim : MonoBehaviour
         }
         }
     }
     }
 
 
+    public static TweenRect GetTweenRect(Transform target)
+    {
+        TweenRect tweenRect;
+
+        if (TweenRectDic.TryGetValue(target, out tweenRect))
+        {
+            return tweenRect;
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
     public static TweenScale GetTweenScale(Transform target)
     public static TweenScale GetTweenScale(Transform target)
     {
     {
         TweenScale tweenScale;
         TweenScale tweenScale;
@@ -566,6 +610,54 @@ public class ManaAnim : MonoBehaviour
         }
         }
     }
     }
 
 
+    public static TweenRect CreateTweenRect(Transform target, Vector2 origin, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve)
+    {
+        if (TweenRectDic.ContainsKey(target))
+        {
+            RectTransform rectTra = target.GetComponent<RectTransform>();
+
+            TweenRect tween = TweenRectDic[target];
+
+            tween = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve);
+
+            return tween;
+        }
+        else
+        {
+            RectTransform rectTra = target.GetComponent<RectTransform>();
+
+            TweenRect tween = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve);
+
+            TweenRectDic.Add(target, tween);
+
+            return tween;
+        }
+    }
+
+    public static TweenRect CreateTweenRect(Transform target, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve)
+    {
+        if (TweenRectDic.ContainsKey(target))
+        {
+            RectTransform rectTra = target.GetComponent<RectTransform>();
+
+            TweenRect tween = TweenRectDic[target];
+
+            tween = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve);
+
+            return tween;
+        }
+        else
+        {
+            RectTransform rectTra = target.GetComponent<RectTransform>();
+
+            TweenRect tween = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve);
+
+            TweenRectDic.Add(target, tween);
+
+            return tween;
+        }
+    }
+
     public static TweenScale CreateTweenScale(Transform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     public static TweenScale CreateTweenScale(Transform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     {
     {
         if (TweenScaleDic.ContainsKey(target))
         if (TweenScaleDic.ContainsKey(target))

+ 14 - 5
Assets/Script/Manage/ManaUI.cs

@@ -351,7 +351,7 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fb_Magic", false);
                 ManaReso.SetActive("Fb_Magic", false);
                 ManaReso.SetActive("Fa_Garden", false);
                 ManaReso.SetActive("Fa_Garden", false);
 
 
-                ManaReso.SetActive("F_SkillBar", false);
+                ManaReso.SetActive("Ff_SkillBar", false);
             }
             }
         );
         );
 
 
@@ -374,7 +374,7 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fb_Magic", false);
                 ManaReso.SetActive("Fb_Magic", false);
                 ManaReso.SetActive("Fa_Garden", false);
                 ManaReso.SetActive("Fa_Garden", false);
 
 
-                ManaReso.SetActive("F_SkillBar", false);
+                ManaReso.SetActive("Ff_SkillBar", false);
             }
             }
         );
         );
 
 
@@ -397,7 +397,7 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fb_Magic", true);
                 ManaReso.SetActive("Fb_Magic", true);
                 ManaReso.SetActive("Fa_Garden", false);
                 ManaReso.SetActive("Fa_Garden", false);
 
 
-                ManaReso.SetActive("F_SkillBar", false);
+                ManaReso.SetActive("Ff_SkillBar", false);
             }
             }
         );
         );
 
 
@@ -422,14 +422,14 @@ public class ManaUI : MonoBehaviour
 
 
                 if (ManaData.SkillBar)
                 if (ManaData.SkillBar)
                 {
                 {
-                    ManaReso.SetActive("F_SkillBar", true);
+                    ManaReso.SetActive("Ff_SkillBar", true);
                 }
                 }
             }
             }
         );
         );
 
 
         #endregion
         #endregion
 
 
-        #region F_Garden
+        #region F_Flower
 
 
         ManaReso.AddButtonEvent
         ManaReso.AddButtonEvent
         (
         (
@@ -442,6 +442,15 @@ public class ManaUI : MonoBehaviour
 
 
         #endregion
         #endregion
 
 
+        #region Fa_Scrr
+
+        RectTransform rectTra1 = ManaReso.Get<RectTransform>("Fa_Scrr");
+        RectTransform rectTra2 = ManaReso.Get<RectTransform>("Ff_SkillBar");
+
+        rectTra1.CreateTweenRect(rectTra1.rect.size + new Vector2(0, -rectTra2.rect.height), 0.25f, true, true, Curve.EaseOutQuad);
+
+        #endregion
+
         #region F_Manage
         #region F_Manage
 
 
         ManaReso.Get("F_Manage").CreateTweenVec(ManaReso.Get("F_PageTra").position, 0.5f, false, true, Curve.EaseOutQuad);
         ManaReso.Get("F_Manage").CreateTweenVec(ManaReso.Get("F_PageTra").position, 0.5f, false, true, Curve.EaseOutQuad);

+ 1 - 0
Assets/Script/Object/Flower.cs

@@ -45,6 +45,7 @@ public class FlowerInfo
             if (_Unlock)
             if (_Unlock)
             {
             {
                 Text.text = "";
                 Text.text = "";
+                Image.material = null;
                 Button.interactable = true;
                 Button.interactable = true;
 
 
                 if (Special)
                 if (Special)

+ 2 - 5
Assets/Script/Object/Skill/BigSkill.cs

@@ -291,16 +291,13 @@ public class BigSkill : Skill
     {
     {
         if (!ManaData.SkillBar)
         if (!ManaData.SkillBar)
         {
         {
-            RectTransform skillBar = ManaReso.Get<RectTransform>("F_SkillBar");
-            RectTransform gardenScrr = ManaReso.Get<RectTransform>("Fa_Scrr");
-
-            gardenScrr.offsetMax += new Vector2(0, -skillBar.rect.height);
+            ManaReso.Get("Fa_Scrr").TweenForRect();
 
 
             ManaData.SkillBar = true;
             ManaData.SkillBar = true;
 
 
             if (ManaReso.Get("Fa_Garden").gameObject.activeSelf)
             if (ManaReso.Get("Fa_Garden").gameObject.activeSelf)
             {
             {
-                skillBar.SetActive(true);
+                ManaReso.SetActive("Ff_SkillBar", true);
             }
             }
         }
         }
     }
     }

+ 6 - 7
Assets/Script/Tool/Anim/TweenScrr.cs → Assets/Script/Tool/Anim/TweenRect.cs

@@ -2,7 +2,7 @@
 
 
 using System.Collections;
 using System.Collections;
 
 
-public class TweenScrr : Tween 
+public class TweenRect : Tween 
 {
 {
     #region
     #region
 
 
@@ -15,7 +15,7 @@ public class TweenScrr : Tween
 
 
     #endregion
     #endregion
 
 
-    public TweenScrr(RectTransform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
+    public TweenRect(RectTransform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     {
     {
         Target = target;
         Target = target;
 
 
@@ -100,7 +100,7 @@ public class TweenScrr : Tween
         Timer += Time.fixedDeltaTime;
         Timer += Time.fixedDeltaTime;
         if (Timer > Duration)
         if (Timer > Duration)
         {
         {
-            Target.position = Destination;
+            Target.sizeDelta = Destination;
             
             
             Timer = 0;
             Timer = 0;
             IsForward = false;
             IsForward = false;
@@ -112,8 +112,7 @@ public class TweenScrr : Tween
         }
         }
         else
         else
         {
         {
-            Target.position = Func(Timer, Duration, Origin, Delta);
-
+            Target.sizeDelta = Func(Timer, Duration, Origin, Delta);
 
 
             return false;
             return false;
         }
         }
@@ -124,7 +123,7 @@ public class TweenScrr : Tween
         Timer += Time.fixedDeltaTime;
         Timer += Time.fixedDeltaTime;
         if (Timer > Duration)
         if (Timer > Duration)
         {
         {
-            Target.position = Origin;
+            Target.sizeDelta = Origin;
 
 
             Timer = 0;
             Timer = 0;
             IsBackward = false;
             IsBackward = false;
@@ -135,7 +134,7 @@ public class TweenScrr : Tween
         }
         }
         else
         else
         {
         {
-            Target.position = Func(Timer, Duration, Destination, -Delta);
+            Target.sizeDelta = Func(Timer, Duration, Destination, -Delta);
 
 
 
 
             return false;
             return false;

+ 0 - 0
Assets/Script/Tool/Anim/TweenScrr.cs.meta → Assets/Script/Tool/Anim/TweenRect.cs.meta


+ 10 - 10
Assets/Script/Tool/Anim/TweenScale.cs

@@ -11,7 +11,7 @@ public class TweenScale : Tween
     public Vector3 Origin;
     public Vector3 Origin;
     public Vector3 Destination;
     public Vector3 Destination;
     public Transform Target;
     public Transform Target;
-    public CanvasGroup CanvasGroup;
+    public CanvasGroup CG;
     public CurveFunctionV Func;
     public CurveFunctionV Func;
 
 
     #endregion
     #endregion
@@ -31,15 +31,15 @@ public class TweenScale : Tween
         Origin = origin;
         Origin = origin;
         Destination = destination;
         Destination = destination;
 
 
-        CanvasGroup = Target.GetComponent<CanvasGroup>();
+        CG = Target.GetComponent<CanvasGroup>();
 
 
         OnForwardStart += () =>
         OnForwardStart += () =>
         {
         {
             Target.SetActive(true);
             Target.SetActive(true);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = false;
+                CG.interactable = false;
             }
             }
         };
         };
 
 
@@ -47,9 +47,9 @@ public class TweenScale : Tween
         {
         {
             Target.SetActive(DestActive);
             Target.SetActive(DestActive);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = DestActive;
+                CG.interactable = DestActive;
             }
             }
         };
         };
 
 
@@ -57,9 +57,9 @@ public class TweenScale : Tween
         {
         {
             Target.SetActive(true);
             Target.SetActive(true);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = false;
+                CG.interactable = false;
             }
             }
         };
         };
 
 
@@ -67,9 +67,9 @@ public class TweenScale : Tween
         {
         {
             Target.SetActive(OriginActive);
             Target.SetActive(OriginActive);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = OriginActive;
+                CG.interactable = OriginActive;
             }
             }
         };
         };
 
 

+ 10 - 10
Assets/Script/Tool/Anim/TweenVec.cs

@@ -11,7 +11,7 @@ public class TweenVec : Tween
     protected Vector3 Origin;
     protected Vector3 Origin;
     protected Vector3 Destination;
     protected Vector3 Destination;
     protected Transform Target;
     protected Transform Target;
-    protected CanvasGroup CanvasGroup;
+    protected CanvasGroup CG;
     protected CurveFunctionV Func;
     protected CurveFunctionV Func;
 
 
     #endregion
     #endregion
@@ -31,15 +31,15 @@ public class TweenVec : Tween
         Origin = origin;
         Origin = origin;
         Destination = destination;
         Destination = destination;
 
 
-        CanvasGroup = Target.GetComponent<CanvasGroup>();
+        CG = Target.GetComponent<CanvasGroup>();
 
 
         OnForwardStart += () =>
         OnForwardStart += () =>
         {
         {
             Target.SetActive(true);
             Target.SetActive(true);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = false;
+                CG.interactable = false;
             }
             }
         };
         };
 
 
@@ -47,9 +47,9 @@ public class TweenVec : Tween
         {
         {
             Target.SetActive(DestActive);
             Target.SetActive(DestActive);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = DestActive;
+                CG.interactable = DestActive;
             }
             }
         };
         };
 
 
@@ -57,9 +57,9 @@ public class TweenVec : Tween
         {
         {
             Target.SetActive(true);
             Target.SetActive(true);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = false;
+                CG.interactable = false;
             }
             }
         };
         };
 
 
@@ -67,9 +67,9 @@ public class TweenVec : Tween
         {
         {
             Target.SetActive(OriginActive);
             Target.SetActive(OriginActive);
 
 
-            if (CanvasGroup != null)
+            if (CG != null)
             {
             {
-                CanvasGroup.interactable = OriginActive;
+                CG.interactable = OriginActive;
             }
             }
         };
         };
 
 

+ 3 - 3
Assets/Script/Tool/Data.cs

@@ -194,7 +194,7 @@ public class Data
         attributes[0].RemoveAll();
         attributes[0].RemoveAll();
 
 
         XmlAttribute xmlAttribute = attributes.Append(PlayerDoc.CreateAttribute("ID"));
         XmlAttribute xmlAttribute = attributes.Append(PlayerDoc.CreateAttribute("ID"));
-
+        
         foreach (var kv in ManaGarden.FlowerDic)
         foreach (var kv in ManaGarden.FlowerDic)
         {
         {
             if (kv.Value.Unlock)
             if (kv.Value.Unlock)
@@ -207,7 +207,7 @@ public class Data
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
     }
     }
 
 
-    public static void SavePlayerConfig()
+    public  static void SavePlayerConfig()
     {
     {
         SaveSkillList();
         SaveSkillList();
         SavePlantList();
         SavePlantList();
@@ -391,7 +391,7 @@ public class Data
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
     }
     }
 
 
-    public static void ResetPlayerConfig()
+    public  static void ResetPlayerConfig()
     {
     {
         ResetSkillList();
         ResetSkillList();
         ResetPlantList();
         ResetPlantList();

+ 26 - 0
Assets/Script/Tool/Extension.cs

@@ -144,6 +144,11 @@ public static class Extension
         ManaAnim.TweenForGra(comp.transform);
         ManaAnim.TweenForGra(comp.transform);
     }
     }
 
 
+    public static void TweenForRect(this Component comp)
+    {
+        ManaAnim.TweenForRect(comp.transform);
+    }
+
     public static void TweenForScale(this Component comp)
     public static void TweenForScale(this Component comp)
     {
     {
         ManaAnim.TweenForScale(comp.transform);
         ManaAnim.TweenForScale(comp.transform);
@@ -171,6 +176,11 @@ public static class Extension
         ManaAnim.TweenBacGra(comp.transform);
         ManaAnim.TweenBacGra(comp.transform);
     }
     }
 
 
+    public static void TweenBacRect(this Component comp)
+    {
+        ManaAnim.TweenBacRect(comp.transform);
+    }
+
     public static void TweenBacScale(this Component comp)
     public static void TweenBacScale(this Component comp)
     {
     {
         ManaAnim.TweenBacScale(comp.transform);
         ManaAnim.TweenBacScale(comp.transform);
@@ -197,6 +207,11 @@ public static class Extension
         return ManaAnim.GetTweenGra(comp.transform);
         return ManaAnim.GetTweenGra(comp.transform);
     }
     }
 
 
+    public static TweenRect GetTweenRect(this Component comp)
+    {
+        return ManaAnim.GetTweenRect(comp.transform);
+    }
+
     public static TweenScale GetTweenScale(this Component comp)
     public static TweenScale GetTweenScale(this Component comp)
     {
     {
         return ManaAnim.GetTweenScale(comp.transform);
         return ManaAnim.GetTweenScale(comp.transform);
@@ -238,6 +253,16 @@ public static class Extension
         return ManaAnim.CreateTweenVec(comp.transform, destination, duration, originActive, destActive, curve);
         return ManaAnim.CreateTweenVec(comp.transform, destination, duration, originActive, destActive, curve);
     }
     }
 
 
+    public static TweenRect CreateTweenRect(this Component comp, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
+    {
+        return ManaAnim.CreateTweenRect(comp.transform, origin, destination, duration, originActive, destActive, curve);
+    }
+
+    public static TweenRect CreateTweenRect(this Component comp, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
+    {
+        return ManaAnim.CreateTweenRect(comp.transform, destination, duration, originActive, destActive, curve);
+    }
+
     public static TweenScale CreateTweenScale(this Component comp, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     public static TweenScale CreateTweenScale(this Component comp, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     {
     {
         return ManaAnim.CreateTweenScale(comp.transform, origin, destination, duration, originActive, destActive, curve);
         return ManaAnim.CreateTweenScale(comp.transform, origin, destination, duration, originActive, destActive, curve);
@@ -257,6 +282,7 @@ public static class Extension
     {
     {
         return ManaAnim.CreateTweenAudio(comp.transform, destination, duration, originActive, destActive, curve);
         return ManaAnim.CreateTweenAudio(comp.transform, destination, duration, originActive, destActive, curve);
     }
     }
+    
     #endregion
     #endregion
 
 
     #region Vector3
     #region Vector3

+ 32 - 7
Assets/Script/Tool/UI/FlowerCard.cs

@@ -17,6 +17,7 @@ public class FlowerCard : MonoBehaviour
     public float RightBorder;
     public float RightBorder;
 
 
     public Transform SeleItem;
     public Transform SeleItem;
+    public Transform ScrollSeleItem;
     public List<Transform> ItemList;
     public List<Transform> ItemList;
     public List<FlowerInfo> InfoList;
     public List<FlowerInfo> InfoList;
 
 
@@ -181,30 +182,54 @@ public class FlowerCard : MonoBehaviour
             {
             {
                 ScrollRect.content.SetX(RightBorder);
                 ScrollRect.content.SetX(RightBorder);
             }
             }
-
-            //ScrollRect.horizontalNormalizedPosition = Mathf.Clamp(ScrollRect.horizontalNormalizedPosition, -1/(float) (ItemList.Count - 3), (ItemList.Count - 2)/(float) (ItemList.Count - 3));
         }
         }
         else
         else
         {
         {
             ScrollRect.horizontal = false;
             ScrollRect.horizontal = false;
         }
         }
-    }
 
 
-    public void OnEndDrag(PointerEventData eventData)
-    {
         float minX = 999999999;
         float minX = 999999999;
 
 
         for (int i = 0; i < ItemList.Count; i++)
         for (int i = 0; i < ItemList.Count; i++)
         {
         {
             float x = Mathf.Abs(ItemList[i].localPosition.x - ScrollRect.content.InverseTransformPoint(ScrollRect.transform.position).x);
             float x = Mathf.Abs(ItemList[i].localPosition.x - ScrollRect.content.InverseTransformPoint(ScrollRect.transform.position).x);
-            
+
             if (x < minX)
             if (x < minX)
             {
             {
                 minX = x;
                 minX = x;
+                ScrollSeleItem = ItemList[i];
                 ScrollSelectIndex = i;
                 ScrollSelectIndex = i;
             }
             }
         }
         }
 
 
-        Select(ScrollSelectIndex);
+        if (ScrollSelectIndex != SelectIndex)
+        {
+            SeleItem.TweenBacScale();
+            ScrollSeleItem.TweenForScale();
+            ScrollSeleItem.SetAsLastSibling();
+
+            ManaGarden.SetFlowerCard(InfoList[ScrollSelectIndex].Id);
+
+            SeleItem = ScrollSeleItem;
+            SelectIndex = ScrollSelectIndex;
+        }
+    }
+
+    public void OnEndDrag(PointerEventData eventData)
+    {
+        //float minX = 999999999;
+
+        //for (int i = 0; i < ItemList.Count; i++)
+        //{
+        //    float x = Mathf.Abs(ItemList[i].localPosition.x - ScrollRect.content.InverseTransformPoint(ScrollRect.transform.position).x);
+            
+        //    if (x < minX)
+        //    {
+        //        minX = x;
+        //        ScrollSelectIndex = i;
+        //    }
+        //}
+
+        //Select(ScrollSelectIndex);
     }
     }
 }
 }

+ 16 - 13
MyLovelyGarden.sln

@@ -1,9 +1,9 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2015
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLovelyGarden", "MyLovelyGarden.csproj", "{9F3A3259-D53B-F6C8-8878-C5B99621035A}"
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2008
+
+Project("{8A8BB0A8-D809-F2DF-89D6-F26151FFF558}") = "MyLovelyGarden", "Assembly-CSharp.csproj", "{21BB93BC-2239-D8F5-1219-201F8DCBAF49}"
 EndProject
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLovelyGarden.Editor", "MyLovelyGarden.Editor.csproj", "{B575449E-FD9A-1672-368B-EC1E1252F6E4}"
+Project("{8A8BB0A8-D809-F2DF-89D6-F26151FFF558}") = "MyLovelyGarden", "Assembly-CSharp-Editor.csproj", "{A08052E5-32CE-91C0-FF56-C60C901D6BEF}"
 EndProject
 EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,16 +11,19 @@ Global
 		Release|Any CPU = Release|Any CPU
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	EndGlobalSection
+	GlobalSection(MonoDevelopProperties) = preSolution
+		StartupItem = Assembly-CSharp.csproj
+	EndGlobalSection
 EndGlobal
 EndGlobal

+ 0 - 12
MyLovelyGarden.txt

@@ -1,17 +1,5 @@
-TweenScrr改为TweenRect
-
-给Rect添加动画
-
-CanvasGroup改为CG
-
 进行到ManaData
 进行到ManaData
 
 
-Xml加密
-
-ListView实时放大
-
-给GameObject添加Extension
-
 图文混排
 图文混排
 
 
 
 

BIN
ProjectSettings/GraphicsSettings.asset