public CopyContext(GameObject objectToCopyFrom) { ObjectToCopyFrom = objectToCopyFrom; ComponentProvider = new ComponentProvider(); // EXAMPLE: If you want to disable copying an object's Transform component by default, uncomment the line below // ComponentProvider.AddFilteredComponentType<Transform>(); // This works for any type of component. RefreshComponents(); }
/// Refresh the components each time the ComponentProvider has changed. public void RefreshComponents() { Components = ComponentProvider.GetFilteredComponents(ObjectToCopyFrom); }