Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to do it the easy way with a lot of objects to choose with a max.

Discussion in 'Scripting' started by jo6x, May 3, 2016.

  1. jo6x

    jo6x

    Joined:
    Jan 2, 2016
    Posts:
    113
    So, I got some objects, let's say 10, but I only can choose 5 of them.
    Now I can wright down a lot of text in C#, but I know there is a easier way but don't know how anymore.

    Example:
    Code (CSharp):
    1. if ( 1 && 2 && 5 && 8 && 10)
    2. {
    3.   // Something like a bool to block the objects 3,4,6,7,9 to use in the if statements
    4. }
    Can someone show me a easier way to do this.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,376
    How do you select the 5? On what criteria?