GithubHelp home page GithubHelp logo

plumpmath / unitycustomcoroutine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gohbiscuit/unitycustomcoroutine

0.0 0.0 0.0 181 KB

Unity Custom Coroutine class can be use to handle multiple or nested coroutine

C# 100.00%

unitycustomcoroutine's Introduction

"# UnityCustomCoroutine"

Custom Coroutine Classes to perform yielding of coroutine that has the following feature:

  • waits until all nested/inline coroutine has completed it's execution
  • appending of tasks and starts them sequentially in order
  • easy to manage code and enhance readability

UnityCustomCoroutine

This package contains the following components

  • CustomCoroutine.cs (Custom Coroutine Classes)
  • EventManager.cs (Custom classes for managing multi-cast delegates)
  • TestClass.cs (Class to test Task.cs and delegates)
  • Utility packages contains
  • Debug.cs (debug wrapper class that hides logging on release build)
  • FpsCounter.cs (Fps counter display)
  • Profiler (Show memory usage)

Installation

Pre-requisite: Unity3d version 5++ software download it at http://unity3d.com/get-unity.

  1. Clone it to your working directory,

  2. Open the project that you have clone using Unity3d.

  3. Run the StartScene.

  4. Examine TestObject prefab and console for more info. (Can also see the Scripts attached to it).

Usage

Run the project and see TestClass.cs for more details on how to use it

#1 - Add all custom coroutine and start when needed CustomCoroutine t = this.CreateCustomCoroutine (DoSomethingCoroutine ()); t.AddCoroutine(DoAnotherCoroutine()); ... t.Start();

#2 - Start coroutine immediately this.StartCustomCoroutine(DoMyCoroutine());

#3- Wait for coroutine to Complete IEnumerator CoroutineFunc() { ... yield return this.StartCustomCoroutine(MyCoroutine()).UntilDone;

or

CustomCoroutine t = this.CreateCustomCoroutine (MyCoroutine ()); t.Start(); yield return t.UntilDone; }

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

First created 31/05/2016 by Edwin. Cheers.

Credits

The classes was made with some references from online resource, as well as crediting my mentor Muxian Wu.

References: http://answers.unity3d.com/questions/1040319/whats-the-proper-way-to-queue-and-space-function-c.html http://twistedoakstudios.com/blog/Post83_coroutines-more-than-you-want-to-know

http://blog.zephyr-ware.com/delegates-and-events/ http://www.codeproject.com/Articles/20550/C-Event-Implementation-Fundamentals-Best-Practices

License

The MIT License (MIT) Open Source Free

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.