private IEnumerator Fishing(bool isRainig, int hour, Bait bait, BonusBait bonusBait)
    {
        _beginEvent.Invoke();
        _fishing = true;
        _fishDatabase.GetPossibleFish(isRainig, hour, bait, bonusBait, _fishList);
        Debug.Assert(_fishList.Count != 0);
        yield return(0); //wait next frame

        _fish = RandomFish(bonusBait);
        float wait = _fish.GetWaitSecond();

        yield return(new WaitForSecondsRealtime(wait - (bonusBait != null?wait * bonusBait.BonusPercentWaitTime:0)));

        _hooking = true;
        _hookEvent.Invoke(_fish.Rarity);
        yield return(new WaitForSecondsRealtime(_fish.HookSecond));

        _failEvent.Invoke();
        _fish = null; _hooking = false; _fishing = false;
    }
Exemplo n.º 2
0
 static void HookCallback(ref MouseState state)
 {
     HookEvent?.Invoke(ref state);
 }