Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Luci85 · Jun 06, 2012 at 06:16 PM · c#javascript

Migrating data from C# to UnityScript

I'm working on a multitouch project with uniTUIO, unfortunately I wrote the majority of my game in UnityScript. That is a problem because the touch inputs that uniTUIO correctly recognizes only exists in the C# part.
So I'm searching for a way to catch the touches uniTUIO collects from the C# scripts, so that I can use them in my already existing UnityScript scripts.

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

2 Replies

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

Answer by ehnaton · Jun 07, 2012 at 10:48 AM

I've got such a problem. I use an empty gameobject and it's transform parametres to convert data from sharp to java. For your problem you can store toche's info and create with every new touch new object with specific names.

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 Luci85 · Jun 07, 2012 at 10:52 AM 0
Share

That's exactly what I had in $$anonymous$$d. I'm creating a fake touch indicator from the cursor prefab and storing the touch relevant infos inside a unityscript on it.

avatar image
1

Answer by Berenger · Jun 06, 2012 at 06:30 PM

Put them in a folder named Standard Assets.

Comment
Add comment · Show 5 · 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 Luci85 · Jun 06, 2012 at 06:44 PM 0
Share

Could you elaborate this? What should I put into the Standard Assets folder, the uniTUIO C# scripts or my UnityScript scripts?
Edit: I could use Send$$anonymous$$essage for every touch the C# script gets and write a unityScript method that fills them into a touch array inside the unityScript script. No, doesn't work :-/

avatar image Wolfram · Jun 06, 2012 at 07:52 PM 1
Share

The uniTUIO scripts should go in the "Plugins" folder (same effect as "Standard Assets", but more aptly named), so they are compiled first. Haven't tried it (since we don't use JS and also use the older "uniTUIO CE RC1" edition), but the only script you'd need to convert to JS is the BBSimpleTouchableObject, so you can extend this to overload its "handleSingleTouch" etc. You'll probably have to move the .js version of it out of the Plugins folder, or you'll run into the same compilation order problem.

avatar image Luci85 · Jun 06, 2012 at 09:00 PM 0
Share

@Wolfram that could work, but my problem is that iPhoneInput.touches is only filled inside the BBSimpleTouchableObject.cs, if I try to access it from the outside it is empty.

avatar image Wolfram · Jun 06, 2012 at 09:32 PM 0
Share

Hm, sorry, I'm not familiar with the current edition of uniTUIO (I just realized we're using the uniTUIO version before "uniTUIO CE RC1"). IIRC, the current version creates (="fills") iPhoneTouch events in BBIPhoneTouch$$anonymous$$anager.cs. You can either use them directly (as 2D touches), or use BBSimpleTouchableObject which raycasts them into the scene and calls handleSingleTouch etc. if an object is hit. Don't forget to put the touch manager prefab into your scene.

If that still doesn't help you, maybe you should ask your question in the uniTUIO forum: http://www.xtuio.com/index.php/developerblog/support-forums/5-unituio-forum

avatar image Luci85 · Jun 07, 2012 at 09:37 AM 0
Share

I think I got an idea, I'll remodel the crosshair prefab into an touch indicator. That way I can easily get all information I need, the fingerID (the unique ID of the crosshair) and it's position.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

Saving final score and displaying on main menu 1 Answer

null texture passed to GUI.DrawTexture 0 Answers


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