When an Experior model is saved, data added to an Attributes object is saved together with the rest of the model data.
Example
The TestObject is an example of an object that is going to be saved:
(Note: The object has to be serializable)
[Serializable]
public class TestObject
{
public TestObject()
{
private string text;
public string Text
{
get { return text; }
set { text = value; }
}
private int count;
public int Count
{
get { return count; }
set { count = value; }
}
}
}
Now create an instance of the TestObject class.
TestObject test = new TestObject();
test.Count = 100;
test.Text = "Hello";
And an instance of the Attribute class and then add the instance of the TestObject. The name Test1 is used to identify the object when the model is reloaded or whenever you want to get hold of the object.
Core.Environment.Scene.Attributes attributes = new Core.Environment.Scene.Attributes();
attributes.Add("Test1", test);
The test object can at any time be removed by disposing the attribute object or by calling the static method Remove.
attributes.Dispose();
or
Core.Environment.Scene.Attributes.Remove(this.Name);
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |