AtmospherePlugin
An abstract class in Root.Township, Alta.Environmental.Atmosphere.
Base for an atmosphere source (such as a zone or weather) that supplies ambient light, fog and ambience audio. The AtmosphereManager initializes plugins and probably uses the enabled one with the highest Priority.
- Listed in World, chunks and saving
- Inherits or implements
MonoBehaviour - Derived types
DeadPlugin,IndoorAmbienceBoost,CaveAmbience,DayTimeManager,ForestAmbience,InteriorFogAmbience
Constructors
| Member | What it is |
|---|---|
protected AtmospherePlugin() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
protected Color currentFogColor | Fog colour field for subclasses. |
protected float currentFogDensity | Fog density field for subclasses. |
protected AmbienceAudio mainSource | The ambience audio source. |
protected AtmosphereManager manager | The atmosphere manager that owns this plugin. |
2 private and internal fields
Properties
Methods
| Member | What it is |
|---|---|
virtual void Disable() | Turns the plugin off and asks the manager to drop it from the priority list. |
void Enable() | Turns the plugin on and hands its audio to the manager. If already on, calls Reenabled instead. |
virtual void Initialize(AtmosphereManager manager) | Stores the manager and sets up audio. On a headless server it destroys the audio source. |
virtual void Mute(bool isMuted) | Mutes or unmutes the ambience source. |
virtual void OnConnect(Player player) | Hook called for a connecting player. Does nothing by default. |
virtual void StartAudio() | Starts the ambience source if it is not already playing. |
virtual void StartValues(AtmosphereManager manager, int hash) | Stores the manager and the hash the manager assigned. |
virtual void StopAudio() | Stops the ambience source. |
protected abstract void Enabled() | Subclass hook called by Enable when the plugin turns on. |
protected virtual void Reenabled() | Called when Enable is called on an already enabled plugin. |
Used in
Members of other types that take, return or hold a AtmospherePlugin:
AtmosphereManager.AtmospherePlugins, AtmosphereManager.availablePlugins, AtmosphereManager.CheckPriority, AtmosphereManager.ClearPriority, AtmosphereManager.GetHighestPlugin, AtmosphereManager.MainAudio, AtmosphereManager.SecondaryAudio, AtmosphereManager.SetAudio, AtmosphereManager.SetupNewMainAudio, AtmosphereSet.GetAudioPlayer.