private static void OnComponentAdded(ComponentEventArgs args) { if (args.Component.Active) { ICmpInitializable cInit = args.Component as ICmpInitializable; if (cInit != null) { cInit.OnActivate(); } } if (ComponentAdded != null) { ComponentAdded(current, args); } }
private void objectManager_ComponentAdded(object sender, ComponentEventArgs e) { this.AddToManagers(e.Component); // If the scene is active, activate any added components if (this.active && e.Component.Active) { ICmpInitializable cInit = e.Component as ICmpInitializable; if (cInit != null) { cInit.OnActivate(); } } // Fire global event for current main scene if (this.IsCurrent && ComponentAdded != null) { ComponentAdded(current, e); } }