コード例 #1
0
        public void Initialize(XffectComponent owner)
        {
            Owner = owner;
            switch (Type)
            {
            case XEventType.CameraShake:
                m_eventHandler = new CameraShakeEvent(this);
                break;

            case XEventType.Light:
                m_eventHandler = new LightEvent(this);
                break;

            case XEventType.Sound:
                m_eventHandler = new SoundEvent(this);
                break;

            case XEventType.CameraEffect:
                if (CameraEffectType == CameraEffectEvent.EType.ColorInverse)
                {
                    m_eventHandler = new ColorInverseEvent(this);
                }
                else if (CameraEffectType == CameraEffectEvent.EType.Glow)
                {
                    m_eventHandler = new GlowEvent(this);
                }
                else if (CameraEffectType == CameraEffectEvent.EType.GlowPerObj)
                {
                    m_eventHandler = new GlowPerObjEvent(this);
                }
                else if (CameraEffectType == CameraEffectEvent.EType.RadialBlur)
                {
                    m_eventHandler = new RadialBlurEvent(this);
                }
                else if (CameraEffectType == CameraEffectEvent.EType.RadialBlurMask)
                {
                    m_eventHandler = new RadialBlurTexAddEvent(this);
                }
                else if (CameraEffectType == CameraEffectEvent.EType.Glitch)
                {
                    m_eventHandler = new GlitchEvent(this);
                }
                break;

            case XEventType.TimeScale:
                m_eventHandler = new TimeScaleEvent(this);
                break;

            default:
                Debug.LogWarning("invalid event type!");
                break;
            }
            m_eventHandler.Initialize();
            m_elapsedTime = 0f;
            m_finished    = false;
        }
コード例 #2
0
 public void Initialize( XffectComponent owner)
 {
     Owner = owner;
     switch (Type)
     {
         case XEventType.CameraShake:
             m_eventHandler = new CameraShakeEvent(this);
             break;
         case XEventType.Light:
             m_eventHandler = new LightEvent(this);
             break;
         case XEventType.Sound:
             m_eventHandler = new SoundEvent(this);
             break;
         case XEventType.CameraEffect:
             if (CameraEffectType == CameraEffectEvent.EType.ColorInverse)
             {
                 m_eventHandler = new ColorInverseEvent(this);
             }
             else if (CameraEffectType == CameraEffectEvent.EType.Glow)
             {
                 m_eventHandler = new GlowEvent(this);
             }
             else if (CameraEffectType == CameraEffectEvent.EType.GlowPerObj)
             {
                 m_eventHandler = new GlowPerObjEvent(this);
             }
             else if (CameraEffectType == CameraEffectEvent.EType.RadialBlur)
             {
                 m_eventHandler = new RadialBlurEvent(this);
             }
             else if (CameraEffectType == CameraEffectEvent.EType.RadialBlurMask)
             {
                 m_eventHandler = new RadialBlurTexAddEvent(this);
             }
             else if (CameraEffectType == CameraEffectEvent.EType.Glitch)
             {
                 m_eventHandler = new GlitchEvent(this);
             }
             break;
         case XEventType.TimeScale:
             m_eventHandler = new TimeScaleEvent(this);
             break;
         default:
             Debug.LogWarning("invalid event type!");
             break;
     }
     m_eventHandler.Initialize();
     m_elapsedTime = 0f;
     m_finished = false;
 }