C# Class Epigene.GAME.GameManager

GMGame manager class to manage the game play via triggers. Current design is, that only one game is running. A Game state is not implemented. Instead we use messages going around informing all relevant objects about the changes in the game. Plus every object has its own state.
Afficher le fichier Open project: fi-content2-games-platform/FIcontent.Gaming.Enabler.phenomobilecharactermanager Class Usage Examples

Méthodes publiques

Свойство Type Description
BalanceSheetAchievementMode bool
debugMode bool
hidTouch bool
mainGame MainGame
muteSfx bool
muteSoundBackground bool
offline bool
screenHeight int
screenWidth int
setTouch bool
standaloneBetaMode bool
standaloneSingleLevelMode bool
startAchievementsMode bool

Méthodes publiques

Méthode Description
Add ( Epigene.GAME.ATrigger trigger ) : void

Adds the trigger to the current game. For smoothly "Remove trigger" execute "ATrigger.Repeat = 0;" Because that is a Remove, which can occur within trigger execution. Otherwise you get an error.

Add ( Epigene.GAME.GMGame newGame ) : void

Adds the trigger.

Add ( string gameName, Epigene.GAME.ATrigger trigger ) : void

Adds the trigger. For smoothly "Remove trigger" execute "ATrigger.Repeat = 0;" Because that is a Remove, which can occur within trigger execution. Otherwise you get an error.

AddDialogFromFile ( string fileName ) : void

Add DialogTriggers from json file

ClearEvents ( ) : void
Event ( string type, string eventId, string param = "" ) : void

Delegate events to registred functions

Get ( string name ) : Epigene.GAME.GMGame

Get an instance of the game if its exist

Load ( ) : bool

Load a game

LoadJSon ( string fileName ) : object>.Dictionary

Load settings from JSon file

LoadScene ( string level, bool _setTouch = false ) : void

Loads the scene.

LoadText ( string fileName ) : string

Load the specified fileName from the Resource directory as string

Pause ( string name ) : void

Pause or resume the current game.

Play ( string name ) : void

Pause or resume the current game.

RegisterEventHandler ( string eventType, EventFunction func, GameObject handler = null ) : void

Register a funtion handler to an event.

Remove ( string name ) : void

Removes the game specified by the name. If the name is "*" it will remove all games.

RemoveEventHandler ( string eventType, EventFunction func ) : void
RemoveTriggers ( ) : void

Remove all triggers from active game.

RemoveTriggers ( TriggerType type ) : void

/// Remove all trigger with given type ///

ResetEventHandler ( string eventId, string data ) : void
Save ( ) : bool

Save a game with it's state and triggers

SaveJSon ( object>.Dictionary data, string fileName ) : void

Save settings to JSon file Should be limitted for editor mode only. (file access)

Start ( string name ) : bool

Start the game. The next update will process triggers for this game only. If the game not exist, it will log warning and return false. If another game already started, it will NOT send stop(), but pause it, while set the new one as current game.

Stop ( string name ) : bool

Stop the specified name. If the name is empty string, it will stop the current game. If the name is "*" it will stop all games. If the name is specify one game, it will stop only that one. Errors will be logged as warning.

Update ( ) : void

Process triggers

Private Methods

Méthode Description
GameManager ( ) : UnityEngine

ctor

LoadEpigeneProperties ( ) : void

Method Details

Add() public méthode

Adds the trigger to the current game. For smoothly "Remove trigger" execute "ATrigger.Repeat = 0;" Because that is a Remove, which can occur within trigger execution. Otherwise you get an error.
public Add ( Epigene.GAME.ATrigger trigger ) : void
trigger Epigene.GAME.ATrigger
Résultat void

Add() public méthode

Adds the trigger.
public Add ( Epigene.GAME.GMGame newGame ) : void
newGame Epigene.GAME.GMGame
Résultat void

Add() public méthode

Adds the trigger. For smoothly "Remove trigger" execute "ATrigger.Repeat = 0;" Because that is a Remove, which can occur within trigger execution. Otherwise you get an error.
public Add ( string gameName, Epigene.GAME.ATrigger trigger ) : void
gameName string
trigger Epigene.GAME.ATrigger
Résultat void

AddDialogFromFile() public méthode

Add DialogTriggers from json file
public AddDialogFromFile ( string fileName ) : void
fileName string
Résultat void

