Exemplo n.º 1
0
        public static void RunAllBindings(UTinyEntity entity)
        {
            if (!ComponentBinding.ValidateBindingsParams(entity))
            {
                return;
            }

            foreach (var component in entity.Components)
            {
                RunBindings(entity, component);
            }
        }
Exemplo n.º 2
0
        public static void RunBindings(UTinyEntity entity, UTinyObject component)
        {
            if (!ComponentBinding.ValidateBindingsParams(entity, component))
            {
                return;
            }

            var type = component.Type.Dereference(entity.Registry);

            if (!type.HasAttribute <BindingsAttribute>())
            {
                return;
            }

            var bindings = type.GetAttribute <BindingsAttribute>().Binding;

            bindings.Run(BindingTiming.OnAddBindings, entity, component);
            bindings.Run(BindingTiming.OnUpdateBindings, entity, component);
        }