public void ShowEffPlayerAddBet(short _chipIndex, sbyte _indexBet) { if (currentGameState != GameState.Bet) { return; } if (_chipIndex == -1) { Debug.LogError(">>> chipIndex = -1"); return; } Vector2 _posStart = iconGoldHolder.position; Vector2 _posEnd = listTableBet[_indexBet].transform.position; _posEnd.x = Random.Range(_posEnd.x - 0.2f, _posEnd.x + 0.2f); _posEnd.y = Random.Range(_posEnd.y - 0.2f, _posEnd.y + 0.2f); IChipInfo _chipInfo = panelListChip.listChipDetail[_chipIndex].chipInfo; ChipObjectController _tmpChip = LeanPool.Spawn(chipPrefab.gameObject, _posStart, Quaternion.identity).GetComponent <ChipObjectController>(); effectPoolManager.AddObject(_tmpChip); _tmpChip.SetData(_chipInfo, sortingLayerManager.sortingLayerInfo_ChipObject, ratioScale); _tmpChip.SetUpMoveToTableBet(_posEnd); _tmpChip.RegisCallbackJustMoveFinished(_indexBet, (_i) => { MyAudioManager.instance.PlaySfx(myAudioInfo.sfx_Bet); }); }
public void SetData(IChipInfo _chipInfo, MySortingLayerInfo _sortingLayerInfo, float _ratioScale) { mySortingGroup.sortingLayerName = _sortingLayerInfo.layerName.ToString(); mySortingGroup.sortingOrder = _sortingLayerInfo.layerOrderId; ratioScale = _ratioScale; transform.localScale = Vector3.one * ratioScale; chipType = _chipInfo.chipType; mySprite.sprite = _chipInfo.mySprite; }
public void AddChip(IChipInfo chipInfo) { switch (chipInfo.ChipType) { case DeviceType.Fresh: FreshCount++; break; case DeviceType.RT_ID: case DeviceType.RT_Cord: RetestCount++; break; } switch (chipInfo.Result) { case ResultType.Pass: PassCount++; break; case ResultType.Fail: FailCount++; break; case ResultType.Abort: AbortCount++; break; case ResultType.Null: NullCount++; break; } TotalCount++; if (_hardBins.ContainsKey(chipInfo.HardBin)) { _hardBins[chipInfo.HardBin]++; } else { _hardBins.Add(chipInfo.HardBin, 1); } if (_softBins.ContainsKey(chipInfo.SoftBin)) { _softBins[chipInfo.SoftBin]++; } else { _softBins.Add(chipInfo.SoftBin, 1); } }
public ChipDetail(IChipInfo _chipInfo, int _index) { chipInfo = _chipInfo; index = _index; }
public void SetUpPlayerAddBet(short _sessionid, short _chipIndex, sbyte _indexBet, long _GOLD) { if (!AnimalRacing_GamePlay_Manager.instance.CanShowPlayerAddBet()) { return; } if (_chipIndex == -1) { Debug.LogError(">>> chipIndex = -1"); return; } Vector3 _posStart = Vector3.zero; Vector3 _posEnd = panelTableBet.listBetOption[_indexBet].imgAvatar.transform.position; _posEnd.x = Random.Range(_posEnd.x - 0.2f, _posEnd.x + 0.2f); _posEnd.y = Random.Range(_posEnd.y - 0.2f, _posEnd.y + 0.2f); bool _isError = true; if (_sessionid == DataManager.instance.userData.sessionId) { _posStart = panelUserInGame.userAvata.transform.position; panelUserInGame.RefreshGoldInfo(); panelListChip.SetFocusChipAgain(); _isError = false; } else { for (int i = 0; i < listOtherPlayerInfo.Count; i++) { if (listOtherPlayerInfo[i].data != null) { if (listOtherPlayerInfo[i].data.sessionId == _sessionid) { _posStart = listOtherPlayerInfo[i].transform.position; listOtherPlayerInfo[i].RefreshGoldInfo(); _isError = false; break; } } } } if (!_isError) { IChipInfo _chipInfo = panelListChip.listChipDetail[_chipIndex].chipInfo; ChipObjectController _tmpChip = LeanPool.Spawn(chipPrefab.gameObject, _posStart, Quaternion.identity).GetComponent <ChipObjectController>(); effectPoolManager.AddObject(_tmpChip); _tmpChip.SetData(_chipInfo, AnimalRacing_GamePlay_Manager.instance.sortingLayerManager.sortingLayerInfo_ChipObject, 1f); _tmpChip.RegisCallbackJustMoveFinished(_indexBet, (_i) => { panelTableBet.listBetOption[_i].ShowGlow(); if (AnimalRacing_GamePlay_Manager.instance.CanPlayMusicAndSfx()) { MyAudioManager.instance.PlaySfx(AnimalRacing_GamePlay_Manager.instance.myAudioInfo.sfx_Bet); } }); _tmpChip.SetUpMoveToTableBet(_posEnd); } }