ClearEvents() public méthode

public ClearEvents ( ) : void
Résultat void

Event() public méthode

Delegate events to registred functions
public Event ( string type, string eventId, string param = "" ) : void
type string
eventId string
param string
Résultat void

Get() public méthode

Get an instance of the game if its exist
public Get ( string name ) : Epigene.GAME.GMGame
name string Name of game
Résultat Epigene.GAME.GMGame

Load() public méthode

Load a game
public Load ( ) : bool
Résultat bool

LoadJSon() public static méthode

Load settings from JSon file
public static LoadJSon ( string fileName ) : object>.Dictionary
fileName string
Résultat object>.Dictionary

LoadScene() public méthode

Loads the scene.
public LoadScene ( string level, bool _setTouch = false ) : void
level string Level.
_setTouch bool Optional Parameter, set it true if you need it true. else leave it blank
Résultat void

LoadText() public static méthode

Load the specified fileName from the Resource directory as string
public static LoadText ( string fileName ) : string
fileName string File name and path realtive to Resource directory.
Résultat string

Pause() public méthode

Pause or resume the current game.
public Pause ( string name ) : void
name string
Résultat void

Play() public méthode

Pause or resume the current game.
public Play ( string name ) : void
name string
Résultat void

RegisterEventHandler() public méthode

Register a funtion handler to an event.
public RegisterEventHandler ( string eventType, EventFunction func, GameObject handler = null ) : void
eventType string
func EventFunction
handler UnityEngine.GameObject
Résultat void

Remove() public méthode

Removes the game specified by the name. If the name is "*" it will remove all games.
public Remove ( string name ) : void
name string Name.
Résultat void

RemoveEventHandler() public méthode

public RemoveEventHandler ( string eventType, EventFunction func ) : void
eventType string
func EventFunction
Résultat void

RemoveTriggers() public méthode

Remove all triggers from active game.
public RemoveTriggers ( ) : void
Résultat void

RemoveTriggers() public méthode

/// Remove all trigger with given type ///
public RemoveTriggers ( TriggerType type ) : void
type TriggerType
Résultat void

ResetEventHandler() public méthode

public ResetEventHandler ( string eventId, string data ) : void
eventId string
data string
Résultat void

Save() public méthode

Save a game with it's state and triggers
public Save ( ) : bool
Résultat bool

SaveJSon() public static méthode

Save settings to JSon file Should be limitted for editor mode only. (file access)
public static SaveJSon ( object>.Dictionary data, string fileName ) : void
data object>.Dictionary
fileName string
Résultat void

Start() public méthode

Start the game. The next update will process triggers for this game only. If the game not exist, it will log warning and return false. If another game already started, it will NOT send stop(), but pause it, while set the new one as current game.
public Start ( string name ) : bool
name string Name.
Résultat bool

Stop() public méthode

Stop the specified name. If the name is empty string, it will stop the current game. If the name is "*" it will stop all games. If the name is specify one game, it will stop only that one. Errors will be logged as warning.
public Stop ( string name ) : bool
name string Name of the game
Résultat bool

Update() public méthode

Process triggers
public Update ( ) : void
Résultat void

Property Details

BalanceSheetAchievementMode public_oe property

public bool BalanceSheetAchievementMode
Résultat bool

debugMode public_oe property

debug mode switch use it for get additional info about the game like current story and dialog id in bubble.
public bool debugMode
Résultat bool

hidTouch public_oe property

if device has HID driver or not
public bool hidTouch
Résultat bool

mainGame public_oe property

Reference / link to the real game object which runs during the whole game. This is the entry point for the game.
public MainGame mainGame
Résultat MainGame

muteSfx public_oe property

Muse music or sound for start
public bool muteSfx
Résultat bool

muteSoundBackground public_oe property

public bool muteSoundBackground
Résultat bool

offline public_oe property

public bool offline
Résultat bool

screenHeight public_oe property

public int screenHeight
Résultat int

screenWidth public_oe property

public int screenWidth
Résultat int

setTouch public_oe property

public bool setTouch
Résultat bool

standaloneBetaMode public_oe property

public bool standaloneBetaMode
Résultat bool

standaloneSingleLevelMode public_oe property

public bool standaloneSingleLevelMode
Résultat bool

startAchievementsMode public_oe property

public bool startAchievementsMode
Résultat bool