public void raiseLotteryChangeEvent(HookPos hookPos, int nLottery, LotteryChange change = null) { if (lotteryChangeEvent != null) { lotteryChangeEvent(hookPos, nLottery, change); } }
private void _openChestCallBack() { if (_chest.ObjType == 26) { if (player != null) { LotteryChange change = new LotteryChange(); change.stratPos = _chest.GetChestOpenPositon(); change.nDelta = _nChestLottery; _level.raiseLotteryChangeEvent(hookPos, player.Lottery, change); } Utils.PlaySound(AudioNames.GotReward); _chest.ChestDisappear(() => { _bChest = false; ResFishInfo info = InfoManager.Instance.GetFishInfo(_chest.ObjType); _level.fishPoolMgr.Recycle(info.name, _chest); }); } else if (_chest.ObjType == 27) { Action callBack = _wheelCallBack; UIManager.Instance.ShowWindow <WheelWindow>("WheelWindow", ArgList.Create(_vec3ChestPos, _nChestLottery, 0, 0, callBack), false); } }
public void _wheelCallBack() { if (player != null) { LotteryChange change = new LotteryChange(); change.stratPos = Vector3.back; change.nDelta = _nChestLottery; _level.raiseLotteryChangeEvent(hookPos, player.Lottery, change); } Utils.PlaySound(AudioNames.GotReward); _bChest = false; ResFishInfo info = InfoManager.Instance.GetFishInfo(_chest.ObjType); _level.fishPoolMgr.Recycle(info.name, _chest); }
public void MoveBack() { if (_toEscapeFishes.Count > 0 && _fBackI > _toEscapeFishes[0].EscapeTime) { HookFsm.ChangeState <Struggle>(); } else if (_fBackI < 1) { _fBackI += _fBackf * Time.deltaTime; _transHook.localPosition = Vector3.Lerp(_vec3StartBackLocalPos, _vec3OriginalHookLocalPos, _fBackI); } else { SceneMgr.Instance.water.Splash(_transHook.position.x, 0.65f); if (player != null && player.LastDeltaLottery != 0) { LotteryChange change = new LotteryChange(); change.stratPos = new Vector3(_transHook.position.x, _transHook.position.y, _transHook.position.z); change.nDelta = player.LastDeltaLottery; if (change.nDelta != 0) { _level.raiseLotteryChangeEvent(hookPos, player.Lottery - _nChestLottery, change); } else { _level.raiseLotteryChangeEvent(hookPos, player.Lottery - _nChestLottery); } player.LastDeltaLottery = 0; } //Play Sound if (_hookedFishes.Count > 0) { Utils.PlaySound(AudioNames.GotFish); } HookFsm.ChangeState <Idle>(); } }
public override void ClearLastHookThenIdle() { base.ClearLastHookThenIdle(); foreach (var item in _hookedFishes) { if (item.Value.ObjType == 27) { _level.raiseDrawingLotteryEvent(hookPos, postion => { if (player != null) { LotteryChange change = new LotteryChange(); change.stratPos = postion; change.nDelta = _nChestLottery; _level.raiseLotteryChangeEvent(hookPos, player.Lottery, change); } Utils.PlaySound(AudioNames.GotReward); }); } ResFishInfo info = InfoManager.Instance.GetFishInfo(item.Value.ObjType); _level.fishPoolMgr.Recycle(info.name, item.Value); } _hookedFishes.Clear(); }