Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Iain 1 · Mar 14, 2010 at 08:45 AM · securitydesktoputility

Desktop Game & More

This could be a stupid question but with All the power that unity has is it possible to create a game/utility that would be able to run and make external commands to windows... ie shoot a crate and launch explorer... open a door launch an application.. then return to our game/utility afterwards?? Of course I am way out of my depth at creating such a venture anyway but I thought if I want to learn jump in at the deep end

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

Answer by Cyclops · Mar 15, 2010 at 02:35 PM

Update - yes you can, if you're building a standalone executable, and no, it does not require Unity Pro. :) Here is a C# example that starts Notepad:

using System;
using System.Diagnostics;
void Start () {
    String path = @"f:\temp\data.txt";
    Process foo = new Process();
    foo.StartInfo.FileName = "Notepad.exe";
    foo.StartInfo.Arguments = path;
    foo.Start();
}

Here's another example that opens a file and writes a line:

using System; using System.IO; using System.Text;

void Start () { String path = @"f:\temp\data.txt"; FileStream bar = File.Create(path); byte[] data = new UTF8Encoding(true).GetBytes(path); bar.Write(data, 0, path.Length); bar.Close(); }

So basically, anything that the the Unity version of .NET can do, a standalone program can do.

[obsolete] No, it's not a stupid question, it would be a nice feature, but... Shoot a crate, launch a virus - Open a door, write a password keylogger file... The possibilities are endless - which is why the possibilities are limited. :) Because it runs in a Browser window, there are security restriction on what Unity can do. Which includes not being able to access files on the local system. (I'm not sure about the standalone executable version).

There's a reference to being able to save player data at: Game External Files.

Also, if you want to learn Unity (possibly starting at the shallow end :), some more Answers are:

Start Learning Unity... and Scripting...

You will be scripting if you want to use Unity. :)

And - please read the FAQ

Update - as Eric5h5 point out, this only applies to a Browser build. If you want to do a stand-alone executable file, then yes, you can do all of those things. Unity has full access to .NET, which means you call open/close files, make system calls, do anything the Win32 API can do.

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 Cyclops · Mar 15, 2010 at 02:42 PM 0
Share

Odd - there wasn't a security tag already. Well, now there is. :)

avatar image Eric5h5 · Mar 29, 2010 at 04:12 PM 0
Share

Unity doesn't run in a browser window unless you make a web build. If the question is about stand-alone apps, which I'm pretty sure it is, then none of the browser security restrictions apply.

avatar image Cyclops · May 05, 2010 at 01:19 PM 0
Share

$$anonymous$$inor note - in Javascript, it would be import System.Diagnostics; ins$$anonymous$$d of C# using statement.

avatar image
0

Answer by Eric5h5 · Mar 29, 2010 at 04:09 PM

Yes, you can do those things. Using Unity Pro, you can write plugins that do anything you like. There may be other ways of launching external applications without Pro, but I'm not familiar with them offhand.

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

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

What are the package dependencies for Unity Linux Player? 1 Answer

Touch inputs on a Desktop type device 2 Answers

Editor utility for handling nested prefabs.. 4 Answers

Security Sandbox on the webplayer 3.0 1 Answer

Security for sensitive data 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