Guest Posted December 18, 2015 Share Posted December 18, 2015 (edited) 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 December 18, 2015 by Guest Link to comment Share on other sites More sharing options...
magico13 Posted December 18, 2015 Share Posted December 18, 2015 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 More sharing options...
DMagic Posted December 18, 2015 Share Posted December 18, 2015 Also note that coroutines require that you be using a Unity MonoBehaviour, or something that inherits from it. Link to comment Share on other sites More sharing options...
Crzyrndm Posted December 18, 2015 Share Posted December 18, 2015 (edited) 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 December 19, 2015 by Crzyrndm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now