|
@@ -32,7 +32,7 @@ public class FlowerInfo
|
|
|
{
|
|
|
Text.text = "已放置";
|
|
|
|
|
|
- //Animator.Play("FlashLight");
|
|
|
+ UIPartical.Begin();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -90,7 +90,7 @@ public class FlowerInfo
|
|
|
public Sprite Sprite;
|
|
|
public Image Image;
|
|
|
public Button Button;
|
|
|
- public Animator Animator;
|
|
|
+ public UIPartical UIPartical;
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -105,8 +105,8 @@ public class FlowerInfo
|
|
|
Text = dic["Lab"].GetComponent<Text>();
|
|
|
Image = dic["Icon"].GetComponent<Image>();
|
|
|
Button = dic["FlowerItemG"].GetComponent<Button>();
|
|
|
- //Animator = dic["FlashLight"].GetComponent<Animator>();
|
|
|
-
|
|
|
+ UIPartical = dic["UIParticle System"].GetComponent<UIPartical>();
|
|
|
+
|
|
|
Id = int.Parse(attributes[0].Value);
|
|
|
Sprite = ManaReso.Load<Sprite>(attributes[3].Value, Folder.Garden);
|
|
|
|
|
@@ -147,7 +147,9 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
{
|
|
|
Phase = 0;
|
|
|
|
|
|
+ OperateBk.SetActive(false);
|
|
|
OperateIcon.SetActive(false);
|
|
|
+ OperateOutline.SetActive(false);
|
|
|
|
|
|
ManaReso.GetHudText("得分+15", Color.red, 18, ChildDic["ScoreTra"], ManaReso.Get("D_Status"), true);
|
|
|
|
|
@@ -160,7 +162,9 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
|
|
|
private OpType OpType;
|
|
|
private SpriteRenderer FlowerIcon;
|
|
|
+ private SpriteRenderer OperateBk;
|
|
|
private SpriteRenderer OperateIcon;
|
|
|
+ private SpriteRenderer OperateOutline;
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -216,7 +220,9 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
GoldIcon = ChildDic["GoldIcon"];
|
|
|
Animator = ChildDic["FlashLight"].GetComponent<Animator>();
|
|
|
FlowerIcon = ChildDic["FlowerIcon"].GetComponent<SpriteRenderer>();
|
|
|
+ OperateBk = ChildDic["OperateBk"].GetComponent<SpriteRenderer>();
|
|
|
OperateIcon = ChildDic["OperateIcon"].GetComponent<SpriteRenderer>();
|
|
|
+ OperateOutline = ChildDic["OperateOutline"].GetComponent<SpriteRenderer>();
|
|
|
|
|
|
Tween tween = FlowerIcon.CreateTweenSr(new Color(1, 1, 1), new Color(1, 0.5f, 0.5f), 0.2f, true, true, Curve.EaseOutQuad);
|
|
|
|
|
@@ -231,6 +237,15 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
{
|
|
|
OperateIcon.TweenBacSr();
|
|
|
};
|
|
|
+
|
|
|
+ tween = OperateBk.CreateTweenSr(new Color(1, 1, 1), new Color(1, 0.5f, 0.5f), 0.2f, true, true, Curve.EaseOutQuad);
|
|
|
+
|
|
|
+ tween.OnForwardFinish += () =>
|
|
|
+ {
|
|
|
+ OperateBk.TweenBacSr();
|
|
|
+ };
|
|
|
+
|
|
|
+ OperateBk.CreateTweenScale(OperateBk.transform.localScale + new Vector3(0.1f, 0.1f, 0.1f), 0.25f, false, true, Curve.EaseOutQuad);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -239,6 +254,7 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
public void GameOver()
|
|
|
{
|
|
|
ChildDic["MiniGame"].SetActive(false);
|
|
|
+ OperateBk.TweenBacScale();
|
|
|
}
|
|
|
|
|
|
public void GameBegin()
|
|
@@ -250,32 +266,39 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
|
|
|
public void SetFirstOp()
|
|
|
{
|
|
|
+ OperateBk.TweenForScale();
|
|
|
+
|
|
|
OperateIcon.SetAlpha(1);
|
|
|
- OperateIcon.material.shader = Shader.Find("DashGame/HighLight");
|
|
|
+ OperateOutline.SetAlpha(1);
|
|
|
|
|
|
OperateIcon.SetActive(true);
|
|
|
+ OperateOutline.SetActive(true);
|
|
|
}
|
|
|
|
|
|
public void SetSecondOp()
|
|
|
{
|
|
|
OperateIcon.SetAlpha(1);
|
|
|
- OperateIcon.material.shader = Shader.Find("Sprites/Default");
|
|
|
+ OperateOutline.SetAlpha(1);
|
|
|
|
|
|
OperateIcon.SetActive(true);
|
|
|
+ OperateOutline.SetActive(false);
|
|
|
}
|
|
|
|
|
|
public void SetThirdOp()
|
|
|
{
|
|
|
OperateIcon.SetAlpha(0.5f);
|
|
|
- OperateIcon.material.shader = Shader.Find("Sprites/Default");
|
|
|
+ OperateOutline.SetAlpha(0.5f);
|
|
|
|
|
|
OperateIcon.SetActive(true);
|
|
|
+ OperateOutline.SetActive(false);
|
|
|
}
|
|
|
|
|
|
public void CreateOp(int sequence)
|
|
|
{
|
|
|
float random = Random.Range(0f, 1f);
|
|
|
|
|
|
+ OperateBk.SetActive(true);
|
|
|
+
|
|
|
if (random <= 0.3333333f)
|
|
|
{
|
|
|
OpType = OpType.Rip;
|
|
@@ -310,6 +333,7 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
{
|
|
|
if (opType != OpType) //错误的操作
|
|
|
{
|
|
|
+ OperateBk.TweenForSr();
|
|
|
FlowerIcon.TweenForSr();
|
|
|
OperateIcon.TweenForSr();
|
|
|
|
|
@@ -354,7 +378,7 @@ public class Flower : ObjRoot, IPointerClickHandler
|
|
|
|
|
|
PlayAnim();
|
|
|
|
|
|
- OperateIcon.SetActive(false);
|
|
|
+ OperateBk.TweenBacScale();
|
|
|
|
|
|
return true;
|
|
|
}
|