Unity3D Launcher Chrome Extension: Open .unity3d Files in a New Tab
Unity3D Launcher Chrome Extension: Open .unity3d Files in a New Tab
This extension allows you to launch Unity3D files (.unity3d) directly within a new tab in your Chrome browser, providing a streamlined way to access and interact with your Unity projects.
Installation:
- Download the extension files (manifest.json, background.js, launchUnity.js).
- Navigate to
chrome://extensionsin your Chrome browser. - Enable "Developer mode" in the top right corner.
- Click "Load unpacked" and select the folder containing the extension files.
Usage:
- After installation, right-click on a .unity3d file and select "Open with..." -> "Unity3D Launcher".
- The extension will create a new tab and launch your Unity3D file.
Extension Structure:
1. manifest.json:
{
"manifest_version": 2,
"name": "Unity3D Launcher",
"version": "1.0",
"description": "Launches Unity3D files in a new tab.",
"permissions": [
"tabs"
],
"background": {
"scripts": ["background.js"]
},
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
}
2. background.js:
chrome.tabs.create({ url: 'chrome://newtab' }, function(tab) {
chrome.tabs.executeScript(tab.id, { file: 'launchUnity.js' });
});
3. launchUnity.js:
var unityFileUrl = 'http://example.com/game.unity3d';
var iframe = document.createElement('iframe');
iframe.src = unityFileUrl;
iframe.style.width = '100%';
iframe.style.height = '100%';
document.body.appendChild(iframe);
Note: Replace http://example.com/game.unity3d with the actual URL of your .unity3d file.
Benefits:
- Simplified access: Quickly launch your Unity3D files without navigating to external applications.
- Integrated experience: Enjoy a seamless transition between your browser and your Unity projects.
- Enhanced workflow: Improve your development and testing process by streamlining the launch process.
原文地址: http://www.cveoy.top/t/topic/nnD2 著作权归作者所有。请勿转载和采集!