Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Sonny22 · Feb 18, 2010 at 02:01 PM · pluginwii

WiimoteLib & Unity ?

Hi,

I'd like to know if it should be possible to use WiimoteLib, because I tried unsuccessfully.

I have the Unity standard edition, and WiimoteLib is a C# .NET dll.

I made this script to test :

using UnityEngine; using System.Collections; using WiimoteLib;

public class NewBehaviourScript : MonoBehaviour {

private Wiimote wm;

// Use this for initialization void Start () { wm = new Wiimote(); try { wm.Connect(); } catch ( System.Exception e ) { Debug.Log( e.ToString() ); } wm.SetLEDs( true, true, true, false ); } }

And anyhow it always return me these exceptions :

System.IO.IOException: Invalid handle. at System.IO.FileStream..ctor (IntPtr handle, FileAccess access, Boolean ownsHandle, Int32 bufferSize, Boolean isAsync, Boolean noBuffering) [0x00000] at System.IO.FileStream..ctor (IntPtr handle, FileAccess access, Boolean ownsHandle, Int32 bufferSize, Boolean isAsync) [0x00000] at System.IO.FileStream..ctor (Microsoft.Win32.SafeHandles.SafeFileHandle handle, FileAccess access, Int32 bufferSize, Boolean isAsync) [0x00000] at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (Microsoft.Win32.SafeHandles.SafeFileHandle,System.IO.FileAccess,int,bool) at WiimoteLib.Wiimote.OpenWiimoteDeviceHandle (System.String devicePath) [0x00000] at WiimoteLib.Wiimote.WiimoteFound (System.String devicePath) [0x00000] at WiimoteLib.Wiimote.FindWiimote (WiimoteLib.WiimoteFoundDelegate wiimoteFound) [0x00000] at WiimoteLib.Wiimote.Connect () [0x00000] at NewBehaviourScript.Start () [0x0000b] in D:\Sonny_Unity_Temp\Assets\Test\NewBehaviourScript.cs:14 UnityEngine.Debug:Log(Object) NewBehaviourScript:Start() (at Assets\Test\NewBehaviourScript.cs:18)

Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

8 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Komodo · Mar 05, 2010 at 11:32 AM

Was Win32.SafeHandles the issue? The fact that Unity takes control over HID devices is OK, but for this particular case its just bad. I tried Uniwii, but behavior is still buggy and the API is still limited, which is a pity. Named Pipes doesn't work, so I reckon the only possible solution would be SQLlite, but that is not really elegant. Oh, well if it works it works.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sonny22 · Mar 08, 2010 at 08:09 AM 0
Share

Yeah the issue is actually the SafeHandles, I took notes about SQLite. Thanks for your help

avatar image
1

Answer by tax · Aug 09, 2010 at 07:12 PM

Hi Guys,

I wrote Brian Peek, and his oppinion from the data available in this thread:

""" Reading through that thread, it appears Unity takes over HID devices and there's some kind of incompatibility with SafeHandles. Without a major rewrite of the library, there would be no way to get that to work. It may not be possible at all.

Sorry!

Brian """

Can someone inside Unity confirm this?

Kind regards

Jesper Taxbl

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jonas-echterhoff · Feb 19, 2010 at 09:19 AM

Not a direct answer to your question (never tried the WiimoteLib), but there is the UniWii plugin for accessing the WiiMote in Unity. However, that is a native C++ plugin, so you won't be able to use it in web players.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image StephanK · Feb 19, 2010 at 11:51 AM 0
Share

If it's a c++ plugin he can't use it in his standard edition can he?

avatar image jonas-echterhoff ♦♦ · Feb 19, 2010 at 01:32 PM 0
Share

Ah, correct - I missed that part in the question.

avatar image
0

Answer by StephanK · Feb 19, 2010 at 11:57 AM

Just guessing, but all those [0x00000]'s look like something's not initialized correctly to me. Haven't used or heard of WiimoteLib, but if it's a .net dll it should work.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Sonny22 · Feb 22, 2010 at 08:18 AM

Yep I thought the same thing all these zeros don't look good to me. Yeah it's a .NET dll, I'll try to check if my code is really good. Thks

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Does Unity Wii publishing support any form of native Wii plugin? 1 Answer

Is there any multi-platform Ads solution or plugin? 1 Answer

u3dxt - in-app purchase ONLY 1 Answer

introducing "safe" DLL causes internal compiler error 0 Answers

How do I remove Google Plus from iOS Build only? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges