How do I set "Reset On Loss" from script?

In a MARS session, I want to give the user the option to freeze currently found horizontal planes. There is an Editor setting, but I would like to access this Boolean from script (C#).

I tried HorizontalPlane.GetComponent<Proxy>().GetComponent<SetPoseAction>().ResetOnLoss = true;but “ResetOnLoss” is not exposed.

How do I access this Boolean?

Hi there! Thanks for using MARS.

It looks like this was an oversight on our part. There is no public accessor for m_ResetOnLoss, so you will have to either us reflection, or embed the MARS package and modify our code to add this property. The easiest way to do this is by copying the package from your project’s Library/PackageSource folder into the Packages folder, or to use the Client.Embed method of the Package Manager API.

We will be sure to add an accessor property for this field in a future release of MARS.

1 Like