- Home /
Assigning multiple objectives in the if-then?
If I want, say a level, to load when I destroy 3 objects, how would I scrip that?
I already have this:
var target : Transform;
Function Update(){
if(target == null){ Application.LoadLevel("LevelName"); } }
Answer by burgunfaust · Apr 22, 2011 at 11:54 PM
var targetOneDead = false; var targetTwoDead = false; var targetOne : Transform; var targetTwo : Transform;
Function Update() {
if(targetOneDead == true && targetTwoDead == true) { Application.LoadLevel("LevelName"); } }
Then just set these to true when the appropriate critter is dead.
Your answer
Follow this Question
Related Questions
Numbers in parentheses (1), (2) etc. on Duplicate objects - Can this be prevented? 0 Answers
Why does if(levelToLoad ==null) not work? 2 Answers
Do I need to explicitly test for null or is testing the object itself good enough? 2 Answers
null and Null isnt the same? 0 Answers
Why is my C# array of objects fully populated when some of them should be null? 3 Answers