Jump to content

[KSPAddon(Startup


Recommended Posts

Probably the least worst pattern I've seen is to derive multiple scene-specific shell classes from your main MonoBehaviour class and then tag each one with the appropriate attribute. E.g., that's what KAC does:

https://github.com/TriggerAu/KerbalAlarmClock/blob/c5f813cd8a4e7a4ea5afc74b65f74a702188fbfb/KerbalAlarmClock/KerbalAlarmClock.cs#L31-L55

Not ideal, but it gets the job done without too much fuss.

Edited by HebaruSan
Link to comment
Share on other sites

12 minutes ago, HebaruSan said:

Probably the least worst pattern I've seen is to derive multiple scene-specific shell classes from your main MonoBehaviour class and then tag each one with the appropriate attribute. E.g., that's what KAC does:

https://github.com/TriggerAu/KerbalAlarmClock/blob/c5f813cd8a4e7a4ea5afc74b65f74a702188fbfb/KerbalAlarmClock/KerbalAlarmClock.cs#L31-L55

Not ideal, but it gets the job done without too much fuss.

I considered doing it that way, but I was worried if Unity wouldn't fire the inherited methods.

thanks!

Link to comment
Share on other sites

1 hour ago, Xyphos said:

I considered doing it that way, but I was worried if Unity wouldn't fire the inherited methods.

Debug.Log to the rescue if you can't use a debugger.  Try it out and see what happens (then document it for the rest of us :) ).

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