コード例 #1
0
 private void RemoveItemReviseMaxSP(long receipt)
 {
     if (receiptItemReviseMaxSPPairs.ContainsKey(receipt))
     {
         receiptItemReviseMaxSPPairs.Remove(receipt);
         MaxSPChangeEvent?.Invoke(maxSP);
     }
 }
コード例 #2
0
    private long AddItemReviseMaxSP(float reviseValue, ReviseType reviseMode, float duration)
    {
        long  receipt = System.DateTime.Now.ToBinary();
        float revise  = reviseValue;

        switch (reviseMode)
        {
        case ReviseType.PercentBase:
            revise = baseMaxSP * reviseValue;
            break;

        case ReviseType.PercentCurrent:
            revise = maxSP * reviseValue;
            break;
        }
        receiptItemReviseMaxSPPairs.Add(receipt, revise);
        MaxSPChangeEvent?.Invoke(maxSP);
        if (duration > 0)
        {
            StartCoroutine(IEnumeratorHelper.After(RemoveItemReviseMaxSP, receipt, duration));
        }
        return(receipt);
    }