/// <inheritdoc /> public override void OnCourseFinished(ICourse course) { if (lockOnCourseFinished) { foreach (LockableProperty prop in SceneUtils.GetActiveAndInactiveComponents <LockableProperty>()) { prop.SetLocked(true); } } }
/// <inheritdoc /> public void RegisterAll() { foreach (TrainingSceneObject trainingObject in SceneUtils.GetActiveAndInactiveComponents <TrainingSceneObject>()) { try { Register(trainingObject); } catch (NameNotUniqueException) { logger.ErrorFormat("Registration of training scene object entity with name '{0}' failed. Name is not unique! Entity will destroy itself. Referenced game object: '{1}'.", trainingObject.UniqueName, trainingObject.GameObject.name); Object.DestroyImmediate(trainingObject.gameObject); } catch (AlreadyRegisteredException) { } } }
// Start is called before the first frame update void Start() { SceneUtils.GetActiveAndInactiveComponents <LockableProperty>().ToList() .ForEach(lockable => lockable.SetLocked(lockSceneObjectsOnSceneStart)); }