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 JakeM · Apr 12, 2012 at 09:27 AM · webplayerunityiphoneunityandroid

Use same code for iOS, Android and Web Player

Hello

Is it possible to write one Unity3D application that will work across Unity Web Player, Android and iOS?

I am thinking that maybe I could write my Application in C# and for the Unity Web Player I insert the C# code inside a script element. Given I have the iOS and Android extensions is this possible to do this or will I have to write 3 different applications? Can I write a Unity3D application for iOS all in C#? Can I write a Unity3D application for Android all in C#?

Are there plans in the future to deploy Unity Web App to Safari-iOS and Android-Web-Browser?

Could I really get my one application codebase to work across all 3 platforms?

For the Web Player only I would deploy it like so...

 <html>
     <head>
         <script language="C#" type="text/C#">
         // my C# code that works for iOS, Android and Web Player
         </script>
     </head>
     <body>
         <center>
           <object id="UnityObject" width="600" height="450" classid="clsid:...">
         </center>
     </body>
 </html>

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · Apr 12, 2012 at 09:31 AM

Yeah, it's possible to use the same code on all platforms, but you may run into some problems depending on what you are doing, as each platform has its own challenges. Web player can't read/write local files. Mobile probably going to use a touch-based UI. But most of the code is portable. I doubt they will put a mobile web player on either phone, as they already have native players for those devices. Unless they ever export to HTML5. But for now, you'd just build as web, or iOS, or Android, and deploy as required by each platform.

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 JakeM · Apr 12, 2012 at 09:43 AM 0
Share

@Dave A. thanks for the quick reply :) What do you mean that most of the code is portable? On Web Player can I read files on the domain server or from over the internet(a different url to the current domain)?

avatar image yezzer · Apr 12, 2012 at 10:07 AM 0
Share

@jake$$anonymous$$: you can read files using the WWW class: http://unity3d.com/support/documentation/ScriptReference/WWW.html - if it's from a different domain, it'll need to have a crossdomain.xml policy file.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Adding animations to a a bought FBX 0 Answers

Cloud recognition in Vuforia 0 Answers

3d UI Using plane For all screens 0 Answers

Unity iPhone app size is too big 1 Answer

Camera Rotation Probleme with iPhone 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