Beispiel #1
0
    IEnumerator ShowCurrentRewards_Coroutine(PPIDailyRewards rewards, bool instant, bool conditional)
    {
        int      currDay = rewards.CurrentDay;
        DateTime date    = CloudDateTime.UtcNow.Date - TimeSpan.FromDays(currDay);

        DayInfo[] infos = new DayInfo[PPIDailyRewards.DAYS_PER_CYCLE];
        for (int idx = 0; idx < PPIDailyRewards.DAYS_PER_CYCLE; ++idx)
        {
            E_Status status = E_Status.Idle;
            if (idx < currDay)
            {
                status = E_Status.Gained;
            }
            else if (idx == currDay)
            {
                status = E_Status.Current;
            }

            infos[idx] = new DayInfo()
            {
                Date        = date + TimeSpan.FromDays(idx),
                Status      = status,
                Scale       = Vector2.one,
                Instant     = rewards.Instant[idx].DeepCopy(),
                Conditional = rewards.Conditional[idx].DeepCopy()
            };
            infos[idx].Instant.Received = idx <= currDay ? true : false;
        }

        UpdateDays(infos);

        yield return(new WaitForSeconds(0.5f));

        if (MFGuiManager.Instance != null)
        {
            MFGuiManager.Instance.PlayOneShot(m_GainedAudio);
        }

        // highlight current reward
        if (instant == true || conditional == true)
        {
            bool blinkInstant     = instant;
            bool blinkConditional = conditional;

            for (int idx = 0; idx < 6; ++idx)
            {
                yield return(new WaitForSeconds(0.15f));

                m_Days[currDay].SetHighlight(blinkInstant, blinkConditional);

                blinkInstant     = instant ? !blinkInstant : false;
                blinkConditional = conditional ? !blinkConditional : false;
            }

            m_Days[currDay].SetHighlight(instant, conditional);
        }
    }
 public void Remove(E_Status status, E_Unit target)
 {
 }
 public void Attach(E_Status status, E_Unit target, E_Unit caster)
 {
 }
 public void TickPerSecond(E_Status status, E_Unit target)
 {
 }
 public void TickPerSecond(E_Status status, E_Unit target)
 {
     target.m_curMp += (int)status.m_value;
 }