I want to Change some Parts in Text mesh Pro in Unity And Use Some Function from Text Mesh Pro in another Script. Like the Private Function when I Change it to Public it Revert Back to private and do not let me change it. Is there Any Way to do it. Thanks.
-
scripts normally do not change by themselves – BugFinder Aug 10 '23 at 08:00
-
Why do you want to change the visibility of the TMP functions ? – TheNomad Aug 11 '23 at 18:37
1 Answers
Packages installed via the PackageManager
/ manifest.json
via UPM or Git (ones that are not on the local disk) get istalled into the Library/PackageCache
.
They are read-only since the PackageManager
will always restore them to the requested state (version) pulled from UPM.
Any change is immediately restored to the state from the cache and the cache itself is restored to whatever the official UPM state is.
In order to be able to modify a package you have to convert it eiher into an Embedded Package specifically by Copying a Unity package from the cache:
The most reliable way to find your package’s folder in the cache is to locate the installed version directly in the Unity Editor:
Open the Project window by opening the Window menu and selecting General > Project.
From the Project window, find the installed package you want to embed.
Right-click the folder of the selected package and select Show in Explorer (Windows) or Reveal in Finder (macOS). That package’s folder opens directly in a file browser and uses the
<package-name>@<package-version>
naming convention.Note: If the package you want to embed isn’t in your project, you can get it directly from your project’s package cache (
<project>/Library/PackageCache
) by using your file browser or command line and navigating to the correct folder. However, it’s more reliable to let the Editor find it for you, because in addition to locating packages in the project cache, it also locates packages that are installed from a local folder or tarball, and packages that are already embedded.Copy the package folder and paste it directly into your project’s
Packages
folder. Don’t put it inside theAssets
folder, because the Package Manager does not scan that folder for packages.Remove the
@<package-version>
portion of the folder name.Add the newly embedded package to source control if your project is already under source control.
or the alternative would be to go for a Local Package which can be anywhere on your local disk. Basically doing the same as above but not copying into your project's Packages
folder but anywhere else and then referencing accordingly via the PackageManager or the manifest.json
Have in mind to comply with the Licenses and legal notes when modifying and pushing packages public anywhere!

- 83,094
- 9
- 75
- 115