ZorPastaman / UtilityAI

Utility AI for Unity is a good solution for choosing an action based on different utility considerations. Usually, it's used for AI.
MIT License
5 stars 1 forks source link

[Bug] Git url in package.json #1

Closed ivanbelyj closed 2 months ago

ivanbelyj commented 2 months ago

Describe the bug I tried to use this package as a dependency via git url, but there's an error.

[Package Manager Window] Cannot perform upm operation: Unable to add package [com.zor.utility-ai@https://github.com/ZorPastaman/UtilityAI.git]:
  Package com.zor.utility-ai@https://github.com/ZorPastaman/UtilityAI.git has invalid dependencies or related test packages:
    com.zor.simple-blackboard (dependency): Version 'https://github.com/ZorPastaman/Simple-Blackboard.git' is invalid. Expected a 'SemVer' compatible value. [NotFound].
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Seems like the problem is that the package refers to another git package, but Unity doesn't support git urls in package.json (see https://docs.unity3d.com/Manual/upm-git.html#:~:text=Note%3A%20You%20can%E2%80%99t,dependencies%20between%20packages.)

"dependencies": {
    "com.zor.simple-blackboard": "https://github.com/ZorPastaman/Simple-Blackboard.git"
  },

To Reproduce Try to refer this package from another project, adding to manifest.json

"com.zor.utility-ai": "https://github.com/ZorPastaman/UtilityAI.git"

Unity Editor (please complete the following information):

ZorPastaman commented 2 months ago

Hi! Thank you for the report! Yes, it's a limitation of Unity package manager. It can't automatically download git dependencies. But you can add them manually, and they'll work. That's why I still added a git dependency. At least, you may know what dependencies the package has. So, to fix it, just add https://github.com/ZorPastaman/Simple-Blackboard.git as a dependency to your Unity project. You can add it to the project manifest.json like this

  "dependencies": {
    "com.zor.simple-blackboard": "https://github.com/ZorPastaman/Simple-Blackboard.git",
    "com.zor.utility-ai": "https://github.com/ZorPastaman/UtilityAI.git"
  }

Or add it via the Package manager interface.