• Manual
  • Scripting API
  • Changelog
  • License
Show / Hide Table of Contents
  • AlchemyBow.Core
    • CoreController<TProjectContext>
    • CoreProjectContext
    • ICoreLoadable
    • ICoreLoadingCallbacksHandler
    • LoadablesProgress
    • OperationHandle
  • AlchemyBow.Core.Editor.Utilities
    • CoreEditorUtility
    • IndentStringBuilder
  • AlchemyBow.Core.Editor.Windows
    • CoreManagementWindow
  • AlchemyBow.Core.Editor.Wizards
    • CoreControllerScriptWizard
    • CoreProjectContextPrefabWizard
    • CoreProjectContextScriptWizard
    • CoreQuickStartWizard
    • ValidationMessageList
    • WizardValidationUtility
    • WizardWindow
  • AlchemyBow.Core.Extras.Behaviours
    • CoreBehaviour
    • CoreBehaviourEnablingStrategy
  • AlchemyBow.Core.Extras.FluentBindings
    • ContainerFluentExtensions
    • FluentBinding
  • AlchemyBow.Core.Extras.Installers
    • ChildrenCompositeMonoInstaller
    • UnityObjectMonoInstaller
  • AlchemyBow.Core.IoC
    • Container
    • DynamicCollectionBindingUtility
    • DynamicInjector<T>
    • IBindOnlyContainer
    • InjectAttribute
    • InjectionTargetAttribute
    • MonoInstaller
  • AlchemyBow.Core.IoC.Elements
    • DynamicInjectorBase
    • InjectionInfo
    • ReflectionFieldsSetter
  • AlchemyBow.Core.States
    • ICondition
    • IState
    • StateGraph
    • StateGraphComposer
  • AlchemyBow.Core.States.Elements
    • StateGraphLink
  • AlchemyBow.Core.States.Prototyping
    • PrototypeCondition
    • PrototypeState

Class CoreController<TProjectContext>

The base class for all core controllers.

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
CoreController<TProjectContext>
Namespace: AlchemyBow.Core
Assembly: AlchemyBow.Core.dll
Syntax
public abstract class CoreController<TProjectContext> : MonoBehaviour where TProjectContext : CoreProjectContext
Type Parameters
Name Description
TProjectContext

The type of the project context visible for the controller.

Properties

Container

Returns the container used for dependency injection or null before the binding stage.

Declaration
protected Container Container { get; }
Property Value
Type Description
Container

The container used for dependency injection or null before the binding stage.

PostLoadingDelay

The additional delay between the loading and working stages (measured in seconds, real time).

Declaration
protected virtual float PostLoadingDelay { get; }
Property Value
Type Description
float

PreLoadingDelay

The additional delay between the binding and loading stages (measured in seconds, real time).

Declaration
protected virtual float PreLoadingDelay { get; }
Property Value
Type Description
float

Methods

ChangeScene(int)

Starts a scene change process.

Declaration
protected void ChangeScene(int buildIndex)
Parameters
Type Name Description
int buildIndex

The build index of the scene to load.

DestroyProjectContext()

Destroys the project context. A potential use of this method is to allow you to switch between different project contexts.

Declaration
protected void DestroyProjectContext()

GetLoadables()

Override this method to specify an ordered collection of loading members.

Declaration
protected abstract IEnumerable<ICoreLoadable> GetLoadables()
Returns
Type Description
IEnumerable<ICoreLoadable>

Returns an ordered collection of loading members or null.

InstallAdditionalBindings(IBindOnlyContainer)

Override this method to install additional bindings.

Declaration
protected virtual void InstallAdditionalBindings(IBindOnlyContainer container)
Parameters
Type Name Description
IBindOnlyContainer container

The dependency injection container.

OnBindingFinished()

This method is called after the dependencies are resolved (before the start of the loading stage).

Declaration
protected virtual void OnBindingFinished()

OnKeepUnloading(OperationHandle)

This method is called after OnSceneChangeStarted() and before the actual scene change process. You can use it to clean up external resources, such as additional scenes.

Declaration
protected virtual void OnKeepUnloading(OperationHandle operationHandle)
Parameters
Type Name Description
OperationHandle operationHandle

The handle of the operation. (The base verision of the method marks the operation handle done.)

OnLoadablesProgressed(LoadablesProgress)

Override this method to respond to the the loading process progress. For example, to update your loading screen.

Declaration
protected virtual void OnLoadablesProgressed(LoadablesProgress progress)
Parameters
Type Name Description
LoadablesProgress progress

The current progress.

Remarks

This method is called twice for each loadable during the loading process (not once if there are none). Project context loadables are included if they haven't been loaded previously.

OnLoadingFinished()

This method is called when binding and loading is completed (when the controller enters the working stage).

Declaration
protected virtual void OnLoadingFinished()
Remarks

By default, it invokes ICoreLoadingCallbacksHandler.OnCoreLoadingFinished().

OnSceneChangeStarted()

This method is called when the scene change process begins. By default, it invokes ICoreLoadingCallbacksHandler.OnCoreSceneChangeStarted().

Declaration
protected virtual void OnSceneChangeStarted()
Remarks

If you use the UnityEngine.UI package, you may need to add UnityEngine.EventSystems.EventSystem.current.enabled = false; here.

OnStarted(OperationHandle)

This method is called when the script instance is being loaded. It can be used to perform operations such as turning on a loading screen.

Declaration
protected virtual void OnStarted(OperationHandle operationHandle)
Parameters
Type Name Description
OperationHandle operationHandle

The handle of the operation. (The base verision of the method marks the operation handle done.)

Remarks

It's called before the binding stage, so dependencies are not injected yet.

In this article
Back to top Copyright © 2022-2024 AlchemyBow | Generated by DocFX