What is the right way to use game network plugin(for that matter other plugins) with composer library?
Right now, I have multiple scenes, I initialize the game network in first scene and use it in other scenes.
For e.g.,
In scene 1
local gameNetwork = require ("gameNetwork") gameNetwork.init( "google", callback )
In other scenes,
local gameNetwork = require ("gameNetwork") -- Use without initialization again.
Is it the right approach( btw it’s not working)? or Do I have to initialize the game network in every scene? As an alternative approach, Can I initialize the plugin in scene 1 , store it in a variable and retrieve it in a later scene?
Scene 1
local M = require("data") local gameNetwork = require ("gameNetwork") gameNetwork.init( "google", callback ) M.gN = gameNetwork
Scene 2
local M = require("data") local gameNetwork = M.gN -- Use it without initialization.