programming

Unity – WWW – Get Audio from Web

Unity – WWW – Get Audio from Web

1. MAIN TOP MENU> File> New Project…
2. MAIN TOP MENU> GameObject> Create Empty, name it ‘Music Player’
3. Hierarchy> select ‘Music Player’> Inspector> ‘Add component’> Audio Source check ‘Play On Awake’, check ‘Loop’
4. Hierarchy> select ‘Music Player’> Inspector> ‘Add component’> New Script> JavaScript> name it LoadMusic.js
5. LoadMusic.js

#pragma strict


function Start () {
    // Get Audio from Web
    var www = new WWW('http://www.lucedigitale.com/blog/wp-content/gimme-code/css/images-gimme-code-2013-0016/bgmusic.ogg');
    audio.clip = www.audioClip;
}

function Update () {
    if(!audio.isPlaying && audio.clip.isReadyToPlay)
        audio.Play();
}

6. Build and Play the build to hear the audio.
Sometimes you need wait for a few minutes if the web connection will be slow.

WARNING: If you use TOP Play button to preview the game you will get the console message:
‘Exception: Expected root element to be . found html instead’
It is a security layer applied to the Web Player, you have to Build and Play the final HTML file to hear audio.

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

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – WWW – Get Audio 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 3D – Mobile – Assets

Unity 3D – Mobile – Assets

1. MAIN TOP MENU> Assets> Import Package> Standard Assets Mobile

2. Project> Standard Assets (Mobile)> Control Setups>

– CameraRelativeSetup scene
– FirstPersonSetup
– FirstPersonTilt
– PlayerRelativeSetup
– SidescrollSetup
– TapControlSetup

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Mobile – Assets

Unity – Materials – Toon

Unity – Materials – Toon

MAIN TOP MENU> Assets> Import Package> Toon

Project> Standard Assets> Toon Shading> Toony-Basic (sphere icon) DRAG AND DROP over an GameObject

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Materials – Toon