Forum rules - please read before posting.

how to do pause active and inactive in script???!?

how to do pause active and inactive in script???!?
for exp :

void Start(){
//pause active ac
rull = false ;
StartCoroutine (starter());
}

IEnumerator  starter () {

yield return new WaitForSeconds(0.1f);
if ( .....
else...
//pause inactive ac
...
}

Comments

  • edited May 2015
    You mean to de-activate all of AC?

    You can do this by calling:
    AC.KickStarter.TurnOffAC ();
    and:
    AC.KickStarter.TurnOnAC ();
  • Not just the condition. Or function. Is paused.
      At the beginning of the pause function. In the end it does not pause

    exp : 

    void TestAction  (){
    //pause ac
    rull = false ;
      yield return new WaitForSeconds(0.1f);
     if ( 
    .....
     else ... 
     // run ac
    ...
    }

    /////wait until finished function
  • edited May 2015
    Please explain what you mean - and what you're trying to do - as clearly as you can.  I'm here to help, but I'm really having trouble with what you mean.  Any context you can give would help me answer you better.

    Are you referring to code that goes within a custom Action?  Action scripts cannot contain yields, as they are made from ScriptableObjects.  Instead, the Run function must return the time that the system must wait before re-running it to see if it's finished.  The included ActionTemplate.cs has some comments that may help.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.