| | |
| | | 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 < 3; i++) |
| | | { |
| | | fly = CreateIcon(ts); |
| | | fly.SetDestination(sp, startP, endP, useBezier); |
| | | } |
| | | |
| | | yield break; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 调用掉落获得事件 |
| | | /// </summary> |
| | |
| | | public GameObject drapIcon; |
| | | public void OnClick() |
| | | { |
| | | //GameObject obj; |
| | | FlyImage fly; |
| | | //GameObject ui = GameObject.Find("BottomUI"); |
| | | |
| | | if (Application.platform == RuntimePlatform.WindowsEditor) |
| | | { |
| | | //UnityEditor.EditorApplication.isPaused = true; |
| | | } |
| | | if (isBox) |
| | | { |
| | | for (int i = 0; i < 5; i++) |
| | | { |
| | | fly = EndlessDropManager.instance.CreateIcon(transform.parent); |
| | | fly.SetDestination(Icon.sprite, transform.position, (propBtn.transform as RectTransform).position, true); |
| | | } |
| | | EndlessDropManager.instance.FlyIcon(transform.parent, Icon.sprite, transform.position, (propBtn.transform as RectTransform).position, true); |
| | | } |
| | | else |
| | | { |
| | | fly = EndlessDropManager.instance.CreateIcon(transform.parent); |
| | | FlyImage fly = EndlessDropManager.instance.CreateIcon(transform.parent); |
| | | fly.SetDestination(Icon.sprite, transform.position, (propBtn.transform as RectTransform).position, false); |
| | | } |
| | | if (ClickDropEvent != null) |
| | | ClickDropEvent(DropData); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | private void Bezier_Move() |
| | | { |
| | | transform.DOMove(point[index], 0.01f).OnComplete(Bezier_Move); |
| | | index++; |
| | | if (index >= point.Count) |
| | | if (index + 2 >= point.Count) |
| | | { |
| | | //到终点了 |
| | | Close(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | transform.DOMove(point[index], 0.01f).OnComplete(Bezier_Move); |
| | | |
| | | index += 2; |
| | | } |
| | | } |
| | | |