Friday, 23 October 2015

Unity3D Enable/Disable objects, with script Tutorial 20152

Unity Enable/Disable objects, with script !

Tutorial 20152






































DIRECT DOWNLOAD HERE






















THIS IS BACKUP  IN TEXT FORM  

1. Create New java and name it : DisablePREFABS


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


#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(true);

}

function OnTriggerEnter () { Obj.SetActive (false); }

function OnTriggerExit () { Obj.SetActive(false);
  DontDestroyOnLoad (gameObject);
}



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














THIS IS BACKUP  IN TEXT FORM  

1. Create New java and name it : EnablePrefabs


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


#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(false);

}

function OnTriggerEnter () { Obj.SetActive (true); }

function OnTriggerExit () { Obj.SetActive(true);
  DontDestroyOnLoad (gameObject);
}



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


















THIS IS BACKUP  IN TEXT FORM  

1. Create New java and name it : EnablePrefabsOnAndOff


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


#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(false);

}

function OnTriggerEnter () { Obj.SetActive (true); }

function OnTriggerExit () { Obj.SetActive(false);
  DontDestroyOnLoad (gameObject);
}



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



















1 comment: