• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SonicSlash24 · Apr 25, 2010 at 04:43 PM · destroycountworm

Script for counting number of Turrets and when I destroy all of them I go to the YOU WIN seine

hey this is my final question for the Worm game I am making. Here's the Question. Is their a script that can count all the enemies that I have which are 35 and when I destroy all of them I go to my. YOU WIN seine. Also, is their a way to make my game an .EXE file so even if people that don't have UNITY 3D they can play it. THANKS

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Peter G · Apr 25, 2010 at 05:20 PM

To answer your first question.

function Update () {
    var enemies : GameObject[] = GameObject.FindGameObjectsWithTag("Enemy");
    if(enemies.Length <= 0)
        Application.LoadLevel("WinScreen")
}

To use that tag all your turrets "Enemy" and when the die, destroy them or place another placeholder object in that isn't tagged enemy.


The second question: Go to "File/ Build Settings" and drag your scenes to the scenes window, select the file type you want to build it as(Windows Standalone) and hit Build.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

4 blocks destroyed - gravity true 2 Answers

Why does my counter keep going up after pickup is destroyed? 1 Answer

using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers

Detecting when certain objects have been destroyed 2 Answers

Keeping score when object clicked and destroyed 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges