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
1
Question by athap · Dec 17, 2011 at 01:35 AM · webplayerwindow

GUI.Window and Web Player

Hi all,

I have a menu script (CSharp) which runs fine when I run it from the unity editor. I have a menu system which shows up properly.

BUT when I build the project for web player, the menu is not showing up.

Does GUI.Window works in web player ???

Here is the code

 if (GUI.Button(new Rect(0, 0, 50, 20), "Files"))
     show = true;

 if(show)
     m_windowSize = GUI.Window(0, m_windowSize, ShowWindow, "");

Are there any permission for web player ??

Thanks for reading

Comment
Add comment · Show 2
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 Bunny83 · Dec 17, 2011 at 01:50 AM 0
Share

Using GUI.Window works fine in the webplayer. What's inside your window? I guess you do something evil in there :D The button name "Files" makes me imagine that you trying to use IO access or anything that isn't supported by the security sandbox.

Can you add your "ShowWindow" callback to your question?

avatar image athap · Dec 17, 2011 at 02:16 AM 0
Share

Plus one for you too

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jahroy · Dec 17, 2011 at 01:50 AM

The fact that I see the word "Files" makes me wonder if you're using code from a library that doesn't work for web builds.

There are security limitations that prevent certain libraries and operations from being used on the web.

For example, you definitely can't write a file to a user's computer from a web player (without a bunch of ninja skills).

There are actually many restrictions related to the file system that apply.

You also can't do stuff like hide the mouse cursor or go full screen without a warning message when using a web player.

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 athap · Dec 17, 2011 at 02:16 AM

Thanks Bunny83 and Jahroy

I love this forum and let me bow down in front of you guys.

Yes, I am writing/uploading files to/from user/appdata/local/myproject directory.

I just left my lab so I don't have the code right now but yes I am using IO libraries

Let me ask the pundits here :

Is there a way to save / load files from webplayer ?

Any pointer on the ninja skills ?

Thanks for your quick responses !!

Comment
Add comment · Show 8 · 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 jahroy · Dec 17, 2011 at 02:50 AM 0
Share

I believe you can save/load info using PlayerPrefs from a webplayer, but I could be wrong.

You can also use the world wide interweb to read and write data, but you'd have to use some kind of server side ninja skills. That's actually pretty easy if you know some php, perl, etc...

What exactly are you trying to do?

You have to have skills like $$anonymous$$r. $$anonymous$$iyagi to write a file to the user's computer from a browser (maybe Java, ActiveX, not sure what else).

Also, you should add non-solutions as comments rather than answers.

avatar image athap · Dec 17, 2011 at 03:03 AM 0
Share

I am saving data about what the user is doing in the environment. Server side stuff won't be suitable for what I am trying but I guess I will dig more into the web player securities. This would be my effort to get closer to $$anonymous$$r. $$anonymous$$iyagi.

Apologies for replying as answer and not as comment.

avatar image jahroy · Dec 17, 2011 at 04:05 AM 0
Share

Perhaps X$$anonymous$$L is an option... or somethng similar but custom.

$$anonymous$$aybe you could tell us a little about the data you're working with.

You could always make up a story about something similar if you're game is a secret.

avatar image Bunny83 · Dec 17, 2011 at 04:27 AM 0
Share

There are no ninja skills. There is NO WAY except PlayerPrefs and the AssetBundle cache to store any data on the users pc. If that would be possible in any way the Unity webplayer would be A HUGE security problem. If a user have installed the webplayer you could hide the webplayer somewhere on your website and when the user views your page it gets started and noone notice it. If it has access to the Users filesystem you would have just created a trojan horse.

Usually if you host a webplayer you have a webserver (not necessary but usually). If you want to store data for a specific user you have to do this on your server.

The PlayerPrefs can store up to 1$$anonymous$$B of data on the users PC per webplayer-URL. It's not much but it depends on what you wanna do.

avatar image jahroy · Dec 17, 2011 at 05:03 AM 0
Share

Well, maybe/possibly you could have a java applet running from the same web page as your Unity player and communicating with your game through javascript. Applets can write to the file system if you jump through the right hoops and the user agrees to let them.

This would be an absolutely horrible idea that I would never endorse... But it might be technically possible.

Server side stuff, PlayerPrefs, or AssetBundles would be one billion times better.

Show more comments

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Web Player build crashing for large size window 1 Answer

How can I tell when the Unity window is inactive? 1 Answer

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Drag Drop and Audio 0 Answers

Border around webplayer window? 2 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