Exemple #1
0
    private static void DelayTimeToNitifyFatigue(long time)
    {
        if (modulePlayer.roleInfo == null || modulePlayer.id_ == 0 || moduleGlobal.system == null)
        {
            return;
        }

        Logger.LogDetail("SDKManager:: Send <b><color=#00FF00>[{0}]</color></b> local notification!", SwitchType.Fatigue);

        var fatigue = modulePlayer.roleInfo.fatigue;
        var max     = modulePlayer.maxFatigue;
        var index   = modulePlayer.roleInfo.index;

        if (index <= 0)
        {
            return;
        }

        var value = PlayerPrefs.GetInt(index + SwitchType.Fatigue.ToString());

        if (value > 0)
        {
            m_mobPush.removeLocalNotification(value);
        }

        if (!moduleSet.pushState.ContainsKey(SwitchType.Fatigue))
        {
            return;
        }

        var state = moduleSet.pushState[SwitchType.Fatigue];

        if (state == 0)
        {
            return;
        }

        if (fatigue >= max)
        {
            return;
        }

        var intervalTime = moduleGlobal.system.fatigue;
        var remainTime   = ((max - fatigue) * intervalTime) + time - intervalTime;

        if (remainTime > 0)
        {
            SetMobPushFatigue(index, remainTime);
        }
    }