Allows you to initialize and configure the Astra library using JSON, Astra.ProjectConfiguration, or direct calls
More...
|
class | ProjectConfigJob |
| Job used to track the initialization process of this project. Returns a boolean indicating a success, or a ProjectConfigError if an error occurred during initialization. More...
|
|
Allows you to initialize and configure the Astra library using JSON, Astra.ProjectConfiguration, or direct calls
◆ ProjectConfigError
Used to check for error types during initialization
Enumerator |
---|
Success | No error occurred
|
FailedToSetLogPath | A problem with the log path was detected, ensure the path is valid and you have write access to it
|
FailedToSetLoggingEnabled | A problem enabling logging was detected, ensure the path is valid and you have write access to it
|
FailedToSetLogLevel | A problem enabling log levels, check your Astra.LogLevel value
|
FailedToSetDBPath | A problem with the db path was detected, ensure the path is valid and you have write access to it
|
FailedToSetAppId | A problem setting the application id, ensure you have the right id from your web portal
|
FailedToLogin | A problem logging in, ensure your username is valid if specified
|
FailedToSetAppEnvironment | A problem occured communicating with the server, ensure your application namespace URI is accurate via the web portal
|
◆ GetCurrent()
Retrieves the most active configuration that has made it's way through the Initialize call. NOTE: This persists through serialization in Editor, so it's possible to have a configuration that has loaded in edit mode be valid in play mode even if in play mode one hasn't been initialized.
- Returns
- The ProjectConfiguration is found, else null meaning no config has been loaded yet
◆ GetLoggingEnabled()
static bool Astra.Configuration.GetLoggingEnabled |
( |
| ) |
|
|
inlinestatic |
Returns whether logging is currently enabled
- Returns
- true or false
◆ GetLogLevel()
static LogLevel Astra.Configuration.GetLogLevel |
( |
| ) |
|
|
inlinestatic |
Gets the currrent LogLevel of logging
- Returns
- What the logging level is set to
◆ GetLogPath()
static string Astra.Configuration.GetLogPath |
( |
| ) |
|
|
inlinestatic |
Returns logging path
- Returns
- logging path
◆ Initialize() [1/2]
Sets up the application environment from ProjectConfiguration scriptable object.
- Parameters
-
config | ProjectConfiguration scriptable object with member variables of settings to set - Returns
- A job with the results
|
◆ Initialize() [2/2]
static ProjectConfigJob Astra.Configuration.Initialize |
( |
UnityEngine.TextAsset |
asset | ) |
|
|
inlinestatic |
Triggers Initialize interally converting your text asset into json and parsing it
- Parameters
-
asset | The TextAsset which can be dragged into your behaviour or loaded from Resources.Load<TextAsset> or similar |
- Returns
- A job you should wait upon to ensure the configuration has loaded successfully
{
"app_id": 1,
"app_secret": "YOURSECRETKEY",
"app_environment": "https://YOURCOMPANY.maketafi.com",
"user_login": "",
"user_password": "",
"log_enabled": true,
"log_level": 300,
"log_path": "",
"db_path": ""
}
◆ InitializeFromJSON()
◆ InitializeFromJSONFile()
static ProjectConfigJob Astra.Configuration.InitializeFromJSONFile |
( |
string |
path | ) |
|
|
inlinestatic |
◆ ParseJSON()
◆ ParseJSONFile()
◆ RecordLastAstraConfiguration()
Records the last Astra configuration used for this project. NOTE: does nothing if not in UnityEditor or if it's in play mode
- Parameters
-
◆ SetDBPath()
static bool Astra.Configuration.SetDBPath |
( |
string |
dbPath | ) |
|
|
inlinestatic |
Set DB path
- Returns
- true or false
◆ SetLoggingEnabled()
static bool Astra.Configuration.SetLoggingEnabled |
( |
bool |
enableLog | ) |
|
|
inlinestatic |
Turn on/off logging
- Parameters
-
enableLog | Set logging ienabled(true, false) |
- Returns
- true or false
◆ SetLogLevel()
static bool Astra.Configuration.SetLogLevel |
( |
LogLevel |
logLevel | ) |
|
|
inlinestatic |
Set log level
- Parameters
-
setLogLevel | The LogLevel to use |
- Returns
- true or false
◆ SetLogPath()
static bool Astra.Configuration.SetLogPath |
( |
string |
logPath | ) |
|
|
inlinestatic |
Set logging path
- Returns
- true or false
The documentation for this class was generated from the following file:
- Assets/Astra/Configuration/Configuration.cs