Posted March 14, 2022 by Julian Kantor
Version 1.2.0 has been released! This update adds an advanced piece of functionality to Runtime Objects.
Typically, Runtime Objects can be thought of as a reflection of the internal story state of Ink, where your Ink Objects actually live. With version 1.2.0, however, you are now able to modify the current value of Runtime Objects from within Unity and push them back to the Ink story state!
To use this function, simply set the new desired value of the field, and then call PushInstanceFieldToInkRuntime on an InkObject interface. For example -
Instance.FirstName = "John"; PushInstanceFieldToInkRuntime(nameof(Instance.FirstName));
or alternatively -
Instance.FirstName = "John"; Instance.LastName = "Doe"; PushAllInstanceFieldsToInkRuntime();
Please be careful when using this feature. Unless you specifically call a Push command, the internal story state will desync from your Runtime Object in Unity. The next time the field is accessed from within the Ink Story, the old value will be used unless you call Push.