Page 1 of 1

Can I use assembly definition file?

Posted: Wed Nov 29, 2023 9:22 am
by elda27
I made an assembly definition to test my code.
But I ran into an error with the using PixelCrushers.DialogueSystem part, and I can't seem to find the right assembly definition for it.
Any ideas on how to fix this?

Code: Select all

{
    "name": "PackageName",
    "rootNamespace": "",
    "references": [
        "Unity.TextMeshPro",
        "Unity.VisualScripting.Core",
        "Zenject"
    ],
    "includePlatforms": [],
    "excludePlatforms": [],
    "allowUnsafeCode": false,
    "overrideReferences": true,
    "precompiledReferences": [
    ],
    "autoReferenced": true,
    "defineConstraints": [],
    "versionDefines": [],
    "noEngineReferences": false
}

Re: Can I use assembly definition file?

Posted: Wed Nov 29, 2023 1:40 pm
by Tony Li
Hi,

Import Plugins / Pixel Crushers / Dialogue System / Scripts / DialogueSystemAssemblyDefinitions.unitypackage.

Some devs don't use asmdefs, so they're provided as a separate package.

Re: Can I use assembly definition file?

Posted: Thu Nov 30, 2023 5:57 am
by elda27
Thanks!
I've obtained the assembly definition, but I've run into a new error.
The following is one of the specific error messages:

Assets\Plugins\Pixel Crushers\Common\Scripts\UI\SetLocalizedFont.cs(27,17): error CS0246: The type or namespace name 'TMPro' could not be found

I've examined its script and noticed that it lacks a using TMPro directive.
I understand that this program works correctly when used without an assembly definition.
It seems that I might need to make additional settings in the assembly definition in this case.
Here's the content of my assembly definition file.

Code: Select all

{
    "name": "Amber",
    "rootNamespace": "",
    "references": [
        "Unity.TextMeshPro",
        "Unity.VisualScripting.Core",
        "Zenject",
        "DialogueSystem"
    ],
    "includePlatforms": [],
    "excludePlatforms": [],
    "allowUnsafeCode": false,
    "overrideReferences": true,
    "precompiledReferences": [
        "DOTween.dll"
    ],
    "autoReferenced": true,
    "defineConstraints": [],
    "versionDefines": [],
    "noEngineReferences": false
}

Re: Can I use assembly definition file?

Posted: Thu Nov 30, 2023 8:26 am
by elda27
I have found a solution.

https://www.pixelcrushers.com/phpbb/vie ... php?t=6379

I added Unity.TextMeshPro to both PixelCrushes and DialogueSystem.
Thank you very much.

Re: Can I use assembly definition file?

Posted: Thu Nov 30, 2023 8:38 am
by Tony Li
Hi,

Yes, that's the solution. Not every project uses TextMesh Pro, so the TextMesh Pro asmdef isn't added to the Dialogue System asmdefs. If you've imported the Dialogue System asmdefs and you're using any packages such as TextMesh Pro or Cinemachine and have turned on support for them in the Welcome Window, you should add references to their asmdefs like you did.