示例#1
0
    // IEnumerator DoActionShowEffWinGold(Vector2 _startPoint, Vector2 _endPoint, int _numGold){
    //  Vector2 _newStartPoint = Vector2.zero;
    //  for(int i = 0; i < _numGold; i++){
    //      _newStartPoint.x = Random.Range(_startPoint.x - 0.2f, _startPoint.x + 0.2f);
    //      _newStartPoint.y = Random.Range(_startPoint.y - 0.2f, _startPoint.y + 0.2f);
    //      GoldObjectController _gold = LeanPool.Spawn(goldPrefab, _newStartPoint, Quaternion.identity).GetComponent<GoldObjectController>();
    //      effectPoolManager.AddObject(_gold);
    //      _gold.InitData(sortingLayerInfo_GoldObject, 1);
    //      StartCoroutine(_gold.DoActionMoveAndSelfDestruction(_endPoint, 0.5f, LeanTweenType.easeInBack, GameInformation.instance.globalAudioInfo.sfx_Gold));
    //      if(_numGold > 1){
    //          yield return Yielders.Get(0.06f);
    //      }
    //  }
    // }

    // IEnumerator DoActionShowPopupWinGold(float _timeDelay, long _goldAdd){
    //  yield return Yielders.Get(_timeDelay);
    //  PanelBonusGoldInGameController _tmpPanelGoldBonus = LeanPool.Spawn(panelBonusGoldPrefab.gameObject, showEffPanelGoldBonusEffPlaceHolder.position, Quaternion.identity, transform).GetComponent<PanelBonusGoldInGameController>();
    //  effectPoolManager.AddObject(_tmpPanelGoldBonus);
    //  _tmpPanelGoldBonus.transform.position = showEffPanelGoldBonusEffPlaceHolder.position;
    //  _tmpPanelGoldBonus.Show(_goldAdd);
    //  RefreshMyGoldInfo();
    // }

    #region On Button Clicked
    public void OnButtonSpinClicked()
    {
        if (mIsPlaying)
        {
            return;
        }
        if (tweenWheelForever != null)
        {
            return;
        }

        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        if (DataManager.instance.userData.gold < currentBet)
        {
            PopupManager.Instance.CreateToast(MyLocalize.GetString("Global/NotEnoughMoney"));
            return;
        }

        callbackGetBetWin = CallbackGetBetWin;
        tweenWheelForever = LeanTween.rotateAround(wheel.gameObject, Vector3.forward, 360f, 0.5f).setEase(LeanTweenType.easeInSine).setOnComplete(() => {
            tweenWheelForever = LeanTween.rotateAround(wheel.gameObject, Vector3.forward, 360f, 0.3f).setLoopCount(-1);
        });

        DataManager.instance.userData.gold -= currentBet;
        RefreshMyGoldInfo();

        // BetToWinTool _tmp = new BetToWinTool(currentBet,listBetWinValue.ToArray());
        // _tmp.ProcessWeight();
        // _tmp.Trace();

        OneHitAPI.BetToWin(currentBet, GameInformation.instance.luckyWheelInfo.listDetail, listBetWinValue
                           , (_mess, _error) => {
            if (tweenWheelForever != null)
            {
                LeanTween.cancel(tweenWheelForever.uniqueId);
                tweenWheelForever = null;
            }
            if (callbackGetBetWin != null)
            {
                callbackGetBetWin(_mess, _error);
            }
        });
    }
示例#2
0
    public void OnBtnSpinClicked()
    {
        if (actionSpin != null)
        {
            return;
        }

        ResetResultIndexCards();

        callbackGetBetWin = CallbackGetBetWin;

        // CHEAT();
        StartSpin();
        // StartCoroutine(SpinCheat());

        OneHitAPI.BetToWin(currentBet, GameInformation.instance.slotPokerInfo.listDetail, listBetWinValue
                           , (_mess, _error) => {
            if (callbackGetBetWin != null)
            {
                callbackGetBetWin(_mess, _error);
            }
        });
    }