public async Task <GComponent> CreateComponent(IComponentContainer componentContainer) { GActor hostActor = null; IComponentContainer hostContainer = null; if (componentContainer is GActor) { hostActor = componentContainer as GActor; hostContainer = componentContainer; } else if (componentContainer is GComponent) { hostActor = (componentContainer as GComponent).Host; hostContainer = componentContainer; } var rc = CEngine.Instance.RenderContext; var comp = new GBehaviorTreeComponent(); var init = new GBehaviorTreeComponentInitializer(); await comp.SetInitializer(rc, hostActor, hostContainer, init); comp.SpecialName = ResourceName.PureName(); comp.ComponentMacross = ResourceName; return(comp); }
public GBehaviorTreeComponent() { Initializer = new GBehaviorTreeComponentInitializer(); }