/// <summary> /// Adds a type of <paramref name="trainingProperty"/> into this <see cref="ISceneObject"/>. /// </summary> /// <param name="sceneObject"><see cref="ISceneObject"/> to whom the <paramref name="trainingProperty"/> will be added.</param> /// <param name="trainingProperty"><see cref="ISceneObjectProperty"/> to be added to <paramref name="sceneObject"/>.</param> /// <returns>A reference to the <see cref="ISceneObjectProperty"/> added to <paramref name="sceneObject"/>.</returns> public static ISceneObjectProperty AddTrainingProperty(this ISceneObject sceneObject, TrainingSceneObjectProperty trainingProperty) { Type trainingPropertyType = trainingProperty.GetType(); return(AddTrainingProperty(sceneObject, trainingPropertyType)); }
/// <summary> /// Removes type of <paramref name="trainingProperty"/> from this <see cref="ISceneObject"/>. /// </summary> /// <param name="sceneObject"><see cref="ISceneObject"/> from whom the <paramref name="trainingProperty"/> will be removed.</param> /// <param name="trainingProperty"><see cref="ISceneObjectProperty"/> to be removed from <paramref name="sceneObject"/>.</param> /// <param name="removeDependencies">If true, this method also removes other components that are marked as `RequiredComponent` by <paramref name="trainingProperty"/>.</param> /// <param name="excludedFromBeingRemoved">The training properties in this list will not be removed if any is a dependency of <paramref name="trainingProperty"/>. Only relevant if <paramref name="removeDependencies"/> is true.</param> public static void RemoveTrainingProperty(this ISceneObject sceneObject, TrainingSceneObjectProperty trainingProperty, bool removeDependencies = false, IEnumerable <Component> excludedFromBeingRemoved = null) { Type trainingPropertyType = trainingProperty.GetType(); RemoveTrainingProperty(sceneObject, trainingPropertyType, removeDependencies, excludedFromBeingRemoved); }