Пример #1
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    void Awake()
    {
        exUIControl ctrl = GetComponent <exUIControl>();

        if (ctrl)
        {
            if (scaleInfos != null)
            {
                for (int j = 0; j < scaleInfos.Count; ++j)
                {
                    EffectInfo_Scale info = scaleInfos[j];

                    EffectState_Scale state = new EffectState_Scale();
                    state.info = info;
                    state.func = info.GetCurveFunction();
                    AddState_Scale(ctrl, state);
                }
            }

            if (offsetInfos != null)
            {
                for (int j = 0; j < offsetInfos.Count; ++j)
                {
                    EffectInfo_Offset info = offsetInfos[j];

                    EffectState_Offset state = new EffectState_Offset();
                    state.info = info;
                    state.func = info.GetCurveFunction();
                    AddState_Offset(ctrl, state);
                }
            }

            if (colorInfos != null)
            {
                for (int j = 0; j < colorInfos.Count; ++j)
                {
                    EffectInfo_Color info = colorInfos[j];

                    EffectState_Color state = new EffectState_Color();
                    state.info = info;
                    state.func = info.GetCurveFunction();
                    AddState_Color(ctrl, state);
                }
            }
        }
    }
Пример #2
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    public void AddEffect_Color(exSpriteBase _target, EffectEventType _type, exEase.Type _curveType, Color _to, float _duration)
    {
        exUIControl ctrl = GetComponent <exUIControl>();

        if (ctrl)
        {
            EffectInfo_Color info = new EffectInfo_Color();
            info.duration  = _duration;
            info.target    = _target;
            info.normal    = _target.color;
            info.curveType = _curveType;

            EffectInfo_Color.PropInfo propInfo = new EffectInfo_Color.PropInfo();
            propInfo.type = _type;
            propInfo.val  = _to;
            info.propInfos.Add(propInfo);

            EffectState_Color state = new EffectState_Color();
            state.info = info;
            state.func = info.GetCurveFunction();
            AddState_Color(ctrl, state);
        }
    }
Пример #3
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------
    public void AddEffect_Color( exSpriteBase _target, EffectEventType _type, exEase.Type _curveType, Color _to, float _duration )
    {
        exUIControl ctrl = GetComponent<exUIControl>();
        if ( ctrl ) {
            EffectInfo_Color info = new EffectInfo_Color();
            info.duration = _duration;
            info.target = _target;
            info.normal = _target.color;
            info.curveType = _curveType;

            EffectInfo_Color.PropInfo propInfo = new EffectInfo_Color.PropInfo();
            propInfo.type = _type;
            propInfo.val = _to;
            info.propInfos.Add(propInfo);

            EffectState_Color state = new EffectState_Color();
            state.info = info;
            state.func = info.GetCurveFunction();
            AddState_Color( ctrl, state );
        }
    }