playMaker

Author Topic: Get Name of Last Loaded Level With Path  (Read 2884 times)

IDontKnow

  • Junior Playmaker
  • **
  • Posts: 56
Get Name of Last Loaded Level With Path
« on: December 03, 2013, 07:01:58 AM »
I was wondering is it was possible to get the name of the last loaded level with the path still intact.

Say for example I have a scene located in Assets/Scenes/Chapter 01/exampleScene.unity

I can use the action found here: http://hutonggames.com/playmakerforum/index.php?topic=816.msg3288#msg3288 to return "exampleScene" to a string, but what I'd like to get back in string form is this: "Assets/Scenes/Chapter 01/exampleScene".
--

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Name of Last Loaded Level With Path
« Reply #1 on: December 04, 2013, 05:28:01 AM »
Hi,

 nop, you can't actually, at least to my knowledge. I would do this another way.

have the chapter x referenced in your scene name and that's it, you can then parse the  loaded level name to know which chapter it is.

the other way ( likely more flexible) is to maintain for example a global variable, or a playerpref value that you set when the scene starts, so anyone interested would know what chapter is currently loaded.

bye,

 Jean

IDontKnow

  • Junior Playmaker
  • **
  • Posts: 56
Re: Get Name of Last Loaded Level With Path
« Reply #2 on: December 04, 2013, 06:08:19 AM »
Thanks for the quick response as always Jean. :)
--