Exemple #1
0
        public static bool GetScriptsHaveMouseEvents(string path)
        {
            AssemblyReferenceChecker assemblyReferenceChecker = new AssemblyReferenceChecker();

            assemblyReferenceChecker.CollectReferences(path, true, 0f, true);
            return(assemblyReferenceChecker.HasMouseEvent);
        }
Exemple #2
0
        public static bool GetScriptsHaveMouseEvents(string path)
        {
            AssemblyReferenceChecker checker = new AssemblyReferenceChecker();

            checker.CollectReferences(path, true, 0f, true);
            return(checker.HasDefinedMethod("OnMouse"));
        }
 internal static void PostProcess(BuildTarget target, string stagingAreaDataUpperCase, string stagingArea, string stagingAreaDataManaged, string playerPackage, string installPath, string companyName, string productName, BuildOptions options)
 {
     bool flag = (options & BuildOptions.AutoRunPlayer) != BuildOptions.CompressTextures;
     bool developmentPlayer = (options & BuildOptions.Development) != BuildOptions.CompressTextures;
     float numSteps = !flag ? ((float) 2) : ((float) 5);
     progress.Reset(numSteps);
     if (PlayerSettings.Tizen.deploymentTargetType == 2)
     {
         flag = false;
     }
     Regex regex = new Regex("[^a-zA-Z_-]");
     string normalizedProductName = regex.Replace(productName, "").ToLower();
     string str2 = Path.Combine(playerPackage, "assets");
     if (!IsValidTizenBundleIdentifier(PlayerSettings.bundleIdentifier))
     {
         string message = "Please set the Bundle Identifier in the Player Settings.";
         message = (message + " The value must follow the convention 'com.YourCompanyName.YourProductName'") + " and can contain alphanumeric characters and underscore." + "\nEach segment must not start with a numeric character or underscore.";
         Selection.activeObject = Unsupported.GetSerializedAssetInterfaceSingleton("PlayerSettings");
         TizenUtilities.ShowErrDlgAndThrow("Bundle Identifier has not been set up correctly", message);
     }
     TizenUtilities.PrepareToolPaths();
     TizenUtilities.ValidateSigningProfile(stagingArea);
     if (flag)
     {
         TizenUtilities.AssertAnyDeviceReady(new Command.WaitingForProcessToExit(new Progress("Tizen Device Detection", "Detecting attached devices", progress.Get()).Show));
     }
     Directory.CreateDirectory(Path.Combine(stagingArea, "lib"));
     Directory.CreateDirectory(Path.Combine(stagingArea, "res"));
     Directory.CreateDirectory(Path.Combine(stagingArea, "setting"));
     string path = Path.Combine(stagingArea, "shared");
     Directory.CreateDirectory(path);
     string str8 = Path.Combine(path, "res");
     Directory.CreateDirectory(str8);
     string destDirName = Path.Combine(str8, "data");
     string dst = Path.Combine(str8, "app_icon.png");
     FileUtil.MoveFileIfExists(Path.Combine(stagingArea, "app_icon.png"), dst);
     if (!PlayerSettings.SplashScreen.show)
     {
         string str11 = Path.Combine(str8, "app_splash.png");
         FileUtil.MoveFileIfExists(Path.Combine(stagingArea, "app_splash.png"), str11);
         if (!File.Exists(str11))
         {
             FileUtil.CopyFileOrDirectory(playerPackage + "/assets/splash.png", str11);
         }
     }
     Directory.CreateDirectory(Path.Combine(path, "trusted"));
     Directory.Move(stagingAreaDataUpperCase, destDirName + "2");
     Directory.Move(destDirName + "2", destDirName);
     if (!File.Exists(dst))
     {
         FileUtil.CopyFileOrDirectory(str2 + "/icon.png", dst);
     }
     Directory.CreateDirectory(Path.Combine(destDirName, "Managed/mono/2.0"));
     FileUtil.CopyFileOrDirectory(playerPackage + "/Data/Resources/unity default resources", destDirName + "/unity default resources");
     Directory.CreateDirectory(Path.Combine(stagingArea, "data"));
     string str14 = Path.Combine(stagingArea, "lib");
     Directory.CreateDirectory(str14);
     foreach (PluginImporter importer in PluginImporter.GetImporters(target))
     {
         string fileName = Path.GetFileName(importer.assetPath);
         FileUtil.UnityFileCopy(importer.assetPath, Path.Combine(str14, fileName));
     }
     if (Directory.Exists("Assets/StreamingAssets"))
     {
         FileUtil.CopyDirectoryRecursive("Assets/StreamingAssets", Path.Combine(destDirName, "Raw"), true, true);
     }
     AssemblyReferenceChecker checker = new AssemblyReferenceChecker();
     bool collectMethods = true;
     bool ignoreSystemDlls = true;
     string[] components = new string[] { destDirName, "Managed" };
     string str16 = Paths.Combine(components);
     checker.CollectReferences(str16, collectMethods, 0f, ignoreSystemDlls);
     string bundleIdentifier = PlayerSettings.bundleIdentifier;
     CreateManifest(Path.Combine(stagingArea, "tizen-manifest.xml"), companyName, productName, normalizedProductName, bundleIdentifier, checker);
     CreateProject(stagingArea);
     PackageTargets(PlayerSettings.Tizen.deploymentTargetType, installPath, playerPackage, stagingArea, developmentPlayer, normalizedProductName);
     if (flag)
     {
         progress.Step("Installing", EditorGUIUtility.TextContent("Installing application on device...").text);
         if (TizenUtilities.InstallTpkPackage(bundleIdentifier + "-" + GetValidVersionString() + "-arm.tpk"))
         {
             if (developmentPlayer)
             {
                 progress.Step("Port Forwarding", EditorGUIUtility.TextContent("Setting up profiler tunnel...").text);
                 TizenUtilities.ForwardPort(ProfilerDriver.directConnectionPort, "55000");
             }
             progress.Step("Launching", EditorGUIUtility.TextContent("Launching application on device...").text);
             TizenUtilities.LaunchTpkPackage(bundleIdentifier, stagingArea);
         }
     }
 }
 public void PostProcess(BuildPostProcessArgs args)
 {
     base.m_PostProcessArgs = args;
     AssemblyReferenceChecker checker = new AssemblyReferenceChecker();
     checker.CollectReferences(args.stagingAreaDataManaged, false, 0f, true);
     bool flag = !string.IsNullOrEmpty(checker.WhoReferencesClass("UnityEngine.SocialPlatforms.GameCenter.GameCenterPlatform", true));
     this.SaveEditorOnlyPlayerSettingsToPlist();
     base.PostProcess();
     if (flag)
     {
         if (Application.platform != RuntimePlatform.OSXEditor)
         {
             UnityEngine.Debug.LogWarning("OS X Standalone players with GameCenter support need to be built on an OS X machine in order to pass Mac App Store validation.");
         }
         else
         {
             Console.WriteLine("Adding GameKit linkage to OS X binary.");
             ProcessStartInfo info2 = new ProcessStartInfo {
                 FileName = Path.Combine(BuildPipeline.GetPlaybackEngineDirectory(args.target, args.options), "optool")
             };
             string[] textArray1 = new string[] { "install -c weak -p /System/Library/Frameworks/GameKit.framework/Versions/A/GameKit -t \"", this.m_PostProcessArgs.installPath, "/Contents/MacOS/", this.InstallNameWithoutExtension, "\"" };
             info2.Arguments = string.Concat(textArray1);
             info2.CreateNoWindow = true;
             ProcessStartInfo si = info2;
             Program program = new Program(si);
             program.Start();
             while (!program.WaitForExit(100))
             {
             }
             if (program.ExitCode != 0)
             {
                 UnityEngine.Debug.LogError("Running optool to link GameKit failed\n" + si.FileName + " " + si.Arguments + "\n" + program.GetAllOutput());
             }
             program.Dispose();
         }
     }
 }
		public static bool GetScriptsHaveMouseEvents(string path)
		{
			AssemblyReferenceChecker assemblyReferenceChecker = new AssemblyReferenceChecker();
			assemblyReferenceChecker.CollectReferences(path, true, 0f, true);
			return assemblyReferenceChecker.HasDefinedMethod("OnMouse");
		}
        private string PatchManifest(PostProcessorContext context, string manifest)
        {
            BuildTarget platform = context.Get<BuildTarget>("BuildTarget");
            string[] components = new string[] { this._stagingArea, "assets", "bin" };
            string str = Paths.Combine(components);
            AndroidManifest manifestXML = new AndroidManifest(manifest);
            string location = this.PreferredInstallLocationAsString();
            manifestXML.SetInstallLocation(location);
            manifestXML.SetDebuggable(this._developmentPlayer || Unsupported.IsDeveloperBuild());
            int minSdkVersion = (int) PlayerSettings.Android.minSdkVersion;
            string glEsVersion = "0x00020000";
            GraphicsDeviceType[] graphicsAPIs = PlayerSettings.GetGraphicsAPIs(platform);
            if (Enumerable.Contains<GraphicsDeviceType>(graphicsAPIs, GraphicsDeviceType.OpenGLES3) && (minSdkVersion >= 0x12))
            {
                glEsVersion = "0x00030000";
            }
            if (Enumerable.Contains<GraphicsDeviceType>(graphicsAPIs, GraphicsDeviceType.OpenGLES2))
            {
                glEsVersion = "0x00020000";
            }
            if ((glEsVersion == "0x00030000") && (PlayerSettings.openGLRequireES31 || PlayerSettings.openGLRequireES31AEP))
            {
                glEsVersion = "0x00030001";
            }
            manifestXML.AddGLESVersion(glEsVersion);
            if ((glEsVersion == "0x00030001") && PlayerSettings.openGLRequireES31AEP)
            {
                manifestXML.AddUsesFeature("android.hardware.opengles.aep", true);
            }
            if (EditorUserBuildSettings.androidBuildSubtarget != MobileTextureSubtarget.Generic)
            {
                this.CreateSupportsTextureElem(manifestXML, EditorUserBuildSettings.androidBuildSubtarget);
            }
            HashSet<string> set = new HashSet<string>(this.GetActivitiesWithMetadata(manifestXML, "unityplayer.UnityActivity", "true"));
            string[] other = new string[] { "com.unity3d.player.UnityPlayerNativeActivity", "com.unity3d.player.UnityPlayerActivity", "com.unity3d.player.UnityPlayerProxyActivity" };
            set.UnionWith(other);
            string orientationAttr = this.GetOrientationAttr();
            bool flag = false;
            foreach (string str5 in set)
            {
                flag = manifestXML.SetOrientation(str5, orientationAttr) || flag;
                flag = manifestXML.SetLaunchMode(str5, "singleTask") || flag;
                flag = manifestXML.SetConfigChanges(str5, AndroidManifest.AndroidConfigChanges) || flag;
            }
            if (!flag)
            {
                Debug.LogWarning(string.Format("Unable to find unity activity in manifest. You need to make sure orientation attribute is set to {0} manually.", orientationAttr));
            }
            manifestXML.SetApplicationFlag("isGame", PlayerSettings.Android.androidIsGame);
            if (PlayerSettings.Android.androidBannerEnabled)
            {
                manifestXML.SetApplicationBanner("@drawable/app_banner");
            }
            if ((PlayerSettings.Android.androidTVCompatibility && !manifestXML.HasLeanbackLauncherActivity()) && !manifestXML.AddLeanbackLauncherActivity())
            {
                Debug.LogWarning("No activity with LEANBACK_LAUNCHER or LAUNCHER categories found.\nThe build may not be compatible with Android TV. Specify an activity with LEANBACK_LAUNCHER or LAUNCHER category in the manifest, or disable Android TV compatibility in Player Settings.");
            }
            switch (PlayerSettings.Android.androidGamepadSupportLevel)
            {
                case AndroidGamepadSupportLevel.SupportsGamepad:
                    manifestXML.AddUsesFeature("android.hardware.gamepad", false);
                    break;

                case AndroidGamepadSupportLevel.RequiresGamepad:
                    manifestXML.AddUsesFeature("android.hardware.gamepad", true);
                    break;
            }
            if (PlayerSettings.virtualRealitySupported)
            {
                manifestXML.OverrideTheme("@android:style/Theme.Black.NoTitleBar.Fullscreen");
                int num2 = context.Get<int>("GearVRMinSdkVersion");
                if (PlayerSettings.Android.minSdkVersion < num2)
                {
                    Debug.LogWarning("GearVR requires Minimum API Level of 19");
                }
            }
            AssemblyReferenceChecker checker = new AssemblyReferenceChecker();
            bool collectMethods = true;
            bool ignoreSystemDlls = true;
            string[] textArray3 = new string[] { str, "Data", "Managed" };
            string path = Paths.Combine(textArray3);
            checker.CollectReferences(path, collectMethods, 0f, ignoreSystemDlls);
            this.SetPermissionAttributes(context, manifestXML, checker);
            manifestXML.StripUnityLibEntryForNativeActitivy();
            manifestXML.SaveAs(manifest);
            return manifestXML.packageName;
        }