Next: , Up: Resource Management   [Contents][Index]


14.1 Resource Manager

Component: ResourceManager

Resource Manager allows the player to have client-side resources like minerals, gold, or even experience points, which when spent successfully will cause MultiGame to send messages. This can be used to unlock new items/abilities, purchase units, or anything really.

IMGUI Settings

Field of ResourceManager: bool showGui

Should we show the resources using an immediate mode GUI? Not suitable for mobile.

Default value: true

Field of ResourceManager: Rect guiArea

Normalized viewport rectangle indicating the screen area for the IMGUI. Numbers are a percentage of screen space between 0 and 1. Not suitable for mobile devices.

Default value: new Rect(.71f,.01f,.28f,.1f)

Field of ResourceManager: GUISkin guiSkin

An optional skin for the IMGUI, if used

Field of ResourceManager: string resourceName

A unique name to identify this resource

Field of ResourceManager: float quantity

How much of this resource do we currently have?

Field of ResourceManager: float limit

The most we can have of this resource

Field of ResourceManager: float tickTime

If non-zero, ’Tick Amount’ resources will be added at this interval (in seconds)

Field of ResourceManager: float tickAmount

The amount of this resource we want to add each interval

Field of ResourceManager: bool visible

If we’re using IMGUI, should we show this resource in the list?

Default value: true

Available Messages

Message on ResourceManager: Save ()

Saves the current resources to Player Prefs. Works on all platforms.

Message on ResourceManager: Load ()

Loads the resource list from Player Prefs. Works on all platforms.

Message on ResourceManager: SelectResource ()

Selects a resource by it’s name from the list of Resources

Message on ResourceManager: AdjustLimit ()

How much do you want to adjust the limit for the currently named resource? Must be used after calling ’SelectResource’ and passing the name of the resource you want to adjust the limit for.

Message on ResourceManager: OpenMenu ()

Opens the IMGUI

Message on ResourceManager: CloseMenu ()

Closes the IMGUI

Message on ResourceManager: ToggleMenu ()

Toggles the IMGUI

Message on ResourceManager: ShowResource (string)

Shows a given resource in the IMGUI (if applicable).

Argument: The name of the resource we want to show.

Message on ResourceManager: HideResource (string)

Hides a given resource in the IMGUI (if applicable).

Argument: The name of the resource we want to hide.

IMGUI Settings

Field of ResourceManager: bool showGui

Should we show the resources using an immediate mode GUI? Not suitable for mobile.

Default value: true

Field of ResourceManager: Rect guiArea

Normalized viewport rectangle indicating the screen area for the IMGUI. Numbers are a percentage of screen space between 0 and 1. Not suitable for mobile devices.

Default value: new Rect(.71f,.01f,.28f,.1f)

Field of ResourceManager: GUISkin guiSkin

An optional skin for the IMGUI, if used

Field of ResourceManager: string resourceName

A unique name to identify this resource

Field of ResourceManager: float quantity

How much of this resource do we currently have?

Field of ResourceManager: float limit

The most we can have of this resource

Field of ResourceManager: float tickTime

If non-zero, ’Tick Amount’ resources will be added at this interval (in seconds)

Field of ResourceManager: float tickAmount

The amount of this resource we want to add each interval

Field of ResourceManager: bool visible

If we’re using IMGUI, should we show this resource in the list?

Default value: true

Available Messages

Message on ResourceManager: Save ()

Saves the current resources to Player Prefs. Works on all platforms.

Message on ResourceManager: Load ()

Loads the resource list from Player Prefs. Works on all platforms.

Message on ResourceManager: SelectResource ()

Selects a resource by it’s name from the list of Resources

Message on ResourceManager: AdjustLimit ()

How much do you want to adjust the limit for the currently named resource? Must be used after calling ’SelectResource’ and passing the name of the resource you want to adjust the limit for.

Message on ResourceManager: OpenMenu ()

Opens the IMGUI

Message on ResourceManager: CloseMenu ()

Closes the IMGUI

Message on ResourceManager: ToggleMenu ()

Toggles the IMGUI

Message on ResourceManager: ShowResource (string)

Shows a given resource in the IMGUI (if applicable).

Argument: The name of the resource we want to show.

Message on ResourceManager: HideResource (string)

Hides a given resource in the IMGUI (if applicable).

Argument: The name of the resource we want to hide.


Next: , Up: Resource Management   [Contents][Index]