예제 #1
0
        internal static void EnableAdModule(GameObject mainPrefab)
        {
            EM_EditorUtil.AddModuleToPrefab <AdManager>(mainPrefab);

            // Check ad network plugins' availability and define appropriate scripting symbols.
            List <string> symbols      = new List <string>();
            bool          isAdMobAvail = EM_ExternalPluginManager.IsAdMobAvail();

            if (isAdMobAvail)
            {
                symbols.Add(EM_ScriptingSymbols.AdMob);
            }

            bool isChartboostAvail = EM_ExternalPluginManager.IsChartboostAvail();

            if (isChartboostAvail)
            {
                symbols.Add(EM_ScriptingSymbols.Chartboost);
            }

            bool isHeyzapAvail = EM_ExternalPluginManager.IsHeyzapAvail();

            if (isHeyzapAvail)
            {
                symbols.Add(EM_ScriptingSymbols.Heyzap);
            }

            GlobalDefineManager.SDS_AddDefines(symbols.ToArray(), EditorUserBuildSettings.selectedBuildTargetGroup);
        }
예제 #2
0
        internal static void EnableIAPModule(GameObject mainPrefab)
        {
            EM_EditorUtil.AddModuleToPrefab <IAPManager>(mainPrefab);

            // Check if UnityIAP is enable and act accordingly.
            bool isUnityIAPAvail = EM_ExternalPluginManager.IsUnityIAPAvail();

            if (isUnityIAPAvail)
            {
                // Generate dummy AppleTangle and GoogleTangle classes if they don't exist.
                // Note that AppleTangle and GooglePlayTangle only get compiled on following platforms,
                // therefore the compilational condition is needed, otherwise the code will repeat forever.
                #if UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_TVOS
                if (!EM_EditorUtil.AppleTangleClassExists())
                {
                    EM_EditorUtil.GenerateDummyAppleTangleClass();
                }

                if (!EM_EditorUtil.GooglePlayTangleClassExists())
                {
                    EM_EditorUtil.GenerateDummyGooglePlayTangleClass();
                }
                #endif

                GlobalDefineManager.SDS_AddDefine(EM_ScriptingSymbols.UnityIAP, EditorUserBuildSettings.selectedBuildTargetGroup);
            }
        }
예제 #3
0
        internal static void EnableNotificationModule(GameObject mainPrefab)
        {
            EM_EditorUtil.AddModuleToPrefab <NotificationManager>(mainPrefab);

            // Check if OneSignal is available.
            bool isOneSignalAvail = EM_ExternalPluginManager.IsOneSignalAvail();

            if (isOneSignalAvail)
            {
                GlobalDefineManager.SDS_AddDefine(EM_ScriptingSymbols.OneSignal, EditorUserBuildSettings.selectedBuildTargetGroup);
            }
        }
예제 #4
0
        internal static void EnableGameServiceModule(GameObject mainPrefab)
        {
            EM_EditorUtil.AddModuleToPrefab <GameServiceManager>(mainPrefab);

            // Check if Google Play Games plugin is available.
            bool isGPGSAvail = EM_ExternalPluginManager.IsGPGSAvail();

            if (isGPGSAvail)
            {
                // We won't use Google Play Game Services on iOS, so we'll define NO_GPGS symbol to disable it.
                GlobalDefineManager.SDS_AddDefine(EM_ScriptingSymbols.NoGooglePlayGames, BuildTargetGroup.iOS);

                // Define EM_GPGS symbol on Android platform
                GlobalDefineManager.SDS_AddDefine(EM_ScriptingSymbols.GooglePlayGames, BuildTargetGroup.Android);
            }
        }
예제 #5
0
        internal static void EnableAdModule(GameObject mainPrefab)
        {
            EM_EditorUtil.AddModuleToPrefab <Advertising>(mainPrefab);

            // Check ad network plugins' availability and define appropriate scripting symbols.
            // Note that UnityAds symbol is added automatically by Unity engine.
            List <string> symbols = new List <string>();

            // AdColony
            bool isAdColonyAvail = EM_ExternalPluginManager.IsAdColonyAvail();

            if (isAdColonyAvail)
            {
                symbols.Add(EM_ScriptingSymbols.AdColony);
            }

            // AdMob
            bool isAdMobAvail = EM_ExternalPluginManager.IsAdMobAvail();

            if (isAdMobAvail)
            {
                symbols.Add(EM_ScriptingSymbols.AdMob);
            }

            // Chartboost
            bool isChartboostAvail = EM_ExternalPluginManager.IsChartboostAvail();

            if (isChartboostAvail)
            {
                symbols.Add(EM_ScriptingSymbols.Chartboost);
            }

            // Heyzap
            bool isHeyzapAvail = EM_ExternalPluginManager.IsHeyzapAvail();

            if (isHeyzapAvail)
            {
                symbols.Add(EM_ScriptingSymbols.Heyzap);
            }

            GlobalDefineManager.SDS_AddDefines(symbols.ToArray(), EditorUserBuildSettings.selectedBuildTargetGroup);
        }