I’ve searched UnityAnswers, and google, and haven’t found a solution to extending the EXPLICIT StartCoroutine method. I’m speaking specifically of the String-based startcoroutine method, that ONLY allows for one(1) parameter to be passed to it, called as follows:
StartCoroutine(“NameOfCoRoutineHere”, ParameterToPassHere);
If its possible, I need to be able to explicitly call a CoRoutine, using the string naming convention, with the ability to pass in multiple parameters(not just one), so it can be individually stopped, thus not needing to call stopAllCoroutines, or do the ever-so-nasty means of Deactivating a dummy-empty gameobject/empty that is housing a script-component with just that coRoutine on it. Using the traditional StopCoroutine on a non-string-based-explicitly-called CoRoutine fails constantly, thus my need to use the string-based call to start specific coroutines.
So perhaps it would look like this
StartCoroutine(“NameOfCoRoutineHere”, ParameterToPassHere1, ParameterToPassHere2, ParameterToPassHere3);
and say, each of the parameters is a different type, say a float for one, a string for another, and a transform for another.
something maybe like this for the method extension:
public static void StartCoroutine( this Coroutine StringToPassIn, int IntToPassIn, GameObject GameObjectToPassIn ){
Debug.Log(“test method extension”);
}
I cant seem to get this type of Extension working, as I usually do with a static class, I’m guessing it might have something to do with needing to inherit from monobehaviour to extend the startCoroutine method in such a way, not sure. Hoping a Unity Guru might be able to offer insight, thanks in advance for anyone taking the time to look this over and offer thoughts/help.