-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathModifier_AndroidSdkVersion.cs
39 lines (33 loc) · 1.16 KB
/
Modifier_AndroidSdkVersion.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
36
37
38
39
using System.Text;
using UnityEditor;
namespace Assets.Minamo.Editor {
class Modifier_AndroidSdkVersion : IModifier {
AndroidSdkVersions min;
AndroidSdkVersions target;
public void Apply() {
PlayerSettings.Android.minSdkVersion = min;
PlayerSettings.Android.targetSdkVersion = target;
}
public void Reload(AnyDictionary dict) {
min = ConvertVersion(dict.GetValue<int>("min"));
target = ConvertVersion(dict.GetValue<int>("target"));
}
internal static Modifier_AndroidSdkVersion Current() {
return new Modifier_AndroidSdkVersion()
{
min = PlayerSettings.Android.minSdkVersion,
target = PlayerSettings.Android.targetSdkVersion,
};
}
static AndroidSdkVersions ConvertVersion(int v) {
var ver = (AndroidSdkVersions)v;
return ver;
}
public string GetConfigText() {
var sb = new StringBuilder();
sb.AppendFormat("min={0}, ", min);
sb.AppendFormat("target={0}", target);
return sb.ToString();
}
}
}