- Home /
Screen Saver Development in Unity?
Hi
First of all, I'm neither a AAA 3d game title, nor i am in this field. I am researching on different commercial Game engines that could be used for Screensaver development [easily] and I found out DX but i'm interested in Unity personally. So could you please guide in this regard? Because I'm not sure if changing .exe to .scr will be much helpful. I want it to install in a screensaver manner and then become a default screensaver.
Any help will be highly appreciated.
Answer by Ashkan_gc · Jan 02, 2010 at 01:58 PM
some engines might have special features for creating screen saver setups but you just need an executable that respond correctly to command line options. 1 create an app in unity. 2 in one of the Awake functions check for sent command line options. /s means you should show the screen saver. /c means you should show the settings dialog. /p means you should show the screen saver in the small preview window. it tells you the window handle but unity can not draw on any external window. to check for command line switches use Environment.GetCommandLineArgs() that returns an array of strings. the first one is the name and path of the app. you should create a installer that copies your app to %windir%\system32. you should change the file extension to scr as you said. unity indie can not be used easily because it will show the unity's screen before checking for command line arguments. you can create a small console application that checks for command line arguments and then if needed run the unity application. it's the way that most of screen savers do because the settings dialogs are in windows form in most of the time rather than in game GUI. unity GUI is powerful and you can use that for settings dialog.
using quest3d or DX might be easier in this steps but creating the main application in unity is so easy. DX is generally a good product in this situation but you should pay for that. the engine has some advantages against unity like it's weather system and some shaders like ocian shader. also you can build windows sidebars with DX. you can do that with unity too but it needs more work in your side. you need to create XML files and ... yourself. as i saw the web site of DX they don't have a screen saver exporting option but quest3d has one. as i know gamestudio can draw on external windows but i don't know if any other engine can do that or not.
this code gets all command line arguments and shows them in a GUI
using UnityEngine;
using System; public class commandline : MonoBehaviour { private string[] args; void Start() { args = Environment.GetCommandLineArgs();
}
void OnGUI() { GUILayout.BeginArea(new Rect (30,30,600,6000)); foreach (string argument in args) { GUILayout.Label(argument); } GUILayout.EndArea(); }
}
I can't get this to work. The screen saver shows up in the control panels drop down list, but when I select it I get an error window saying "Data folder not found – There should be a '_Data' folder next to the executable". The problem is; there IS a data folder next to the screen saver executable, it is just not found. Any idea what the problem could be? Anyone?
Ah! I just need to put the _Data folder in 'C:\Windows\SysWOW64'. http://social.msdn.microsoft.com/For...2-7fbdc3147521
Answer by jbishop 1 · Jan 02, 2010 at 12:20 PM
Since the iPhone suspends and locks after a period of inactivity, I'm not sure a screen saver is a viable product (if your iphone is inactive, it is in your pocket!).
That said, you could write an app that acts like a screen saver if you REALLY wanted to. In that case, unless you want 3D, you are much better off with cocos2D. It is free, natively 2D, has a very active and fairly experienced (more so than unity's) community.
he wants a windows screen saver because he said something about DX studio. DX is a windows only engine.
Answer by jashan · Jan 02, 2010 at 01:23 PM
One thing you might try: exe2scr which you find on this site. Some people claim that you could simply create a screensaver by changing the extension from .exe to .scr; so that would be the first thing I'd try. You'll probably also need some Installer packager software to achieve the result you're looking for. And you may have to manually go into full-screen in the Unity application (that's very easy to do in code, so I wouldn't worry about that part).
Probably you could use Unity (the free editition) to give it a try with a very simple test-scene.