Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Unity Coding Tips: Coroutine Coordinator Part 1

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,117
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 25, 2011

In this video we will make a coroutine coordinator that will allow us to pause, unease and kill running coroutines at will.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • the formatting on that got smashed! copy/paste it into MonoDevelop and let MD format it back to normal.

  • @JessyUV having just a single constructor with the method signature you posted would have an identical affect. I don't yet use default param values yet though because MonoDevelop hates them. Here is a subclass example:

    class A

    { public A(){} public A( string input ){}

    }

    class B : A

    { public B(){} public B( string input ) : base( input ){} // this would end up calling the 2nd of A's constructors

    }

  • @prime31studios So, is it the same as defining the second method like this? public Job (IEnumerator coroutine, bool shouldStart = true)...? I'm confused by what you're saying about subclassing.

  • @JessyUV one day I will invest in a mic instead of using the built in one.

    1. Allowing set for paused would totally work fine and there is no specific reason it wasn't done. There are always lots of ways to doing things in the land of C# so you can always take your pick.

    2. this( coroutine, true ) will call the 2nd constructor that takes in 2 parameters. If Job were a subclass of some other class something like base( coroutine, true ) would call the subclasses constructor.

  • Thanks so much! I've been waiting months for this one. Your tutorials are great. (Though your voice in this one is pretty close to the noise floor. I had to run it through louder speakers than my MacBook Pro provides to hear you over me eating nachos for dinner. ;-) ) A couple questions: 1. any reason you didn't use a Property for _paused? 2. What's ": this( coroutine, true )"? I don't think I've come across that syntax.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more