forked from readyplayerme/rpm-unity-sdk-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommonHeaders.cs
35 lines (33 loc) · 1.11 KB
/
CommonHeaders.cs
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
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;
using UnityEngine;
namespace ReadyPlayerMe.Core
{
public static class CommonHeaders
{
private const string RPM_SOURCE = "RPM-Source";
private const string RPM_SDK_VERSION = "RPM-SDK-Version";
private const string UNITY_PREFIX = "unity";
private const string EDITOR = "editor";
private const string RUNTIME = "runtime";
private const string PLAYMODE = "playmode";
private const string EDITMODE = "editmode";
private const string SEPARATOR = "-";
public static Dictionary<string, string> GetRequestHeaders()
{
var source = UNITY_PREFIX + SEPARATOR;
if (Application.isEditor)
{
source += EDITOR + SEPARATOR + (Application.isPlaying ? PLAYMODE : EDITMODE);
}
else
{
source += RUNTIME;
}
return new Dictionary<string, string>
{
{ RPM_SOURCE, source },
{ RPM_SDK_VERSION, ApplicationData.GetData().SDKVersion }
};
}
}
}