コード例 #1
0
 private void RemoveItemReviseTimeScale(long receipt)
 {
     if (receiptItemReviseTimeScalePairs.ContainsKey(receipt))
     {
         receiptItemReviseTimeScalePairs.Remove(receipt);
         SetAnimatorSpeed(timeScale);
         TimeScaleChangeEvent?.Invoke(timeScale);
     }
 }
コード例 #2
0
    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);
    }