ksCoroutine

Summary

Use Coroutine in Reactor server scripts.

Description

ksCoroutine is the equivalent to Unity Coroutine on for server scripts.

using KS.Reactor;
using KS.Reactor.Server;

/**
 * Wait one second then log out a message.
 */
public class srRoom : ksServerEntityScript
{
    public override void Initialize()
    {
        Room.Coroutines.Start(WaitOneSecond());
    }

    private IEnumerator WaitOneSecond()
    {
        yield return Room.Coroutines.Sleep(1f);
        ksLog.Info("1 second has passed");
    }
}