Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
parseccentric opened this issue Sep 29, 2021 · 1 comment

Comments

@parseccentric
Copy link
Contributor

parseccentric commented Sep 29, 2021

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
@parseccentric
Copy link
Contributor Author

@Barasakar Here is some info on function callbacks that you might find helpful for understanding who is calling some teleportation functions. I wrote it like a task, but it's more of an FYI for now. I might take on this refactoring myself -- I am not sure yet.

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

No branches or pull requests

1 participant