PR Fixes
This commit is contained in:
Родитель
06eaa1a823
Коммит
9d9e411c79
|
@ -17,15 +17,12 @@ public class ClosingScript : MonoBehaviour
|
|||
"UnitySelectMonitor"
|
||||
};
|
||||
|
||||
using (StreamWriter file = new StreamWriter("ScreenSelectorPrefs.txt"))
|
||||
using (StreamWriter file = new StreamWriter(Path.Combine(Application.persistentDataPath, "ScreenSelectorPrefs.txt")))
|
||||
{
|
||||
foreach(string key in settings)
|
||||
foreach (string key in settings)
|
||||
{
|
||||
file.WriteLine(PlayerPrefs.GetInt(key, 0).ToString());
|
||||
}
|
||||
|
||||
file.Flush();
|
||||
file.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,12 @@ public class PostProcessLauncherCopy
|
|||
[PostProcessBuildAttribute(1)]
|
||||
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
|
||||
{
|
||||
string dataPath = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), "PersistentDataPath.txt");
|
||||
using (StreamWriter file = new StreamWriter(dataPath))
|
||||
{
|
||||
file.WriteLine(Path.Combine(Application.persistentDataPath, "ScreenSelectorPrefs.txt"));
|
||||
}
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case BuildTarget.StandaloneWindows:
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -446,10 +446,39 @@ std::wstring ConstructCommandLine()
|
|||
return command;
|
||||
}
|
||||
|
||||
std::string GetDataPath()
|
||||
{
|
||||
std::string path;
|
||||
std::wstring dir;
|
||||
|
||||
// When run from VS or other debugging places, current working directory can be set to something else.
|
||||
dir.resize(MAX_PATH);
|
||||
GetModuleFileName(NULL, LPWSTR(dir.data()), MAX_PATH);
|
||||
|
||||
size_t pathCharLocation = dir.find_last_of(L"\\");
|
||||
if (pathCharLocation == std::string::npos)
|
||||
return path;
|
||||
|
||||
dir.replace(pathCharLocation + 1, dir.length(), L"PersistentDataPath.txt");
|
||||
|
||||
// Get data path
|
||||
std::ifstream pathFile(dir);
|
||||
|
||||
if (!pathFile.is_open())
|
||||
return std::string();
|
||||
|
||||
std::getline(pathFile, path);
|
||||
|
||||
pathFile.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
void ReadPreferences()
|
||||
{
|
||||
// Open, read, and close file
|
||||
std::ifstream file("ScreenSelectorPrefs.txt");
|
||||
std::ifstream file(GetDataPath());
|
||||
const int numPrefs = 6;
|
||||
int values[numPrefs] = { 0 };
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче