/// <inheritdoc/> public Task Initialize() { if (IsInitialized) { return(Task.CompletedTask); } AvailableBehaviourTypes = ReflectionCache.FindTypes(type => type.IsSubclassOf(typeof(NPCBehaviourBase)) && !type.IsAbstract); IsInitialized = true; Debug.Log($"{GetType().Name} scenario editor extension has been initialized."); return(Task.CompletedTask); }
static TriggersManager() { var effectorTypes = ReflectionCache.FindTypes(type => type.IsSubclassOf(typeof(TriggerEffector))); foreach (var effectorType in effectorTypes) { if (Activator.CreateInstance(effectorType) is TriggerEffector effector) { EffectorNameToType.Add(effector.TypeName, effectorType); } } }
/// <inheritdoc/> public override void Initialize() { var controllerTypes = ReflectionCache.FindTypes(type => type.IsSubclassOf(typeof(PlaybackController))); foreach (var controllerType in controllerTypes) { if (Activator.CreateInstance(controllerType) is PlaybackController controller) { controllers.Add(controller); controller.Initialize(); } } timeSlider.SetValueWithoutNotify(0.0f); }