/// <summary> /// Initialise Unibill. /// Before calling this method, ensure you have subscribed to onBillerReady to /// ensure you receive Unibill's initialisation response. /// This method should be called once as soon as your Application launches. /// </summary> public static void Initialise() { if (Unibiller.biller == null) { var mgr = new RemoteConfigManager(new UnityResourceLoader(), new UnityPlayerPrefsStorage(), new UnityLogger(), UnityEngine.Application.platform); var config = mgr.Config; _internal_doInitialise(new BillerFactory(new UnityResourceLoader(), new UnityLogger(), new UnityPlayerPrefsStorage(), new RawBillingPlatformProvider(config), config).instantiate()); } }
/// <summary> /// Initialise Unibill. /// Before calling this method, ensure you have subscribed to onBillerReady to /// ensure you receive Unibill's initialisation response. /// This method should be called once as soon as your Application launches. /// /// runtimeProducts is an optional parameter that allows you to tell Unibill about additional /// products to those defined in your inventory. /// /// You can opt to use runtimeProducts exclusively if you choose. /// </summary> public static void Initialise(List <ProductDefinition> runtimeProducts = null) { if (Unibiller.biller == null) { var mgr = new RemoteConfigManager(new UnityResourceLoader(), new UnityPlayerPrefsStorage(), new UnityLogger(), UnityEngine.Application.platform, runtimeProducts); var config = mgr.Config; var o = new GameObject(); UnityEngine.Object.DontDestroyOnLoad(o); var util = o.AddComponent <UnityUtil> (); var factory = new BillerFactory(new UnityResourceLoader(), new UnityLogger(), new UnityPlayerPrefsStorage(), new RawBillingPlatformProvider(config), config, util); Unibiller.biller = factory.instantiate(); _internal_hook_events(Unibiller.biller, factory); } biller.Initialise(); }
void Start() { countOfVariables = GameObject.Find("countOfVariables").GetComponent <Text>(); remoteConfigManager = new RemoteConfigManager(); remoteConfigManager.GetInstance(); }