private static void RestorePreserveUIAttributes(ComponentBuilderOptions options) { if (!options.PreserveSession) { return; } XmlSerializer deserializer = new XmlSerializer(typeof(Preserve)); if (string.IsNullOrEmpty(options.PreserveXml)) { TextReader reader = new StreamReader(ResourceLoader.GetEmbeddedResourceStream("Preserve.xml", XamlPlaygroundAssembly)); try { RestoredUIAttributes = (Preserve)deserializer.Deserialize(reader); } finally { reader.Close(); } } else { using (var stream = options.PreserveXml.GenerateStreamFromString()) { RestoredUIAttributes = (Preserve)deserializer.Deserialize(stream); } } }
void Awake() { DontDestroyOnLoad(gameObject); if (instance == null) { instance = this; } else { Destroy(gameObject); } }
//public static string keep; // Start is called before the first frame update void Awake() { // keep = GetName.userIDs; if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Awake() { preserve = GameObject.FindGameObjectWithTag("Preserve").GetComponent<Preserve>(); }