| | |
| | | { |
| | | AllDropList = new List<EndlessDrop>(); |
| | | DropObjDic = new Dictionary<int, GameObject>(); |
| | | allIconLis = new List<FlyImage>(); |
| | | } |
| | | |
| | | // Update is called once per frame |
| | |
| | | |
| | | if (AllDropList[i].ElapsedTime >= AllDropList[i].AutoPickupTime) |
| | | { |
| | | AllDropList[i].IsPickupCompleted = true; |
| | | SafelyCallObtainDrop(AllDropList[i]); |
| | | RemoveDrop(AllDropList[i].Id); |
| | | EndlessDropReward dropReward = DropObjDic[AllDropList[i].Id].GetComponent<EndlessDropReward>(); |
| | | dropReward?.OnClick(); |
| | | |
| | | //AllDropList[i].IsPickupCompleted = true; |
| | | //SafelyCallObtainDrop(AllDropList[i]); |
| | | //RemoveDrop(AllDropList[i].Id); |
| | | } |
| | | } |
| | | } |
| | |
| | | dropReward.DropData = drop; |
| | | dropReward.SetIcon(); |
| | | |
| | | GameObject mainUI = GameObject.Find("MainUI"); |
| | | GameObject mainUI = GameObject.Find("BottomUI"); |
| | | |
| | | Transform mainUITransform = mainUI.transform; |
| | | obj.transform.SetParent(mainUITransform, false); |
| | |
| | | DropObjDic.Add(drop.Id, obj); |
| | | } |
| | | |
| | | |
| | | List<FlyImage> allIconLis; |
| | | public GameObject drapIcon; |
| | | |
| | | public FlyImage CreateIcon(Transform ts) |
| | | { |
| | | for (int i = 0; i < allIconLis.Count; i++) |
| | | { |
| | | if (!allIconLis[i].gameObject.activeSelf) |
| | | { |
| | | allIconLis[i].gameObject.SetActive(true); |
| | | return allIconLis[i]; |
| | | } |
| | | } |
| | | |
| | | GameObject obj = Instantiate(drapIcon, ts); |
| | | FlyImage fly = obj.GetComponent<FlyImage>(); |
| | | allIconLis.Add(fly); |
| | | return fly; |
| | | |
| | | } |
| | | |
| | | public void FlyIcon(Transform ts, Sprite sp, Vector3 startP, Vector3 endP, bool useBezier) |
| | | { |
| | | StartCoroutine(CreateIcon(ts, sp, startP, endP, useBezier)); |
| | | } |
| | | |
| | | IEnumerator CreateIcon(Transform ts, Sprite sp, Vector3 startP, Vector3 endP, bool useBezier) |
| | | { |
| | | FlyImage fly; |
| | | |
| | | // for (int i = 0; i < 5; i++) |
| | | // { |
| | | // fly = CreateIcon(ts); |
| | | // fly.SetDestination(sp, startP, endP, useBezier); |
| | | // } |
| | | // yield return new WaitForSeconds(0.2f); |
| | | |
| | | for (int i = 0; i < 15; i++) |
| | | { |
| | | fly = CreateIcon(ts); |
| | | fly.SetDestination(sp, startP, endP, useBezier); |
| | | yield return new WaitForSeconds(0.01f); |
| | | |
| | | } |
| | | |
| | | yield break; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 调用掉落获得事件 |
| | | /// </summary> |