Ejemplo n.º 1
0
        void ForceTweenUpdate(float duration, EaseType easeType, bool scale)
        {
            var manager  = World.Active.EntityManager;
            var entities = manager.GetAllEntities(Allocator.TempJob);

            for (var i = 0; i < entities.Length; i++)
            {
                var entity = entities[i];
                if (manager.HasComponent(entity, scale ? typeof(TweenScale) : typeof(TweenMove)))
                {
                    var t = manager.GetComponentData <TweenBase>(entity);
                    manager.RemoveComponent(entity, TypeManager.GetType(t.EaseTypeId));
                    t.Duration   = duration;
                    t.EaseTypeId = Tween.AddEase(entity, easeType);
                    manager.SetComponentData(entity, t);
                }
            }
            entities.Dispose();
        }