Coroutines not working
Discussion in 'Rust Development' started by bazuka5801, May 27, 2016.
-
Type not correct?
using System.Collections; <> using System.Collections.Generic; -
How use Corountine in Plugin Unity ?
-
Code:
using UnityEngine; using System.Collections.Generic;namespace Oxide.Plugins { [Info("MyPlugin", "xxx", "0.0.1")] [Description("This Plugin displays...")] class MyPlugin : RustPlugin { public class SubClass : MonoBehaviour //<<< Works ONLY with MonoBehaviour as Nested-Class { IEnumerator Start() { StartCoroutine("DoSomething", 2.0F); yield return new WaitForSeconds(1); StopCoroutine("DoSomething"); } IEnumerator DoSomething(float someParameter) { while (true) { print("DoSomething Loop"); yield return null; } } } } } -
Wulf Community Admin
Why do you need to use coroutines? If you want to add a delay to something, use Oxide's timer library.
