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);
                }
            }
        }
Example #2
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);

        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
Example #3
0
    //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);
        }
    }
Example #4
0
 void Awake()
 {
     preserve = GameObject.FindGameObjectWithTag("Preserve").GetComponent<Preserve>();
 }