private void Update() { if (Input.GetKeyDown(KeyCode.S) && Input.GetKey(KeyCode.LeftAlt) && Singleton.playerTank) { path = Path.GetFullPath(Path.Combine(PreciseSnapshotsMod.PreciseSnapshotsFolder, Singleton.playerTank.name + ".xml")); if (File.Exists(path)) { visible = true; return; } XMLSave.SaveTechAsXML(Singleton.playerTank, PreciseSnapshotsMod.PreciseSnapshotsFolder); } }
private void DoWindow(int id) { GUILayout.Label(new GUIContent("<color=yellow>WARNING</color>"), new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter, fontSize = 32 }); GUILayout.Label("The path \"" + path + "\" already exists.\n Do you want to replace it ?"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Cancel")) { visible = false; } if (GUILayout.Button("Overwrite")) { visible = false; XMLSave.SaveTechAsXML(Singleton.playerTank, PreciseSnapshotsMod.PreciseSnapshotsFolder); } GUILayout.EndHorizontal(); }