Jump to content

Accessing an instance of KSPAddon?


Recommended Posts

Heya peoples,

I'm trying to get code in a PartModule to access a method inside an instance of KSPAddon. KSP creates an instance of the KSPAddon when the scene starts, but I don't know what this instance would be called or how I would access it. Any ideas how I would do this?

Thanks,

Jim

Link to comment
Share on other sites

You can have a public static MyClass instance member and set it instance = this on Start(). This is what those "instance" and "fetch" members are used for. Then you can do (in your PartModule) MyClass currentInstance = MyClass.instance; and go from there

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...