Following flow is no longer works pc.Application.prototype.addModule = function

I am trying to make make changes to an old playcanvas code base that which make use of following pattern often.

Its seems no longer working. Is there any by chance an update to api caused this issue.

// Expose prototype methods and create a default tween manager on the application
(function() {
    // Add pc.Application#addXYZ method
    pc.Application.prototype.addXYZ = function() {

    var application = pc.Application.getApplication();
    if (application) {
        application.addXYZ(); //Thows undefined

I tested

pc.Application.getApplication() instanceof pc.Application
Looks like returning false.

Please help

use pc.AppBase instead of pc.Application everywhere

1 Like