Skip to content

Migrate to Event Manager and away from Inspector-Assigned Callbacks #78

@parseccentric

Description

@parseccentric

Problem
Inspector-assigned callbacks can make merging code difficult, because *.unity and *.prefab files are not human-readable. They can make navigating call stacks difficult, because Intellisense is not aware of things assigned in the Unity editor.

Proposed Solution

  • See PlayerReferences.cs (which uses KomodoEventManager.cs) as an example of how to avoid inspector-assigned event callbacks.

Workaround

Search the whole repository for the name of the function whose caller you are looking for. Note inspector-assigned callbacks in *.unity and *.prefab files.

More details

These are the inspector-assigned callbacks we currently have in the project:

  • Main scene
    • PlayerSet > WebXRCameraSet > PlayspaceAnchor > Hands
      • handL (and same for handR)
        • KomodoControllerInteraction.cs
          • OnTriggerButtonDown
          • OnTriggerButtonUp
          • OnThumbstickButtonDown
          • OnThumbstickButtonUp
          • OnLeftFlick
          • OnRightFlick
        • Armature
          • Palm
            • F1cSelectLeft
              • EraseLeft
                • TriggerEraseDraw
                  • OnTriggeredOn
                  • OnTriggeredOff
            • F1cTeleportLeft
              • TeleportLeft
                • OnNewTransformUpdate
    • VisibleManagers
      • NetworkManager
        • MainClientUpdater.cs
          • CoordExport
      • Scene
        • SceneManagerExtensions.cs
          • OnNewSceneLoaded
      • HeightCalibration.cs
        • OnStartedCalibration
        • OnCalibrationUpdate
        • OnFinishedCalibration
        • OnBumpHeightUp
        • OnBumpHeightDown

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions