Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Enable package manager integration #66

Closed
MostHated opened this issue Sep 26, 2019 · 12 comments
Closed

[Feature Request] Enable package manager integration #66

MostHated opened this issue Sep 26, 2019 · 12 comments

Comments

@MostHated
Copy link
Contributor

I believe it should be pretty straight forward. Some info on what it takes to make it so people can just download this through the package manager can be found here.

https://gist.github.com/LotteMakesStuff/6e02e0ea303030517a071a1c81eb016e

@SuperPenguin
Copy link
Collaborator

SuperPenguin commented Sep 26, 2019

this branch is for package manager, but I haven't update it yet to latest.
https://github.com/Tayx94/graphy/tree/upm

if you have git installed in your system you can add it via git link, but if you don't have it installed you need to download the upm branch, unzip, and add it from disk (select package.json).

@sergsar
Copy link

sergsar commented Oct 17, 2019

"com.tayx.graphy": "https://github.com/Tayx94/graphy.git#upm"
Works, thanks!
But you don't need any importers. In downloaded package we can use same prefabs as in Assets folder. Just add Assembly definition to your package root. Menu > Create > Assembly Definition

@scscgit
Copy link
Contributor

scscgit commented Dec 13, 2019

Note that the UPM currently doesn't work (it only works within Editor), as a build (e.g. PC) throws the following errors into console:

Library\PackageCache\com.tayx.graphy@1e01e9dce482e1596005460f80d8d4266968356f\Scripts\GraphyMenuItem.cs(7,10): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.tayx.graphy@1e01e9dce482e1596005460f80d8d4266968356f\Scripts\GraphyMenuItem.cs(7,10): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)

Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in <83a73882c51c4602b3d34743827d03e7>:0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <83a73882c51c4602b3d34743827d03e7>:0 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Of course, Graphy works properly if I import it from a master branch directly without using UPM.

@QFSW
Copy link
Collaborator

QFSW commented Dec 13, 2019

Which branch?

@MostHated
Copy link
Contributor Author

I have not looked on my end yet, but last time I had an error like this it was because an assembly definition file was missing a reference. They need to be declared in the assembly definition otherwise they can't be seen.

@scscgit
Copy link
Contributor

scscgit commented Dec 13, 2019

Oh you're probably right, I totally forgot about the Assembly Definition (it got out of my mind as everything seemed to work in the Editor). Could you be more specific about how to set it up? I added Tayx.Graphy into Assembly Definition References, but it still says Assembly for Assembly Definition File 'Assets/graphy.asmdef' will not be compiled, because it has no scripts associated with it.

The upm branch was explicit, as I had to import https://github.com/Tayx94/graphy.git#upm directly using "+" > "Add package from git URL..." in Package Manager in Unity Editor 2019.3.0.

@QFSW
Copy link
Collaborator

QFSW commented Dec 13, 2019 via email

@QFSW
Copy link
Collaborator

QFSW commented Dec 13, 2019 via email

@scscgit
Copy link
Contributor

scscgit commented Dec 13, 2019

I had tried all combinations of Tayx.Graphy and Tayx.Graphy.Editor references and I've also set Platforms to only include Editor, yet the errors are still the same. This UPM feature of Unity sure doesn't seem very user friendly, hopefully there'll be some way to configure the assembly on a package level later on :)

@SuperPenguin
Copy link
Collaborator

I had tried all combinations of Tayx.Graphy and Tayx.Graphy.Editor references and I've also set Platforms to only include Editor, yet the errors are still the same. This UPM feature of Unity sure doesn't seem very user friendly, hopefully there'll be some way to configure the assembly on a package level later on :)

@scscgit
Fixed on #74 , also you might want to use dev-upm branch for 2019.3 version, which on par with latest dev branch and with new input support.

@scscgit
Copy link
Contributor

scscgit commented Dec 14, 2019

Confirmed, thanks, upm works after removing and re-adding the package into project (the reason why it couldn't be updated directly may possibly be because the package.json still contains version 1.5.1).

It would be nice if the UPM approach were also reflected in Readme (I like that the [Graphy] Prefab under dev-upm is now accessible directly without import).

@Tayx94
Copy link
Owner

Tayx94 commented Oct 26, 2020

Merged upm into master.

@Tayx94 Tayx94 closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants