Re: Save Global Variable

Tue 25. Jul 2017, 13:25

Ah now i understand!
While i don't think i changed anything in particular related to that i do use the same callback to turn the Database back into edit mode.
The problem with those callbacks unfortunately is, that the order in which they are called is random. It is therefor very much possible that it worked by accident this whole time.

I will investigate that issue and see what event would be correct to reset the database without interfering with any user code.

I get back to you as soon as i got more information.

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Save Global Variable

Tue 25. Jul 2017, 13:28

Oh ok thank you, like I said in edit, when it's compile on my android I don't have the problem, but if it can work in edit mode it's better :)

Thank, waiting your investigate :)
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Re: Save Global Variable

Tue 25. Jul 2017, 13:46

It's relative to save so I post here. I wanna to save the status of all object with a certain feature, to get all of them, I do

Code: Select all
List<IObjectWithFeatureDisplayCondition> listDisplayCondition = ArticyDatabase.GetAllOfType<IObjectWithFeatureDisplayCondition>();


But since IObjectWithFeatureDisplayCondition I find any way to save the technical name to be able to load the data.

Have you any idea? I have many template with that feature, I prefer to avoid to make a loop for each of them :/

thank you :)
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Re: Save Global Variable

Tue 25. Jul 2017, 13:51

Not sure i understand you correctly, you want to get the technical name of those objects? Remember that every object with such an IObjectWith interface must be an ArticyObject, which itself has the TechnicalName property.

Code: Select all
foreach(var feature in listDisplayCondition)
{
   var obj = feature as ArticyObject;
   SaveTechnicalName(obj.TechnicalName);
   SaveDisplayCondition(feature->GetDisplayConditionFeature());
}
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Save Global Variable

Tue 25. Jul 2017, 13:54

Oh ok, I though IObjectWithFeatureDisplayCondition was different than an ArticyObject :)

Thank you !
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Re: Save Global Variable

Tue 25. Jul 2017, 15:30

Glad that worked for you!

Back to your save issue:
It was again an issue with how unity reports play mode and transition of play mode. I used the improper way and while your OnApplicationQuit is called, the flag was already showing false, which made the GlobalVariables to return their editor values instead of their still valid runtime values.
I fixed that and some other cleanup issues regarding those events and now you should have access to the correct Global Variables values inside OnApplicationQuit.

Now i don't want to release that version to everyone with those changes without further testing, but i also don't want you to wait too long. So if you feel comfortable using a pre-release i built a version with that fix(and some other changes) and you can test for yourself if my changes fixed the problem for you. But keep in mind its a pre-release, so make a backup if necessary and you probably don't want to ship your project until you can use the release version of the plugin.

You can find this pre-release here, or you can wait until i fixed some remaining issues and managed to test those changes further.

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Save Global Variable

Wed 26. Jul 2017, 08:08

Oh really nice job. I have finish the upgrade of my old function, so I will take the version when it will be release :)
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Re: Save Global Variable

Tue 15. Aug 2017, 15:27

Hi Zeldarck,

the new release should allow you to access the global variables even inside OnApplicationQuit.

Thank you again for reporting it!

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Previous

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 64 guests

Who We Are
Contact Us
Social Links