Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.02 KB

SubstanceEngineManager.md

File metadata and controls

59 lines (46 loc) · 2.02 KB

SubstanceEngineManager

Wraps the Substance plugin's Engine class and streamlines interactions with it. This class can conveniently initialize the engine on Start() if desired, and fires events for engine initialization and shutdown stages.

SubstanceEngineManager inspector

Example Script

using UnityEngine;
using Adobe.Substance;
using SOS.SubstanceExtensions;

public class SubstanceParameterExample : MonoBehaviour
{
	private void OnEngineInitialized()
	{
		Debug.Log("Engine Initialized!");
	}


	private void OnEnginePreShutdown()
	{
		Debug.Log("Engine PRE Shutdown!");
	}


	private void OnEnginePostShutdown()
	{
		Debug.Log("Engine POST Shutdown!");
	}


	private void Start()
	{
		SubstanceEngineManager.Instance.onEngineInitialized.AddListener(OnEngineInitialized);
		SubstanceEngineManager.Instance.onEnginePreShutdown.AddListener(OnEnginePreShutdown);
		SubstanceEngineManager.Instance.onEnginePostShutdown.AddListener(OnEnginePostShutdown);
	}
}

Properties

Property Type Description
IsInitialized bool Returns true if the runtime substance engine has been initialized.
RuntimeEngineType EngineType How the engine is managed.
RuntimeEngineInstance SubstanceRuntime Returns true if the runtime substance engine has been initialized.
onEngineInitialized UnityEvent Fired after the runtime engine is initialized.
onEnginePreShutdown UnityEvent Fired BEFORE the runtime engine is shutdown.
onEnginePostShutdown UnityEvent Fired AFTER the runtime engine is shutdown.

Methods

Method Returns Description
InitializeEngine() void Initialize the substance engine. Note: This will do nothing if the engine is already initialized.
ShutdownEngine() void Shutdown the substance engine. Note: This will do nothing if the engine is not currently initialized.