示例#1
0
        public static void UpdateSettingsConfig(string targetAssembly)
        {
            var updater = UpdaterFactory.GetUpdater(targetAssembly);

            updater.UpdateAppConfigFile();
            updater.UpdateTestSuiteConfigFile();
        }
示例#2
0
        /// <summary>
        /// Создает всплывающий текст в мировом пространстве
        /// </summary>
        /// <param name="finalPosition">Конечная позиция текста</param>
        /// <param name="popupTime">Время за которое текст переместится в конечную позицию</param>
        public static void CreateWorldTextPopup(string text, Transform parent, Vector3 localPosition, int fontSize,
                                                Color color, Vector3 finalPosition, float popupTime)
        {
            if (popupTime <= 0f)
            {
                popupTime = 1f;
            }

            // Inversed time
            var speed = 1 / popupTime;

            var textMesh      = CreateWorldText(text, parent, localPosition, fontSize, color);
            var textTransform = textMesh.transform;

            UpdaterFactory.CreateFunction((deltaTime) =>
            {
                textTransform.position = Vector3.MoveTowards(textTransform.position, finalPosition, speed * deltaTime);

                popupTime -= deltaTime;
                if (popupTime <= 0f)
                {
                    Object.Destroy(textTransform.gameObject);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }, "popupText");
        }
示例#3
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);
    }
示例#4
0
文件: XTween.cs 项目: bmjoy/XTween
    //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);
    }
示例#5
0
    /*===================================== Continue ========================================*/
    public static ContinousTween Continous(GameObject target, XHash hash, float time, IEasing easing = null, uint frameSkip = 0, bool realTime = false)
    {
        ITimer         tick     = _ticker;
        ITimer         tickReal = _tickerReal;
        ContinousTween tween    = Pool <ContinousTween> .Pop();

        tween.Initialize(realTime ? tickReal : tick, 0);
        tween.Time            = time;
        tween.Easing          = (easing != null) ? easing : Linear.easeNone;
        tween.Updater         = UpdaterFactory.CreateContinous(target, hash, hash.GetStart());
        tween.ClassicHandlers = hash;
        return(tween);
    }
示例#6
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);
    }
示例#7
0
文件: XTween.cs 项目: bmjoy/XTween
    //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);
    }
示例#8
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);
    }
示例#9
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);
    }
示例#10
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);
    }
示例#11
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();
        }
示例#12
0
        public ConnectionistFactory(ILinearAlgebraProvider lap, bool stochastic = true)
        {
            _lap           = lap;
            _stochastic    = stochastic;
            _trainer       = new TrainerFactory(lap);
            _weightUpdater = new UpdaterFactory(lap);

            _activation.Add(ActivationType.Relu, new Relu());
            _activation.Add(ActivationType.LeakyRelu, new LeakyRelu());
            _activation.Add(ActivationType.Sigmoid, new Sigmoid());
            _activation.Add(ActivationType.Tanh, new Tanh());
            //_activation.Add(ActivationType.Softmax, new Softmax());
            _activation.Add(ActivationType.None, null);

            _weightInitialisation.Add(WeightInitialisationType.Gaussian, new Gaussian(stochastic));
            _weightInitialisation.Add(WeightInitialisationType.Xavier, new Xavier(stochastic));
            _weightInitialisation.Add(WeightInitialisationType.Identity, new Identity());
            _weightInitialisation.Add(WeightInitialisationType.Identity1, new Identity(0.1f));
            _weightInitialisation.Add(WeightInitialisationType.Identity01, new Identity(0.01f));
            _weightInitialisation.Add(WeightInitialisationType.Identity001, new Identity(0.001f));
        }
示例#13
0
文件: XTween.cs 项目: bmjoy/XTween
    static XTween()
    {
#if UNITY_EDITOR
        if (Application.isPlaying)
        {
            _ticker     = UpdateTicker.To;
            _tickerReal = UpdateTickerReal.To;
        }
        else
        {
            _ticker     = new UpdateTicker();
            _tickerReal = new UpdateTickerReal();
        }
#else
        _ticker     = UpdateTicker.To;
        _tickerReal = UpdateTickerReal.To;
#endif
        _ticker.Initialize();
        _tickerReal.Initialize();

        _updaterFactory = new UpdaterFactory();
    }