Пример #1
0
    /************************************************************************
    *	                Coroutine Declaration	                            *
    ************************************************************************/
    protected override IEnumerator CoroutineStart()
    {
        if (this._tween != null)
        {
            this._tween.Stop();
            this._tween = null;
        }
        this.sprite.color         = this._color;
        this.camera3D.fieldOfView = this._defaultFieldOfView;
        yield return(new WaitForSeconds(0.5f));

        TweenUIData data = this.uiContainer.Data;

        if (this.container2D.activeSelf)
        {
            XObjectHash hash = XObjectHash.New.Add("r", 1f, 0.56f).Add("g", 1f, 0.83f);
            this._tween = XTween.To(hash, UpdateColor, data.time, data.Easing);
            this._tween.Play();
        }
        else
        {
            XObjectHash hash = XObjectHash.New.Add("fieldOfView", 6f);
            this._tween = XTween.To <Camera>(this.camera3D, hash, data.time, data.Easing);
            this._tween.Play();
        }
    }
Пример #2
0
    void UpdateColor(XObjectHash hash)
    {
        Color color = sprite.color;

        color.r      = hash.Now("r");
        color.g      = hash.Now("g");
        sprite.color = color;
    }
Пример #3
0
        public static IUpdating Create <T>(T target, XObjectHash source)
        {
            ObjectUpdater <T> updator = new ObjectUpdater <T>();

            updator.Target = target;
            updator.Finish = source;
            return(updator);
        }
Пример #4
0
        public static ObjectUpdater <T> Create <T>(T target, XObjectHash source)
        {
            ObjectUpdater <T> updator = Pool <ObjectUpdater <T> > .Pop();

            updator.Target = target;
            updator.Finish = source;
            return(updator);
        }
Пример #5
0
 public override void Dispose()
 {
     base.Dispose();
     this._valueDic.Clear();
     this._keys          = null;
     this._keyLength     = 0;
     this._source        = null;
     this._updateHandler = null;
 }
Пример #6
0
    //Proerpty Type Only
    public static IAni To <T>(T target, XObjectHash hash, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
    {
        ObjectTween       tween   = new ObjectTween(realTime ? (ITimer)_tickerReal : _ticker);
        ObjectUpdater <T> updater = (ObjectUpdater <T>)UpdaterFactory.Create <T>(target, hash);

        tween.FrameSkip       = frameSkip;
        tween.updater         = updater;
        tween.ClassicHandlers = hash;
        tween.time            = time;
        tween.easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #7
0
    /*===================================== Value ========================================*/
    public static IAni To(XObjectHash source, Action <XObjectHash> UpdateHandler, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
    {
        ObjectTween   tween   = new ObjectTween(realTime ? (ITimer)_tickerReal : _ticker);
        ObjectUpdater updater = (ObjectUpdater)_updaterFactory.Create(source);

        updater.UpdateHandler = UpdateHandler;
        tween.FrameSkip       = frameSkip;
        tween.updater         = updater;
        tween.ClassicHandlers = source;
        tween.time            = time;
        tween.easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #8
0
    //Proerpty - Multi, Bezier
    public static IXTween ToPropertyMulti <T>(T target, XObjectHash hash, float time, IEasing easing = null, bool realTime = false)
    {
        ObjectTween tween = Pool <ObjectTween> .Pop();

        ObjectUpdater <T> updater = UpdaterFactory.Create <T>(target, hash);

        tween.Initialize(realTime ? (ITimer)_tickerReal : _ticker, 0);
        tween.Updater         = updater;
        tween.ClassicHandlers = hash;
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #9
0
    private void UpdateColor(XObjectHash hash)
    {
        if (sprite == null)
        {
            this._tween.Stop();
            return;
        }
        Color color = sprite.color;

        color.r      = hash.Now("r");
        color.g      = hash.Now("g");
        sprite.color = color;
    }
Пример #10
0
    //Value - Multi, Bezier
    public static IXTween ToValueMulti(XObjectHash source, Action <XObjectHash> UpdateHandler, float time, IEasing easing = null, bool realTime = false)
    {
        ObjectTween tween = Pool <ObjectTween> .Pop();

        tween.Initialize(realTime ? (ITimer)_tickerReal : _ticker, 0);
        ObjectUpdater updater = UpdaterFactory.Create(source);

        updater.UpdateHandler = UpdateHandler;
        tween.Updater         = updater;
        tween.ClassicHandlers = source;
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #11
0
 //Proerpty Type Only
 public static IAni To <T>(T target, XObjectHash hash, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
 {
     return(XTween.To <T>(target, hash, time, easing, frameSkip, realTime));
 }
Пример #12
0
 public static IAni To(XObjectHash source, Action <XObjectHash> UpdateHandler, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
 {
     return(XTween.To(source, UpdateHandler, time, easing, frameSkip, realTime));
 }
Пример #13
0
 //Property - Multi property
 public static IXTween ToPropertyMulti <T>(this T target, XObjectHash hash, float time, IEasing easing = null, bool realTime = false)
 {
     return(XTween.ToPropertyMulti <T>(target, hash, time, easing, realTime));
 }
Пример #14
0
 //Value - Multi value
 public static IXTween ToValueMulti(this object obj, XObjectHash source, Action <XObjectHash> UpdateHandler, float time, IEasing easing = null, bool realTime = false)
 {
     return(XTween.ToValueMulti(source, UpdateHandler, time, easing, realTime));
 }