Jump to content

EdTools Update Help


Recommended Posts

Hi all, considering DEADBEEF hasn't posted since the forum crash a few of us have been working on updating his mods to 0.20. Subassembly loader and dynamic warp were relatively easy to update.

Edtools on the other hand...

From what I can tell every time an Input.GetKeyDown() returns true the if statement runs four times consistently. From what I know of unity Input.GetKeyDown() should only be true on the first frame the keyDown is detected and thus should only happen once for every key press.

Also, I just updated my references to the ones with .20 and visual studio is now complaining that " 'PartLoader' does not contain a definition for 'goToSceneAfterLoad' " when I can see it in the object browser

Any help will be greatly appreciated. :)

Link to comment
Share on other sites

Hi,

I fixed this and posted a link to it over in the 0.20 compatibility thread. The issue is that the loader was instantiating the EdTools class four times. So it's not that GetKeyDown() was running in four frames - it was running once in the frame when the key was pressed, like it's supposed to - it was just doing so for each instance of EdTools.

I don't know anything about UnityEngine or how module loading is supposed to work or what the calls to DontDestroyOnLoad are meant to do, so I wasn't keen to change them - instead, what I did was make the EdTools class instantiate as a singleton by caching the first instantiation as a global static variable. It works for me, at least until someone smarter comes along.

Link to comment
Share on other sites

Here ya go, a copy of ghjm's post :) - hope he doesn't kill me for posting it here...

Here is an updated version of DEADBEEF's EdTools that works with 0.20, minus the CTRL key temporary clipping removal, and the command-line ship loading, neither of which I could figure out how to get to work in 0.20 in the amount of time I was willing to spend on it.

EdTools020.zip

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...