[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eGoogle packages for Unity are available in two formats: Asset packages (\u003ccode\u003e.unitypackage\u003c/code\u003e) and Unity Package Manager (UPM) packages (\u003ccode\u003e.tgz\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eAsset packages are compatible with Unity 5 and up, while UPM packages require Unity 2018.4 or later.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are provided for installing packages using either \u003ccode\u003e.unitypackage\u003c/code\u003e files, \u003ccode\u003e.tgz\u003c/code\u003e files through various methods (including OpenUPM and manual manifest editing), and migrating between package formats.\u003c/p\u003e\n"],["\u003cp\u003eVersion control considerations are also outlined, recommending adding \u003ccode\u003e.tgz\u003c/code\u003e files to version control (using Git LFS for large files) and manually editing \u003ccode\u003emanifest.json\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eProduct-specific migration instructions, including detailed steps for Firebase and Play Plugins, are linked for further guidance.\u003c/p\u003e\n"]]],["Google packages for Unity come in `.unitypackage` (Asset) or `.tgz` (UPM) formats. `.unitypackage` files are imported via `Assets \u003e Import package`, adding content to the `Assets` directory. `.tgz` files are imported through the Package Manager UI or by editing the `manifest.json` file within the project's `Packages` directory. You can use OpenUPM to import packages such as the Google Play Integrity plugin. You can also switch between UPM and Asset packages by removing the current package and importing the desired package type.\n"],null,["# Install Google packages for Unity\n\nGoogle packages for Unity are distributed in two different formats:\n\n- [Asset packages](#install-unitypackage):\n - Have a `.unitypackage` extension.\n - Install to your project's `Assets` directory.\n - Can be imported in Unity 5 and up.\n - Generally include dependent packages.\n- [Unity Package Manager (UPM) packages](#install-tgz):\n - Have a `.tgz` extension.\n - Install to your project's `Packages` directory.\n - Can be imported in Unity 2018.4 and up.\n - Reference dependent packages which need to be installed separately.\n\nThe [Packages](/unity/packages) page contains the latest `.unitypackage` files\nfor all available packages, and `.tgz` files for some of the packages.\n\nThe [Archive](/unity/archive) page contains `.unitypackage` and `.tgz` files for\nall package versions.\n\nBelow you can find instructions on how to install both types of packages, along\nwith migration instructions to transition from on type to the other.\n\nOnce you're familiar with these installation options, be sure to refer to\nadditional [product-specific instructions](#product-instuctions) for Firebase.\n\nImporting packages using OpenUPM\n--------------------------------\n\nYou can add external packages to your Unity project using the OpenUPM\nregistry. OpenUPM hosts many useful plugins and SDKs, such as the Google Play\nIntegrity plugin, which helps protect your app from fraud and abuse.\n\nHere's how to add, for example, the Google Play Integrity plugin using OpenUPM. \n\n### OpenUPM-CLI\n\nIf you have the [OpenUPM CLI](//github.com/openupm/openupm-cli#installation)\ninstalled you can install the OpenUPM registry with the following command: \n\n openupm add com.google.play.integrity\n\n### OpenUPM\n\n1. Open the [package manager settings](//docs.unity3d.com/Manual/class-PackageManager.html)\n by selecting the Unity menu option\n **Edit \\\u003e Project Settings \\\u003e Package Manager**.\n\n2. Add OpenUPM as a scoped registry to the Package Manager window:\n\n Name: package.openupm.com\n URL: https://package.openupm.com\n Scopes: com.google.external-dependency-manager\n com.google.play.common\n com.google.play.core\n com.google.play.integrity\n\n3. Open the [package manager menu](//docs.unity3d.com/Manual/upm-ui-install.html) by selecting the Unity\n menu option **Window \\\u003e Package Manager**.\n\n4. Set the manager scope drop-down to select **My Registries**.\n\n5. Select the **Google Play Integrity plugin for Unity** package from the\n package list and press **Install**.\n\nImporting Asset packages with `.unitypackage` files\n---------------------------------------------------\n\nImport the `.unitypackage` file by selecting the Unity menu option\n`Assets \u003e Import package \u003e Custom Package` and importing all items.\nThis adds the package contents to your project under the Assets\ndirectory.\n| **Note:** If you have already installed the package using Unity's Package Manager window, uninstall the old version of the package before importing the new one. See [below](/unity/instructions#migrate) for instructions.\n\nImporting UPM packages with `.tgz` files (2018.4+)\n--------------------------------------------------\n\nImport `.tgz` files into your project using one of the following methods: \n\n### manifest.json\n\n1. Create a new folder next to your project's `Packages` folder and name it `GooglePackages`.\n2. Place the `.tgz` files into that folder.\n3. Use a text editor to open `Packages/manifest.json` under your Unity project folder.\n4. Add an entry for each package you want to install, mapping the package name\n to the location on disk, relative to the `Packages/manifest.json` file. Be sure to append `file:` to the `.tgz` file path. For\n example, if you were installing `com.google.firebase.storage` and its\n dependencies, your manifest.json would look like this:\n\n {\n \"dependencies\": {\n \"com.google.external-dependency-manager\": \"file:../GooglePackages/com.google.external-dependency-manager-1.2.164.tgz\",\n \"com.google.firebase.app\": \"file:../GooglePackages/com.google.firebase.app-7.1.0.tgz\",\n \"com.google.firebase.auth\": \"file:../GooglePackages/com.google.firebase.auth-7.1.0.tgz\",\n \"com.google.firebase.storage\": \"file:../GooglePackages/com.google.firebase.storage-7.1.0.tgz\",\n // com.unity package entries...\n }\n }\n\n5. Save the manifest.json file.\n\n6. When Unity regains focus it will reload the manifest.json and import the newly added packages.\n\nSome older versions of Unity do not support `.tgz` files in the manifest.json.\nIn this case, you should:\n\n1. Uncompress the `.tgz` files.\n2. Place the extracted folder in the `GooglePackages` folder.\n3. Edit your manifest.json to use the path to the extracted folder, instead\n of the `.tgz` file, like so:\n\n {\n \"dependencies\": {\n \"com.google.external-dependency-manager\": \"file:../GooglePackages/com.google.external-dependency-manager-1.2.164\",\n \"com.google.firebase.app\": \"file:../GooglePackages/com.google.firebase.app-7.1.0\",\n \"com.google.firebase.auth\": \"file:../GooglePackages/com.google.firebase.auth-7.1.0\",\n \"com.google.firebase.storage\": \"file:../GooglePackages/com.google.firebase.storage-7.1.0\",\n // com.unity package entries...\n }\n }\n\n### Package Manager UI\n\n1. Open Unity's Package Manager window.\n2. Click the `+` icon in the top-left corner of the Package Manager window and\n select `Add package from tarball` to open the file browser.\n\n3. Select the desired tarball in the file browser.\n\nSome older versions of Unity do not support adding tarballs directly.\nIn this case, you will need to:\n\n1. Uncompress the `.tgz` file.\n2. Click the `+` icon in the top-left corner of the Package Manager\n window and select `Add package from disk` to open the file browser.\n\n | **Note:** Unity 2018 places the `+` icon on the bottom-left corner of the package list pane.\n3. Select the extracted folder in the file browser.\n\nMake sure to also import the `.tgz` files for the package's dependencies,\nwhich you can find listed on the [archive page](/unity/archive) under the\ndesired package's section.\n\nFor example, if you were installing `com.google.firebase.storage`, you would\ninstall these `.tgz` files in the following order:\n\n1. External Dependency Manager (`com.google.external-dependency-manager`)\n2. Firebase Core (`com.google.firebase.app`)\n3. Firebase Auth (`com.google.firebase.auth`)\n4. Firebase Storage (`com.google.firebase.storage`)\n\nIf you would prefer to add all the `.tgz` files at once, without worrying\nabout the order, you can follow the instructions in the\n[manifest.json tab](#open-close-manifest).\n| **Note:** If you have already installed the package with a `.unitypackage` file, be sure to delete that version of the package before adding a new one. See [below](/unity/instructions#unitypackage-to-upm) for instructions.\n\n### Version control\n\nIf you're using version control software to manage your project files, we\nrecommend adding the relevant `.tgz` files to version control. You can manually\nedit your project's `manifest.json` (see\n[above instructions](#open-close-manifest)) and reference local `.tgz` files using\nrelative paths.\n\nIf you're using git, we recommend\n[Git Large File Storage (LFS)](https://git-lfs.github.com/)\nfor managing large `.tgz` files.\n\nMigrating from UPM packages to Asset packages\n---------------------------------------------\n\nIn some cases, you might want to switch from using\n[Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html)\nto manage Google packages, to installing packages under the Assets folder.\n\nMake sure all Google packages are removed from Unity Package Manager using\neither of the following methods: \n\n### Package Manager UI\n\n1. Open Unity's Package Manager window.\n2. Select `In Project` in the dropdown on the upper left.\n\n3. Type `com.google` into the search bar to filter for Google packages.\n\n4. Click on each package name then click `Remove`.\n\n### manifest.json\n\n1. Use a text editor to open `Packages/manifest.json` under your Unity project folder.\n2. Check if there are any packages from Google under \"dependencies\". The package name should start with \"com.google\", for instance \"com.google.firebase.app\".\n3. Delete those lines and save the json file.\n4. When Unity regains focus, it will reload the `manifest.json` file and remove the deleted packages.\n\nOnce you have uninstalled those packages from Unity Package Manager, you can\ndownload and import replacement `.unitypackage` files from the [archive\npage](/unity/archive).\n\nMigrating from Asset packages to UPM packages\n---------------------------------------------\n\nIn some cases, you might want to switch from installing products under the\nAssets tree to installing and tracking products with Unity Package Manager.\n\nIf you're not sure which installation method you're using, in the Unity UI,\ncheck whether the desired Google packages appears in the Project tab, under\nAssets.\n\nTo migrate to UPM packages:\n\n1. Make sure all Google package are removed from the Assets folder.\n\n - To uninstall Firebase packages follow [these instructions](https://firebase.google.com/docs/unity/setup-alternative#alternative_migrate_to_upm).\n - To uninstall Play Plugins for Unity, delete the `GooglePlayPlugins` folder under `Assets`.\n2. Install packages using Unity Package Manager, as described\n [above](/unity/instructions#install-tgz).\n\nProduct-specific Migration Instructions\n---------------------------------------\n\nSee [here](https://firebase.google.com/docs/unity/setup-alternative) for Firebase instructions."]]