Skip to content

Exception in SingularityUI in debug mode #15

Description

@JonnyOThan

When using the debug mode of unity, SingularityUI throws an exception from its constructor:

[LOG 13:33:33.698] [AddonLoader]: Instantiating addon 'SingularityUI' from assembly 'Singularity'
[EXC 13:33:33.699] UnityException: RandomRangeInt is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'SingularityUI' on game object 'SingularityUI'.
See "Script Serialization" page in the Unity Manual for further details.
    UnityEngine.Random.Range (System.Int32 min, System.Int32 max) (at <12e76cd50cc64cf19e759e981cb725af>:0)
    Singularity.SingularityUI..ctor () (at <9979393ee651429dad328b68f1d0ef0e>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.GameObject:AddComponent(Type)
    AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
    AddonLoader:StartAddons(Startup)
    AddonLoader:OnLevelLoaded(GameScenes)
    AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
    UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

This likely isn't a big deal outside of debug mode, but it does make debug mode harder to use when singularity is installed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions