Jump to content

Wait? Also, find the current save game name?


Guest

Recommended Posts

How would you tell the script to wait for X seconds?  Also, how would you find the name of the current save game?  I think it's in HighLogic...

Edited by Guest
Link to comment
Share on other sites

For your second question: HighLogic.SaveFolder

For your first, I'm not positive what the best method would be, but I'd probably have some code in Update or FixedUpdate that would set a variable to DateTime.Now, then check the time passed since then and when it's X seconds execute your code. There's probably a better method, but that's worked for me in the past.

Link to comment
Share on other sites

7 hours ago, DMagic said:

Also note that coroutines require that you be using a Unity MonoBehaviour, or something that inherits from it.

That's not quite true. You can use any external class that inherits Monobehaviour (which any class interfacing with KSP must do) like this to get access to Coroutines (note: the function is just a shortcut so I don't need to change the syntax)

Edited by Crzyrndm
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...