Пример #1
0
    /*===================================== Transform ========================================*/
    public static IAni To(GameObject target, XHash hash, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
    {
        ObjectTween tween = new ObjectTween(realTime ? (ITimer)_tickerReal : _ticker);

        tween.FrameSkip       = frameSkip;
        tween.updater         = _updaterFactory.Create(target, hash, hash.GetStart());
        tween.ClassicHandlers = hash;
        tween.time            = time;
        tween.easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #2
0
    /*===================================== Transform ========================================*/
    //Transform
    public static IXTween To(GameObject target, XHash hash, float time, IEasing easing = null, bool realTime = false)
    {
        ObjectTween tween = Pool <ObjectTween> .Pop();

        tween.Initialize(realTime ? (ITimer)_tickerReal : _ticker, 0);
        tween.Updater         = UpdaterFactory.Create(target, hash, hash.GetStart());
        tween.ClassicHandlers = hash;
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #3
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);
    }
Пример #4
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);
    }
Пример #5
0
    //Color Property
    public static IAni To <T>(T target, string colorPropertyName, XColorHash hash, float time = 1.0f, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
    {
        ITimer           tick     = _ticker;
        ITimer           tickReal = _tickerReal;
        ObjectTween      tween    = new ObjectTween(realTime ? tickReal : tick);
        ColorUpdater <T> updater  = (ColorUpdater <T>)UpdaterFactory.Create <T>(target, colorPropertyName, hash, hash.GetStart());

        tween.FrameSkip       = frameSkip;
        tween.updater         = updater;
        tween.ClassicHandlers = hash;
        tween.time            = time;
        tween.easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #6
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);
    }
Пример #7
0
    //Color Property
    public static IXTween ToColor <T>(T target, string colorPropertyName, XColorHash hash, float time, IEasing easing = null, bool realTime = false)
    {
        ITimer      tick     = _ticker;
        ITimer      tickReal = _tickerReal;
        ObjectTween tween    = Pool <ObjectTween> .Pop();

        ColorUpdater <T> updater = UpdaterFactory.Create <T>(target, colorPropertyName, hash, hash.GetStart());

        tween.Initialize(realTime ? tickReal : tick, 0);
        tween.Updater         = updater;
        tween.ClassicHandlers = hash;
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #8
0
    //Value - Single Bezier
    public static IXTween ToValueBezier(Action <float> setter, float start, float end, float[] controlPoints, float time, IEasing easing = null, bool realTime = false)
    {
        XEventHash hash = Pool <XEventHash> .Pop();

        ObjectTween tween = Pool <ObjectTween> .Pop();

        tween.Initialize(realTime ? (ITimer)_tickerReal : _ticker, 0);
        GetSetUpdater updater = UpdaterFactory.Create(setter, start, end, controlPoints, hash);

        tween.Updater         = updater;
        tween.ClassicHandlers = hash;
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        return(tween);
    }
Пример #9
0
        static void Main()
        {
            IUpdater updater = UpdaterFactory.Create("http://appupdater.com:84", "releases.txt");

            Console.WriteLine(@"Version is " + updater.CurrentRelease);

            ICheckForUpdateResult checkForUpdateResult = updater.CheckForUpdate();

            if (checkForUpdateResult.IsUpdateAvailable)
            {
                updater.Update();
            }

            Console.Read();
        }