private void UpdateResourcesBasedOnFeaturesUsage()
        {
            ApplicationSettings.Features      _supportedFeatures      = m_applicationSettings.SupportedFeatures;
            ApplicationSettings.AddonServices _supportedAddOnServices = m_applicationSettings.SupportedAddonServices;

            UpdateJARFile(_supportedFeatures.UsesAddressBook, Constants.kAddressBookJARName);
            UpdateJARFile(_supportedFeatures.UsesBilling, Constants.kBillingJARName);
            UpdateJARFile(_supportedFeatures.UsesBilling, Constants.kBillingAmazonJARName);
            UpdateJARFile(_supportedFeatures.UsesCloudServices, Constants.kCloudServicesJARName);
            UpdateJARFile(_supportedFeatures.UsesGameServices, Constants.kGameServicesJARName);
            UpdateJARFile(_supportedFeatures.UsesMediaLibrary, Constants.kMediaLibraryJARName);
            UpdateJARFile(_supportedFeatures.UsesNotificationService, Constants.kNotificationJARName);
            UpdateJARFile(_supportedFeatures.UsesNetworkConnectivity, Constants.kNetworkConnectivityJARName);
            UpdateJARFile(_supportedFeatures.UsesSharing, Constants.kSharingJARName);
            UpdateJARFile(_supportedFeatures.UsesTwitter, Constants.kSocialNetworkTwitterJARName);
            UpdateJARFile(_supportedFeatures.UsesWebView, Constants.kWebviewJARName);

            //External Additional Support
            UpdateJARFile(_supportedAddOnServices.UsesSoomlaGrow, Constants.kSoomlaIntegrationJARName);
            UpdateJARFile(_supportedFeatures.UsesNotificationService || NPSettings.Utility.Android.ModifiesApplicationBadge, Constants.kExternalNotificationLibJARName);                    // For Shortcut Badger

#if     (UNITY_5 || UNITY_2017_1_OR_NEWER)
            // Update external libraries/plugins properties
            UpdatePluginPlatforms(_supportedFeatures);
#endif
        }
Beispiel #2
0
        private void UpdateDefineSymbols()
        {
            foreach (BuildTargetGroup _curBuildTargetGroup in buildTargetGroups)
            {
                string[]      _curDefineSymbols = UnityPlayerSettings.GetScriptingDefineSymbolsForGroup(_curBuildTargetGroup).Split(defineSeperators, StringSplitOptions.RemoveEmptyEntries);
                List <string> _newDefineSymbols = new List <string>(_curDefineSymbols);

                // Asset type
#pragma warning disable
                if (kIsFullVersion)
                {
                    if (_newDefineSymbols.Contains(kLiteVersionMacro))
                    {
                        _newDefineSymbols.Remove(kLiteVersionMacro);
                    }
                }
                else
                {
                    if (!_newDefineSymbols.Contains(kLiteVersionMacro))
                    {
                        _newDefineSymbols.Add(kLiteVersionMacro);
                    }
                }
#pragma warning restore

                ApplicationSettings.Features      _supportedFeatures      = m_applicationSettings.SupportedFeatures;
                ApplicationSettings.AddonServices _supportedAddonServices = m_applicationSettings.SupportedAddonServices;

                // Regarding supported features
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesAddressBook, kMacroAddressBook);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesBilling, kMacroBilling);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesCloudServices, kMacroCloudServices);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesGameServices, kMacroGameServices);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesMediaLibrary, kMacroMediaLibrary);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesNetworkConnectivity, kMacroNetworkConnectivity);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesNotificationService, kMacroNotificationService);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesSharing, kMacroSharin);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesTwitter, kMacroTwitter);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesWebView, kMacroWebView);

                // Regarding supported addon features
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedAddonServices.UsesSoomlaGrow, kMacroSoomlaGrowService);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedAddonServices.UsesOneSignal, kMacroOneSignalService);

                // Now save these changes
                UnityPlayerSettings.SetScriptingDefineSymbolsForGroup(_curBuildTargetGroup, string.Join(";", _newDefineSymbols.ToArray()));
            }
        }
