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 BimSekai · Jul 31, 2012 at 08:16 AM · webplayersecurity

Attempt to access a method failed

Hello again commmunity ! :)

I got the following line in the log files (considering i'm working with the webplayer):

MethodAccessException: Attempt to access a private/protected method failed. at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in :0 at DrawGUI.Execute (System.String exe, System.String arguments) [0x00000] in :0

I've been looking at: http://answers.unity3d.com/questions/49048/unity-31-webplayer-access-method-failed.html

But I can't find a solution...

Here's the code:

 public void CreateExec()
 {
     Execute(@"Assets/CreateWebplayer.bat" ,"");
 }

 public static void Execute(string exe, string arguments)
 {
     System.Diagnostics.Process myProc = new System.Diagnostics.Process();
     myProc.StartInfo.FileName = exe;
     myProc.StartInfo.Arguments = arguments;
     myProc.Start();
 }

The goal of this code is to launch a .bat/.sh script that would look like:

Unity.exe -quit -batchmode -executeMethod ExecCreator.BuildOffline

Doing this would allow the application to create assetbundles (it is a necessary step in the project).

The .bat/.sh script is located on the server, it got no permission restriction... any ideas ?

I'm sorry if the question looks stupid to you, i'm not much of a Unity Hero at the moment :D

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 Kryptos · Jul 31, 2012 at 08:55 AM

You cannot access the system inside a webplayer build due to the sandbox protection policy.

The webplayer is executed on the client side, so you cannot access distant file that way. You need to use the WWW class and send a request to a script (for example PHP, Perl...).

edit: It seams that creating a process is authorized (at least it is supported in the .Net subset used in webplayer). But I would not recommend it. Anyway, in your case this is not what you want.

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 BimSekai · Jul 31, 2012 at 09:23 AM 0
Share

So how is it technically possible to use the unityeditor functionnalities (like creating assetbundles) with the webplayer ? Let me explain the context, maybe I didn't explain it clearly enough, and i feel bad asking questions everytime i got troubles :(

I'm looking for a way to create a webplayer dynamically, so that the user could create his webplayer (and the associated bundles) while using the application. To do this i need to access several classes within the unityeditor library like buildpipeline(mainly).

I did use PHP to solve my last trouble (thanks to your expert advice), and i'll use PHP again to solve this one ? I used to hate PHP but now i guess we'll be friends...

Thank you again for the quick help ! :)

avatar image Kryptos · Jul 31, 2012 at 09:42 AM 0
Share

You cannot use the editor functionnalities outside of the editor. The UnityEditor assembly is not shipped in any build.

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

7 People are following this question.

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

Related Questions

is there a way to secure the .unity3d web player file from downloading? 1 Answer

Webplayer ActiveX 3 Answers

How do I protect my webplayer from beeing used from other sites? 2 Answers

How to Protect Webplayer Builds? 2 Answers

UnityWebPlayer security policy 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