forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityGeneratedCreatorCpp.cs
More file actions
31 lines (25 loc) · 1.53 KB
/
UnityGeneratedCreatorCpp.cs
File metadata and controls
31 lines (25 loc) · 1.53 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
27
28
29
30
using System;
using System.IO;
using System.Text;
internal class UnityGeneratedCreatorCpp : UnityGeneratedCreator
{
private readonly string cppTemplate = "\n// GENERATED BY UNITY\n// DO NOT MODIFY, THIS FILE WILL BE OVERWRITTEN DURING NEXT BUILD\n\n#include \"pch.h\"\n#include \"UnityGenerated.h\"\n\nusing namespace Windows::Graphics::Display;\nusing namespace Windows::UI::ViewManagement;\n\nnamespace Unity\n{\n\nvoid SetupDisplay()\n{\n $SetupDisplay$\n}\n\n}\n";
private readonly string headerTemplate = "\n// GENERATED BY UNITY\n// DO NOT MODIFY, THIS FILE WILL BE OVERWRITTEN DURING NEXT BUILD\nnamespace Unity\n{\n void SetupDisplay();\n}\n ";
internal override string[] Create(string directory)
{
string[] strArray = new string[] { "UnityGenerated.cpp", "UnityGenerated.h" };
string path = Path.Combine(directory, strArray[0]);
StringBuilder builder = new StringBuilder(this.cppTemplate);
string displaySetupCode = base.GetDisplaySetupCode();
builder.Replace("$SetupDisplay$", displaySetupCode);
File.WriteAllText(path, builder.ToString());
File.WriteAllText(Path.Combine(directory, strArray[1]), this.headerTemplate);
return strArray;
}
protected override string GetDefaultFullScreenCode() =>
base.GetDefaultFullScreenCode().Replace(".", "::");
protected override string GetInitialOrientationsCode() =>
base.GetInitialOrientationsCode().Replace(".", "::");
protected override string IndentCodeLine() =>
"\t";
}