liuzhiwei
2020-12-28 20d94d22bd80b0f3b748d2078916ebaa1d6ec856
Assets/Scripts/UI/ClickEffect.cs
@@ -45,14 +45,19 @@
    {
        if (Application.isMobilePlatform)
        {
            for (int i = 0; i < Input.touchCount; ++i)
            if (Input.touchCount > 0)
            {
                Touch touch = Input.GetTouch(i);
                Touch touch = Input.GetTouch(0);
                if (touch.phase == TouchPhase.Began)
                {
                    PlayFX(touch.position);
                }
            }
            // for (int i = 0; i < Input.touchCount; ++i)
            // {
            // }
        }
        else
        {
@@ -66,6 +71,8 @@
    private void PlayFX(Vector2 tapPos)
    {
        if (Time.timeScale < 0.0001f) return;
        RecycleEffectc fx = CreateFX();
        RectTransform fxRectTrans = fx.gameObject.GetComponent<RectTransform>();
@@ -75,7 +82,7 @@
        fxRectTrans.anchoredPosition3D = fxLocalPos;
        //fxRectTrans.localScale = Vector3.one;
        fx.gameObject.SetActive(true);
        fx.StartPlay(fxLifeTime,RecycleFX);
        fx.StartPlay(fxLifeTime, RecycleFX);
    }