-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelpers.js
More file actions
26 lines (22 loc) · 1.07 KB
/
Copy pathhelpers.js
File metadata and controls
26 lines (22 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Define the basic log channel name if the using code wont be defining one.
var _TUTORIAL_LOGCHANNEL = "ImmersiveSpace";
// Helper function to tell us if we are running the script on a client instance.
// In our case a client is a non-server and non-headless Tundra. Non-headless means we have the main UI window.
function isClient()
{
if (!server.IsRunning() && !framework.IsHeadless())
return true;
return false;
}
// Helper function to tell us if we are running the script on a server instance.
function isServer()
{
return server.IsRunning();
}
// Function to set log channel name.
function SetLogChannel(name) { _TUTORIAL_LOGCHANNEL = name; }
// Redirect functions to the ConsoleAPI logging functions. We also add the log channel name.
function LogInfo(msg) { console.LogInfo("[" + _TUTORIAL_LOGCHANNEL + "]: " + msg); }
function LogWarning(msg) { console.LogWarning("[" + _TUTORIAL_LOGCHANNEL + "]: " + msg); }
function LogError(msg) { console.LogError("[" + _TUTORIAL_LOGCHANNEL + "]: " + msg); }
function Log(msg) { LogInfo(msg); }