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 Jacob 1 · Feb 21, 2011 at 06:18 PM · runtimeinterpret

Interpreted Scripting

I am currently working on a project and for the moment it is just being made for the sake of it. However I want to know of my options if I ever planned to port it over to a mobile device.

I need to get some kind of interpreted scripting into my project and I figure I have 3 options. Do any of these work for unity and specifically for the iPhone/Android mobile platforms:

  1. c#'s code compile classes
  2. Javascript's eval function
  3. Something like Lua or Python

Any advice appreciated, I really don't want to have to write some simple scripting classes myself.

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
1
Best Answer

Answer by Peter G · Feb 21, 2011 at 06:44 PM

Interesting question. As long as you are making your stand alone in Unity, it will port your code for you. So you don't need to worry or make use of any interpreter. If that is not the case, then I suggest you read on.

If you need to use these dynamic features for a gameplay element, then I would use Reflection. Almost all the classes for reading and writing files are included in your build, but I don't know if self-generating code classes are such as System.CodeDOM. I know that it is included in the editor, but it is used in mostly special circumstances in game so for most people it would just increase build size.

If you want to see what is included, open MonoDevelop/VisualStudio and examine the references. Look through the System Namespace and see what files are included. Note: it will not include every namespace listed on the .Net online reference. Unity leaves out some such as System.Windows for memory's sake.

Writing your own interpreter is risky. Technically Unity gives you the resources that you could do it. Apple is finicky about what they will allow hence Unity is JIT compiled on desktop and AOT compiled on iPhone.

Android is already interpreted. Unity uses the Dalvik Virtual Machine to access native C++ code so on Android, you could probably use your own interpreter, but I'm not an Android dev so I can't tell you for sure.

Comment
Add comment · Show 3 · 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 Eric5h5 · Feb 21, 2011 at 06:51 PM 0
Share

eval() does not work on iPhone.

avatar image Peter G · Feb 21, 2011 at 07:00 PM 0
Share

Thanks. fixed it.

avatar image Jacob 1 · Feb 21, 2011 at 07:07 PM 0
Share

Thanks very much, very helpful advice.

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

No one has followed this question yet.

Related Questions

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

interpret unityscript at runtime? 4 Answers

Can't access Depth of Field? 2 Answers

How to change a specific material of an object at runtime ? 2 Answers

Handle modified variables being temporarily reset at runtime 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