playMaker

Author Topic: CanStreamedLevelBeLoaded & GetStreamProgressForLevel  (Read 5787 times)

Maart

  • Junior Playmaker
  • **
  • Posts: 88
CanStreamedLevelBeLoaded & GetStreamProgressForLevel
« on: July 03, 2011, 07:06:15 AM »
when I use the load level action in a webplayer it tries to open the level before it's fully loaded, there seems to be no check for can level be streamed
can you please update it with something like like

// Check if level at index 1 can be loaded.
// If it can be loaded then load it.
function Update() {
    if (Application.CanStreamedLevelBeLoaded(1)) {
          Application.LoadLevel(1);
    }
}


or we could use a GetStreamProgressForLevel action that fires of an event when a certain percentage is reached.
like:

function Update() {
    if(Application.GetStreamProgressForLevel(1) == 1) {
        guiText.text = "Level at index 1 has been fully streamed!";
    } else {
        percentageLoaded = Application.GetStreamProgressForLevel(1) * 100;
        guiText.text = percentageLoaded.ToString();
    }
}

thanks in advance

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: CanStreamedLevelBeLoaded & GetStreamProgressForLevel
« Reply #1 on: July 03, 2011, 10:58:07 AM »
Great suggestion!

I'm thinking a new action with streaming options would make sense: Load Streaming Level

It would test for streaming, store progress and send events...

Can you see a downside to using a new action for this?

Maart

  • Junior Playmaker
  • **
  • Posts: 88
Re: CanStreamedLevelBeLoaded & GetStreamProgressForLevel
« Reply #2 on: July 03, 2011, 07:55:12 PM »
simply allowing me to check the streaming status would allow me to fix the bug I have, but something more advanced is always good. hope to find it in the next release.

Maart

  • Junior Playmaker
  • **
  • Posts: 88
Re: CanStreamedLevelBeLoaded & GetStreamProgressForLevel
« Reply #3 on: October 24, 2011, 06:52:20 PM »
was this fixed in latest update? I couldn't find info about it. seems like i small fix to do.

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • my twitter @andrewlukasik
Re: CanStreamedLevelBeLoaded & GetStreamProgressForLevel
« Reply #4 on: October 25, 2011, 12:09:05 PM »
I'm not a coder, but never the less this code looks like even I could implement it in about 15minutes (I mean - srsly)
« Last Edit: October 25, 2011, 12:10:37 PM by Andrew_Raphael_Lukasik »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support