Beispiel #3
0
        private void UpdateJARFilesBasedOnFeaturesUsage()
        {
            ApplicationSettings.Features      _supportedFeatures      = m_applicationSettings.SupportedFeatures;
            ApplicationSettings.AddonServices _supportedAddOnServices = m_applicationSettings.SupportedAddonServices;

            UpdateJARFile(_supportedFeatures.UsesAddressBook, Constants.kAddressBookJARName);
            UpdateJARFile(_supportedFeatures.UsesBilling, Constants.kBillingJARName);
            UpdateJARFile(_supportedFeatures.UsesCloudServices, Constants.kCloudServicesJARName);
            UpdateJARFile(_supportedFeatures.UsesGameServices, Constants.kGameServicesJARName);
            UpdateJARFile(_supportedFeatures.UsesMediaLibrary, Constants.kMediaLibraryJARName);
            UpdateJARFile(_supportedFeatures.UsesNotificationService, Constants.kNotificationJARName);
            UpdateJARFile(_supportedFeatures.UsesNetworkConnectivity, Constants.kNetworkConnectivityJARName);
            UpdateJARFile(_supportedFeatures.UsesSharing, Constants.kSharingJARName);
            UpdateJARFile(_supportedFeatures.UsesTwitter, Constants.kSocialNetworkTwitterJARName);
            UpdateJARFile(_supportedFeatures.UsesWebView, Constants.kWebviewJARName);
            UpdateJARFile(_supportedAddOnServices.UsesSoomlaGrow, Constants.kSoomlaIntegrationJARName);
        }
        private void UpdateDefineSymbols()
        {
            ApplicationSettings.Features      _supportedFeatures      = m_applicationSettings.SupportedFeatures;
            ApplicationSettings.AddonServices _supportedAddonServices = m_applicationSettings.SupportedAddonServices;

#if UNITY_ANDROID
            if (_supportedFeatures.UsesCloudServices && !_supportedFeatures.UsesGameServices)
            {
                string _error = "Cloud Services on Android needs Game Services feature to be enabled. Please enable Game Services now.";
                Debug.LogWarning("[Cross Platform Native Plugins] " + _error);
                EditorUtility.DisplayDialog("Cross Platform Native Plugins - Alert", _error, "Ok");
            }

#if USES_BILLING
            if (string.IsNullOrEmpty(NPSettings.Billing.Android.PublicKey))
            {
                string _error = "Please specify Public key in Billing Settings for using Billing feature. You can get this key from Google Play Developer Console -> Your App -> Development & Tools -> Services & API -> Licensing & in-app billing.";
                Debug.LogWarning("[Cross Platform Native Plugins] " + _error);
            }
#endif
#endif

            foreach (BuildTargetGroup _curBuildTargetGroup in buildTargetGroups)
            {
                string[]      _curDefineSymbols = UnityPlayerSettings.GetScriptingDefineSymbolsForGroup(_curBuildTargetGroup).Split(defineSeperators, StringSplitOptions.RemoveEmptyEntries);
                List <string> _newDefineSymbols = new List <string>(_curDefineSymbols);

                // Asset type
#pragma warning disable
                if (kIsFullVersion)
                {
                    if (_newDefineSymbols.Contains(kLiteVersionMacro))
                    {
                        _newDefineSymbols.Remove(kLiteVersionMacro);
                    }
                }
                else
                {
                    if (!_newDefineSymbols.Contains(kLiteVersionMacro))
                    {
                        _newDefineSymbols.Add(kLiteVersionMacro);
                    }
                }
#pragma warning restore

                // Regarding supported features
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesAddressBook, kMacroAddressBook);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesBilling, kMacroBilling);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesCloudServices, kMacroCloudServices);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesGameServices, kMacroGameServices);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesMediaLibrary, kMacroMediaLibrary);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesNetworkConnectivity, kMacroNetworkConnectivity);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesNotificationService, kMacroNotificationService);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesSharing, kMacroSharin);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesTwitter, kMacroTwitter);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedFeatures.UsesWebView, kMacroWebView);

                // Regarding supported addon features
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedAddonServices.UsesSoomlaGrow, kMacroSoomlaGrowService);
                AddOrRemoveFeatureDefineSymbol(_newDefineSymbols, _supportedAddonServices.UsesOneSignal, kMacroOneSignalService);

                // Now save these changes
                UnityPlayerSettings.SetScriptingDefineSymbolsForGroup(_curBuildTargetGroup, string.Join(";", _newDefineSymbols.ToArray()));
            }
        }
Beispiel #5
0
        private static void     GenerateXcodeModFiles()
        {
            string _xcodeModDataCollectionText = File.ReadAllText(kRelativePathXcodeModDataCollectionFile);

            if (_xcodeModDataCollectionText == null)
            {
                return;
            }

            IDictionary _xcodeModDataCollectionDict = JSONUtility.FromJSON(_xcodeModDataCollectionText) as IDictionary;

            ApplicationSettings.Features      _supportedFeatures      = NPSettings.Application.SupportedFeatures;
            ApplicationSettings.AddonServices _supportedAddonServices = NPSettings.Application.SupportedAddonServices;

            // Create mod file related to supported features
            ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyCommon, kRelativePathIOSNativeCodeFolder);

            if (_supportedFeatures.UsesAddressBook)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyAddressBook, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesBilling)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyBilling, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesCloudServices)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyCloudServices, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesGameServices)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyGameServices, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesMediaLibrary)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyMediaLibrary, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesNetworkConnectivity)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyNetworkConnectivity, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesNotificationService)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyNotification, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesSharing)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeySharing, kRelativePathIOSNativeCodeFolder);
            }

            if (_supportedFeatures.UsesTwitter)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyTwitter, kRelativePathIOSNativeCodeFolder);
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyTwitterSDK, kRelativePathNativePluginsSDKFolder);
            }

            if (_supportedFeatures.UsesWebView)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeyWebView, kRelativePathIOSNativeCodeFolder);
            }

            // Create mod file related to supported addon features
            if (_supportedAddonServices.UsesSoomlaGrow)
            {
                ExtractAndSerializeXcodeModInfo(_xcodeModDataCollectionDict, kModKeySoomlaGrow, kRelativePathIOSNativeCodeFolder);
            }
        }