Пример #1
0
        public static T Create <T, A>(A a) where T : Component
        {
            T component = Game.ObjectPool.Fetch <T>();
            ComponentWithId componentWithId = component as ComponentWithId;

            if (componentWithId != null)
            {
                componentWithId.Id = component.InstanceId;
            }
            Game.EventSystem.Awake(component, a);
            return(component);
        }
Пример #2
0
        public static T CreateWithParent <T, A, B, C>(Component parent, A a, B b, C c) where T : Component
        {
            T component = Game.ObjectPool.Fetch <T>();

            component.Parent = parent;
            ComponentWithId componentWithId = component as ComponentWithId;

            if (componentWithId != null)
            {
                componentWithId.Id = component.InstanceId;
            }
            Game.EventSystem.Awake(component, a, b, c);
            return(component);
        }
Пример #3
0
        public static Component CreateWithParent(Type type, Component parent)
        {
            Component component = Game.ObjectPool.Fetch(type);

            component.Parent = parent;
            ComponentWithId componentWithId = component as ComponentWithId;

            if (componentWithId != null)
            {
                componentWithId.Id = component.InstanceId;
            }
            Game.EventSystem.Awake(component);
            return(component);
        }