Search Unity

[SOLVED]coroutine conundrum

Discussion in 'Scripting' started by hai_ok, Sep 12, 2009.

  1. hai_ok

    hai_ok

    Joined:
    Jun 20, 2007
    Posts:
    193
    I have a

    Code (csharp):
    1. while (true){
    2.   //DoSomeStuff
    3. }
    I am evaluating a random value and doing some "wait"ing while I wait to fire off the results.

    Depending on the results, the wait is a different length and the event I fire off is different.

    I can't get it to change (I can't change it). Once this little block of code thinks that the values are decided (say, inside of Awake()), they don't change. Is this "Island Logic?" or is my logic flawed?

    I'll post the code when I get home if needed. Sorry I don't have it here.

    I've tried a

    Code (csharp):
    1. switch{
    2.   case:
    3.     //something
    4.   break;
    5.   case:
    6.     //something else
    7.   break;
    8. }
    inside of the while (true)

    I have changed the values inside of Update() and OnGui() and outside of them. I have staticed the variables and sent them from other places and even tried to do it all inside the while (true).

    How can I send variable changes to this little island of code?
     
  2. hai_ok

    hai_ok

    Joined:
    Jun 20, 2007
    Posts:
    193
    Solved it w an array inside another function.