CleanupManager Class

RAGE Plugin Hook Documentation

[This is preliminary documentation and is subject to change.]

Class for cleaning up IDeletables.

Examples

The following example spawns a car, and deletes it 3 seconds after it's been destroyed. The CleanupManager removes the IDeletables that's been added to it, when it gets disposed.
C#
using(CleanupManager cleanupManager = new CleanupManager())
{
    Vector3 spawnPosition = playerVehicle.GetOffsetPosition(new Vector3(-3f, 7f, 0f));
    Vehicle car = new Vehicle("POLICE2", spawnPosition, playerVehicle.Heading);
    cleanupManager.Add(car);
    while (!car.IsDead)
    {
        GameFiber.Yield();
    }

    GameFiber.Sleep(3000);
}
Inheritance Hierarchy

SystemObject
  RageCleanupManager

Namespace:  Rage
Assembly:  RagePluginHook (in RagePluginHook.dll) Version: 0.0.0.0 (0.56.1131.11510)
Syntax

public sealed class CleanupManager : IDisposable

The CleanupManager type exposes the following members.

Constructors

  NameDescription
Public methodCleanupManager
Initializes a new instance of the CleanupManager class.
Top
Methods

  NameDescription
Public methodAdd
Adds the specified IDeletable to this CleanupManager.
Public methodDispose
Finalizes an instance of the CleanupManager class.
Public methodRemove
Removes the specified IDeletable from this CleanupManager.
Top
See Also

Reference