Skip to content

[Developers] Improve Consistency of Native_OnX, BP_OnX, and OnX Naming Conventions #50

Description

@GuyPaddock

As a Developer, I'd like it if there was more consistency and/or documentation around when methods in the framework are named Native_OnX, BP_OnX, or OnX so that I know what to expect when I call these methods and can adhere to the convention in newer code.

Background Information

  • I believe these prefixes were adopted to avoid clashing with delegate events named OnX (e.g., OnCharacterAdded). This may no longer be necessary now that we have implemented the event emitter pattern for delegates, since the delegate properties now live in separate concrete UClasses.
  • Native_OnX (e.g., Native_OnCharacterAdded) is always used for the native implementation of an event, while BP_OnX (e.g., BP_OnCharacterAdded) is always used for a BlueprintImplementable or BlueprintNative event.
  • Given the above, I believe that in C++ code, native components tend to notify each other via Native_OnX calls that then dispatch calls to the BP_OnX variant.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions