Unity – WWW – Get an Image from Web

Unity – WWW – Get an Image from Web

1. MAIN TOP MENU> File> New Project…
2. MAIN TOP MENU> GameObject> Create Other> Cube
3. Hierarchy> select Cube> Inspectot> ‘Add component’> New Script> JavaScript> name it LoadImage.js
4. LoadImage.js

#pragma strict

// Get the image
var url = "http://www.lucedigitale.com/principale/images/logo.png";
function Start () {
	 // Start a download of the given URL
	var www : WWW = new WWW (url);
	// Wait for download to complete
	yield www;
	// assign texture
	renderer.material.mainTexture = www.texture;
}

5. TOP Play button to see the final result

Reference:
http://docs.unity3d.com/Documentation/ScriptReference/WWW.html

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – WWW – Get an Image from Web

Unity – User input – Load Scene – GetButton – JS

Unity – User input – Load Scene – GetButton – JS

Level1.unity

1. MAIN TOP MENU> GameObject> Create Other> Cube
2. Hierarchy> Cude> Inspector> Add Component> New Script> JavaScript> LoadLevel2.js

LoadLevel2.js

#pragma strict

function Update() {
// press spacebar to load Level2
if(Input.GetButton("Jump")){
 Application.LoadLevel ("Level2"); 
}
}

3. Files> Save Scene as… Level1.unity

Level2.unity

1. MAIN TOP MENU> GameObject> Create Other> Sphere
2. Files> Save Scene as… Level2.unity

Building Settings

1. File> Building Settings…
2. Project> DRAG AND DROP Level1 over Building Settings> Scenes in Build
3. Project> DRAG AND DROP Level2 over Building Settings> Scenes in Build

Play

TOP Play button, Level1.unity starts -> press keyboard spacebar -> Level2.unity starts

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – User input – Load Scene – GetButton – JS

Unity 3D Game Engine – Best Resources

Unity 3D Game Engine – Best Resources

Official Unity Web Site

Start Here! Download the software, beginners tutorials, asset store.

http://unity3d.com/

Official Wiki

Thousands of scripts ready to use, tips and more, REALLY GREAT!

http://wiki.unity3d.com/

Organized tutorial list

Video Tutorials from Unity

List of Tutorials & Resources on UnityAnswsers:
http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html

List of Tutorials & Resources from “Unity Support” on this forum
http://forum.unity3d.com/threads/28867-Learning-Resources-for-Unity

Walker Boys
http://forum.unity3d.com/threads/69938-Unity-3-Video-Training-Course-(FREE)-Walker-Boys

InsurgentX
http://forum.unity3d.com/threads/107593-InsurgentX-s-Unity-Advanced-Tutorials

TornadoTwins
http://www.youtube.com/user/TornadoTwins

BurgZergArcade
http://www.burgzergarcade.com/

BurgZerg RPG Tutorials
http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial

Catlikecoding: Unity Tutorials
http://catlikecoding.com/unity/tutorials/

Buy Dame Assets

Free

http://www.3dvalley.com/
http://www.3dsmodels.com/
http://3dmagicmodels.com/
http://archive3d.net/
http://opengameart.org/
http://www.katorlegaz.com/3d_models/index.php
http://www.sharecg.com/
http://e2-productions.com/repository/modules/PDdownloads/
http://www.morguefile.com/
http://www.sxc.hu/
http://www.texturemate.com/
http://www.publicdomainpictures.net/
http://www.public-domain-photos.com/
http://www.public-domain-image.com/
http://creativity103.com/
http://www.openclipart.org
http://www.fromoldbooks.org/
http://www.gfxplace.com/

Free/Paid

http://www.3drt.com/
http://bunbun.com.au/
http://activeden.net/category/unity-3d
http://www.unitymagic.com/shop/
http://www.thegamecreators.com/
http://www.the3dstudio.com/
http://www.3dmagicmodels.com/
http://www.dexsoft-games.com/
http://www.creativecrash.com/
http://www.turbosquid.com/
http://www.gametextures.com/
Unity Asset Store (Inside Unity)

Paid Only

http://www.indiegamemarket.com/
http://visualconduct.com/shop/
http://www.arteria3d.com/
http://www.3dmedia.be/
http://developer.daz3d.com/
http://www.nekotika.com/
http://www.unitydevs.com/
http://www.unityprefabs.com/
http://www.frogames.net/
http://www.gamesprites.com/

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D Game Engine – Best Resources

Unity – Prefabs – Pre Configurated GameObjects

Unity – Prefabs – Pre Configurated GameObjects

Unity Prefabs are pre-configurated GameObjects

Essentials

– A Prefab is a type of asset (attività), a reusable GameObject stored in Project View.

– Prefabs can be inserted into any number of scenes, multiple times per scene.

– When you add a Prefab to a scene, you create an instance of it.

– All Prefab instances are linked to the original Prefab and are essentially clones of it. No matter how many instances exist in your project, when you make any changes to the Prefab you will see the change applied to all instances.

Creating Prefabs

In order to create a Prefab, simply drag a GameObject that you’ve created in the scene into the Project View.

1. Assets> Import New Asset… (Importa una nuova attività)> file.fbx (3D Model)

2. Assets> DRAG the imported Asset in the ‘Scene’ window twice
NOTICE: Hierarchy> The GameObject’s name will turn blue to show that it is a Prefab.

OR

DRAG AND DROP the Asset inside ‘Prefab’ folder

3a. Assets> select the imported Asset> Change material, ALL GameObjects in the scene will change.
OR
3b.Hierarchy> select a GameObject> Change material, ALL GameObjects in the scene will change.

After you have performed these steps, the GameObject and all its children have been copied into the Prefab data. The Prefab can now be re-used in multiple instances. The original GameObject in the Hierarchy has now become an instance of the Prefab.

Inheritance

Inheritance means that whenever the source Prefab changes, those changes are applied to all linked GameObjects. For example, if you add a new script to a Prefab, all of the linked GameObjects will instantly contain the script as well. However, it is possible to change the properties of a single instance while keeping the link intact. Simply change any property of a prefab instance, and watch as the variable name becomes bold. The variable is now overridden. All overridden properties will not be affected by changes in the source Prefab.

– If you want to update the source Prefab and all instances with the new overridden values, you can click the Apply button in the Inspector.
Note that the root’s position and rotation will not be applied, as that affects the instances absolute position and would put all instances in the same place. However position and rotation from any children or ancestors of the root will be applied as they are computed relative to the root’s transform.

– If you want to discard all overrides on a particular instance, you can click the Revert button.

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Prefabs – Pre Configurated GameObjects

Unity – Scripts – Assets

Unity – Scripts – Assets

1. MAIN TOP MENU> Assets> Import Package> Scripts

2. Projects> Standard Assets> Scripts

– Camera Scripts
Mouse Orbit
Smoot Follow
SmootlookAt

– General Scripts
Activate Trigger
Drag RigidBody

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Scripts – Assets