Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Enemy Count

Enemy Count

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Enemy Count on Fri Jul 03, 2015 11:49 am

OneKnifeGames


{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
This script will change the level after a specified Gameobject(s) are destroyed.

DIRECTIONS:



  • Copy and paste the following script into a Javascript. Name script Enemy Count
  • Tag the Gameobject(s) you want destroyed with the tag Enemy-you can change this but don't forget to change it it the script!
  • Next drag the Enemy Count script onto the Player Gameobject.
  • Next add the specified level ExampleGame-the name can be changed but don't forget to change it in the script-to the build settings. ¬†File -> Build settings -> Add current. This will add the current scene into the build settings.
  • ENJOY!

Code:
//SCRIPT DEVELOPED BY ONEKNIFEGAMES DO NOT REMOVE!

#pragma strict

var level:int;

function Start () {

}

function Update () { print(GameObject.FindGameObjectsWithTag("Enemy").Length);

if(GameObject.FindGameObjectsWithTag("Enemy").Length==0) {Application.LoadLevel("ExampleGame");}

}

//SCRIPT DEVELOPED BY ONEKNIFEGAMES DO NOT REMOVE!

View user profile http://oneknifegames.weebly.com/

2 Re: Enemy Count on Sat Jul 04, 2015 1:36 pm

Great share OneKnife!

View user profile http://www.youtube.com/user/misterninjaboy

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum