Ejemplo n.º 1
0
 public void StartBrush(Vector3 pos)
 {
     if (isClearing)
     {
         return;
     }
     notTouch  = false;
     hasRefesh = false;
     StopCoroutine("AutoMoveHandle");
     if (trans_Handle.gameObject.activeSelf)
     {
         trans_Handle.gameObject.SetActive(false);
     }
     pos.z = 0;
     trans_brush.GetComponent <TrailRenderer>().Clear();
     trans_brush.position = VectorTransfer(pos);
     lastPos = pos;
     trans_brush.gameObject.SetActive(true);
     CheckAllCardShowWithPoint(pos);
     if (trans_UnShow.Count <= 2)
     {
         isClearing = true;
         MG_Manager.Instance.SendAdjustScratchEvent();
         if (MG_SaveManager.ScratchTotalPlayTimes > 0 && MG_SaveManager.ScratchTotalPlayTimes % 2 == 0)
         {
             MG_Manager.ShowIV(OnPopAdCallback, "scratch per 2 time iv");
         }
         else
         {
             OnPopAdCallback();
         }
     }
 }
Ejemplo n.º 2
0
 void OnNothanksClick()
 {
     if (isSpining)
     {
         return;
     }
     MG_Manager.ShowIV(OnPopAdCallback, "dice slots nothanks");
 }
Ejemplo n.º 3
0
 void OnCloseButtonClick()
 {
     MG_Manager.Play_ButtonClick();
     if (rewardType == MG_PopDoublePanel_RewardType.SignScratchTicket)
     {
         MG_Manager.Instance.Add_Save_ScratchTicket(rewardNum);
         MG_UIManager.Instance.FlyEffectTo_MenuTarget(img_RewardIcon.transform.position, MG_MenuFlyTarget.Scratch, rewardNum);
         MG_UIManager.Instance.ClosePopPanelAsync(MG_PopPanelType.DoublePanel);
     }
     else
     {
         MG_Manager.ShowIV(OnPopAdCallback, "reward panel close , type :" + rewardType);
     }
 }
Ejemplo n.º 4
0
 public void SetBrushPos(Vector3 pos)
 {
     if (isClearing)
     {
         return;
     }
     pos.z = 0;
     trans_brush.position = VectorTransfer(pos);
     CheckAllCardShow(pos);
     lastPos = pos;
     if (trans_UnShow.Count <= 2)
     {
         isClearing = true;
         MG_Manager.Instance.SendAdjustScratchEvent();
         if (MG_SaveManager.ScratchTotalPlayTimes > 0 && MG_SaveManager.ScratchTotalPlayTimes % 2 == 0)
         {
             MG_Manager.ShowIV(OnPopAdCallback, "scratch per 2 time iv");
         }
         else
         {
             OnPopAdCallback();
         }
     }
 }
Ejemplo n.º 5
0
        IEnumerator WaitRoateEnd()
        {
            img_midhandle.color = Color.clear;
            float endAngleZ = (-90 - 30 * rewardIndex) % 360;

            if (endAngleZ < 0)
            {
                endAngleZ += 360;
            }
            float       rotateSpeed     = 800;
            float       rotateBackSpeed = 300;
            float       time            = 0.6f;
            bool        isStop          = false;
            bool        isBack          = false;
            bool        isRight         = false;
            AudioSource spinAS          = MG_Manager.Play_SpinSlots();

            while (!isStop)
            {
                yield return(null);

                time -= Time.unscaledDeltaTime;
                if (time <= 0)
                {
                    if (!isRight)
                    {
                        rect_wheel.localEulerAngles = new Vector3(0, 0, endAngleZ);
                        isRight = true;
                    }
                    if (!isBack)
                    {
                        rotateBackSpeed -= 40;
                        rect_wheel.Rotate(new Vector3(0, 0, -Time.unscaledDeltaTime * rotateBackSpeed));
                        if (rotateBackSpeed <= 0)
                        {
                            isBack = true;
                        }
                    }
                    else
                    {
                        rotateBackSpeed += 20;
                        rect_wheel.Rotate(new Vector3(0, 0, Time.unscaledDeltaTime * rotateBackSpeed));
                        float angleZ = rect_wheel.localEulerAngles.z % 360;
                        if (angleZ < 0)
                        {
                            angleZ += 360;
                        }
                        if (Mathf.Abs(angleZ - endAngleZ) < 4)
                        {
                            rect_wheel.localEulerAngles = new Vector3(0, 0, endAngleZ);
                            isStop = true;
                        }
                    }
                }
                else
                {
                    rect_wheel.Rotate(new Vector3(0, 0, -Time.unscaledDeltaTime * rotateSpeed));
                }
            }
            spinAS.Stop();
            yield return(null);

            img_midhandle.color = Color.white;
            yield return(MG_Manager.WaitForSeconds(0.3f));

            img_midhandle.color = Color.clear;
            yield return(MG_Manager.WaitForSeconds(0.3f));

            img_midhandle.color = Color.white;
            yield return(MG_Manager.WaitForSeconds(0.3f));

            if (MG_Manager.Instance.Get_Save_WheelTotalTimes() % 2 == 0)
            {
                MG_Manager.ShowIV(OnIntersititialCallback, "wheel Interstitial video");
            }
            else
            {
                OnIntersititialCallback();
            }
        }
Ejemplo n.º 6
0
 void OnClaim()
 {
     MG_Manager.Play_ButtonClick();
     MG_Manager.ShowIV(GiveupReward, "Givp up " + RewardType + " Reward in " + RewardPanelType + " RewardPanel");
 }
Ejemplo n.º 7
0
 void OnGiveup()
 {
     MG_Manager.Play_ButtonClick();
     MG_Manager.ShowIV(Giveup, "Giveup Gift , reward is " + MG_Manager.Instance.RewardType);
 }
Ejemplo n.º 8
0
 void OnGiveupButtonClick()
 {
     MG_Manager.Play_ButtonClick();
     MG_Manager.ShowIV(OnGiveupPopAdCallback, "extra reward giveup , type : " + _rewardType);
 }
Ejemplo n.º 9
0
 void OnCloseButtonClick()
 {
     MG_Manager.Play_ButtonClick();
     MG_Manager.ShowIV(OnNormalGiveupButtonClick, "dice marquee giveup, type:" + _rewardType);
 }