From 35aa79fbdfb87b2763d1c50bca3752fe5d1b97af Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Fri, 27 Nov 2020 11:22:07 +0800 Subject: [PATCH] 修改金币飞特效 修改新手引导 修改图片位置 --- Assets/Scripts/UI/FlyImage.cs | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/UI/FlyImage.cs b/Assets/Scripts/UI/FlyImage.cs index 4f5a5d0..9bf81ea 100644 --- a/Assets/Scripts/UI/FlyImage.cs +++ b/Assets/Scripts/UI/FlyImage.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Security.AccessControl; +using System.Collections.Generic; using DG.Tweening; using KTGMGemClient; using TowerDefense.Level; @@ -27,6 +28,13 @@ ts = transform.GetComponent<RectTransform>(); } private Image tmpImage; + private bool isBroadCast; + private int tmpCurrency; + public void Init(bool isBC, int currency) + { + isBroadCast = isBC; + tmpCurrency = currency; + } /// <summary> /// 设置终点 /// </summary> @@ -59,28 +67,29 @@ } } - bool isUp; + bool isLeft; private Vector3 RandomPos() { Vector3 tmpV = Vector3.zero; - tmpV.x -= UnityEngine.Random.Range(10, 20); + tmpV.y += UnityEngine.Random.Range(30, 50); int a = UnityEngine.Random.Range(-20, 20); - isUp = a > 0; - tmpV.z += a; + isLeft = a > 0; + tmpV.x += a; return tmpV; } private Vector3 GetOffect() { Vector3 tmpV = Vector3.zero; - tmpV.x -= UnityEngine.Random.Range(10, 15); - if (isUp) + if (isLeft) { - tmpV.z += UnityEngine.Random.Range(10, 20); + tmpV.x -= UnityEngine.Random.Range(80, 150); + tmpV.y += UnityEngine.Random.Range(500, 600); } else { - tmpV.z -= UnityEngine.Random.Range(10, 20); + tmpV.x += UnityEngine.Random.Range(500, 600); + tmpV.y += UnityEngine.Random.Range(80, 150); } return tmpV; @@ -111,8 +120,12 @@ gameObject.SetActive(false); - EndlessLevelManager.instance.Currency.AddCurrency(1);//每个金币增加1 - EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.PlayGetGoldPS); + if (isBroadCast) + { + EndlessLevelManager.instance.Currency.AddCurrency(tmpCurrency); + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.PlayGetGoldPS); + } + //Core.Utilities.Poolable.TryPool(gameObject); } -- Gitblit v1.9.1