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); }
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); }
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); }