Exemplo n.º 1
0
    void Update()
    {
        m_state_counter += Time.deltaTime;

        switch (m_state)
        {
        case StateType.Prepare:
        {
            if (m_state_counter >= PrepareMultiEffectIndex * Effect.IndexInOwner)
            {
                Ready();
            }
        }
        break;

        case StateType.Ready:
            if (m_state_counter >= PrepareTime)
            {
                switch (ToTarget)
                {
                case ToTargetType.Once:
                    Effect.Active();
                    m_target_idx = Effect.CurtTargets.Count;
                    break;

                case ToTargetType.Sequent:
                    ActiveInternal(Effect.CurtTargets[m_target_idx++]);
                    break;

                case ToTargetType.OneFirst:
                    ActiveInternal(Effect.CurtTargets[m_target_idx++]);
                    break;
                }
            }
            break;

        case StateType.Active:
            m_target_counter += Time.deltaTime;
            if (m_target_counter >= NextTargetTime && m_target_idx < Effect.CurtTargets.Count)
            {
                m_target_counter = 0;
                switch (ToTarget)
                {
                case ToTargetType.Sequent:
                    ActiveInternal(Effect.CurtTargets[m_target_idx++]);
                    break;

                case ToTargetType.OneFirst:
                    for (int i = 1; i < Effect.CurtTargets.Count; ++i)
                    {
                        ActiveInternal(Effect.CurtTargets[m_target_idx++]);
                    }
                    break;
                }
            }

            if (m_state_counter >= LastTime && m_target_idx >= Effect.CurtTargets.Count)
            {
                Effect.Over();
            }
            break;
        }
    }
Exemplo n.º 2
0
 protected virtual void ActiveInternal(Creature target)
 {
     Effect.Active(target);
 }