Version: 2020.3

SubsystemWithProvider

class in UnityEngine.SubsystemsImplementation


实现接口:ISubsystem

切换到手册

描述

A subsystem is initialized from a SubsystemDescriptorWithProvider for a given subsystem (Session, Plane, Face, etc.) and provides an interface to interact with that given subsystem until it is Destroyed. After a subsystem is created, it can be Started or Stopped to turn on and off functionality and preserve performance. The base type for the subsystem only exposes this functionality; this class is designed to be a base class for derived classes that expose more functionality specific to a given subsystem.

*Note:* Initializing a second subsystem from the same subsystem descriptor will return a reference to the existing subsystem, because only one subsystem is currently allowed for a single subsystem provider.

变量

running子系统是否在运行。This returns true after Start has been called on the subsystem, and false after Stop is called.

公共函数

Destroy销毁子系统的此实例。Also unloads all resources acquired during the initialization step. Call this when you no longer need this instance of a subsystem.Note: Once a subsystem is Destroyed, script can still hold a reference but calling a method on it will result in a NullArgumentException.
Start启动子系统的一个实例。实例启动后,表示此实例的子系统将处于活动状态并能够进行交互。
Stop停止子系统的一个实例。Once the instance is stopped, the subsystem representing this instance is no longer active and should not consume CPU resources.