Unity3D Tutorial RandomSpawnPrefab

Advertisemen

Unity3D Tutorial RandomSpawnPrefab

Easter video series !











THIS IS Java# script: GOOD 4 2D GAMES AND 3D GAMES !
----------------------------------------­­­­­­­----------------------------------­-­-­-­-­-­-­------

DIRECT DOWNLOAD HERE




THIS IS BACKUP  IN TEXT FORM  TUTORIAL Random2Prefabs

1. Create New java and name it : Random2Prefabs


2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-





var DragHerePrefab1:GameObject;

var DragHerePrefab2:GameObject;



function Start () {
var BlockNumber:int = UnityEngine.Random.Range(1,3);

if(BlockNumber == 1){
var Block:GameObject = Instantiate(DragHerePrefab1, transform.position, transform.rotation);
}

if(BlockNumber == 2){
Instantiate(DragHerePrefab2, transform.position, transform.rotation);
}



}







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D