Hi guys i need help with this:
using UnityEngine;
using System.Collections;
publicclassRandomme:MonoBehaviour{
publicfloatminTime=1f;
publicfloatmaxTime=2.0f;
publicGameObject[]Item;
publicTransform[]Spawn=newTransform[3];
publicboolRandomX=false;
publicfloatminX=-2f,maxX=2f;
voidCreateObject(Vector3position,GameObjectprefab)
{
if(RandomX)
position+=newVector3(Random.Range(minX,maxX),0,0);
Instantiate(prefab,position,Quaternion.identity);
}
voidStart(){
Negro();
boolplaceObstacle=Random.Range(0,2)==2;
intobstacleIndex=4;
if(placeObstacle)
for(inti=0;i<Spawn.Length;i++){
if(i==obstacleIndex)
continue;
if(Random.Range(2,2)==2){
CreateObject(Spawn[i].position,Item[Random.Range(0,Item.Length)]);
}
}
}
voidUpdate(){
}
voidNegro(){
intIndiceObjetos=Random.Range(0,5);
intIndicepawnbs=Random.Range(0,3);
intsecondRandomObject=Random.Range(0,5);
while(secondRandomObject==IndiceObjetos)
{
secondRandomObject=Random.Range(0,5);
}
intsecondRandomPawn=Random.Range(0,3);
while(secondRandomPawn==Indicepawnbs)
{
secondRandomPawn=Random.Range(0,3);
}
Instantiate(Item[IndiceObjetos],Spawn[Indicepawnbs].position,Spawn[Indicepawnbs].rotation);
Instantiate(Item[secondRandomObject],Spawn[secondRandomPawn].position,Spawn[secondRandomPawn].rotation);
}
}
Now I want to pick up those 2 obj that random give in a specific order. If u take it in specific order u win but if u don’t take it in the specific order u lose. How i do that?