private void RemoveItemReviseTimeScale(long receipt) { if (receiptItemReviseTimeScalePairs.ContainsKey(receipt)) { receiptItemReviseTimeScalePairs.Remove(receipt); SetAnimatorSpeed(timeScale); TimeScaleChangeEvent?.Invoke(timeScale); } }
private long AddItemReviseTimeScale(float reviseValue, ReviseType reviseMode, float duration) { long receipt = System.DateTime.Now.ToBinary(); float revise = reviseValue; switch (reviseMode) { case ReviseType.PercentBase: revise = baseTimeScale * reviseValue; break; case ReviseType.PercentCurrent: revise = timeScale * reviseValue; break; } receiptItemReviseTimeScalePairs.Add(receipt, revise); SetAnimatorSpeed(timeScale); TimeScaleChangeEvent?.Invoke(timeScale); if (duration > 0) { StartCoroutine(IEnumeratorHelper.After(RemoveItemReviseTimeScale, receipt, duration)); } return(receipt); }