speps / XInputDotNet

C# wrapper around XInput, works with any Mono or .NET application (eg. Unity3D)
466 stars 96 forks source link

Topic: Use XInputDotNet with the new unitypackage manager #41

Open EloiStree opened 3 years ago

EloiStree commented 3 years ago

Hello.

I just wanted to share with you that if you want to use your tool XInputDotNet with the "new" package manager of Unity. You can structure it like the fork I did based on your project: https://github.com/EloiStree/XInputDotNet

If you don't know what is the package manager, I did a tutorial about it: https://github.com/EloiStree/HelloUnityPackage/wiki

Hope, it helps you.


PS: Thank for your code. If you have a donation link or a Paypal, I would like to send you a beer for your code ;)

speps commented 3 years ago

Hi thanks for the heads up but I'm curious why the .unitypackage didn't work for you?

You can download it there: https://github.com/speps/XInputDotNet/releases/latest

EloiStree commented 3 years ago

Not easy to explain in two lines but...
The reason is that with the new package manager, you can make automatic dependency and specification. Also it means that you can copy past the tool by sharing the link to someone, like this: image image

(And it means that when you update the code in you project it can affect all your other projects.)


It is also useful for small experimentation. Because you just add the tool links you want in the Package/manifest.json And Unity download them all.


If you use the server of Unity you can also have benefic effect of NPM: https://fr.wikipedia.org/wiki/Npm You install a tool and it installs the tools it need that installs the tools it need.


Example, just copy past this in your Package/manifest.json

{
  "dependencies": {
    "be.eloistree.license": "https://github.com/EloiStree/GeneralLicense.git",
    "be.eloistree.quickgitutility": "https://github.com/eloistree/2019_07_21_QuickGitUtility.git",
    "be.eloistree.unitypackagefacilitator": "https://github.com/eloistree/2019_07_21_UnityPackageFacilitator.git",
...Unity Code...
    }
}

And now you have my git and unity package tool install in your project ;) .


For example here is how I use your tool: I have:

https://gitlab.com/eloistree/2020_11_26_XInputToBoolean/-/blob/master/package.json

{                                                                                
  "name": "be.eloistree.xinputtobooleans",                              
  "displayName": "XInput Dot Net To Booleans",                                               
  "description": "Convert the XInput of Speps XInputDotNet to a booleans usable in a booleans state machine.",                                       
  "dependencies":{
    "be.eloistreebasedonspeps.xinputdotnet":"0.0.1",
    "be.eloistree.booleanstatemachines":"0.0.1"
  }       
...
}