harris jimenez

harris jimenez

  • NA
  • 1
  • 987

how to delete only one clone of a game object..

Jul 7 2014 1:51 AM
I am developing an android math game it involves the use of coin with a value on it.  i am wondering wondering what will i do in order to delete
only one object in my game

for example if i have coin1(clone) and coin1(clone)(clone)..
if i click coin1(clone)(clone) it will be destroyed. but in my case
, when i click coin1(clone)(clone), coin1(Clone) is deleted,  i was wondering what will i do in order to delete only one object.
PS. the game object has a same value on it
void NumberOfSelectedCoins()
{
  Debug.Log (BlueCoinScript.b);
if(SelectedCoins.cntCoins%BlueCoinScript.b == 0)
{
for (int n=0;n<selectC.selectedNumCoins.Count; n++)
{
Destroy(selectC.selectedNumCoins[n]);
TotalSum.totalValue = 0;
SelectedCoins.breakPointsCount++;
}
breakpointsText.text = SelectedCoins.breakPointsCount.ToString ();
selectC.selectedNumCoins.Clear();
}
}

also if you have 1 game object and you cloned it so that you can have 3 same game objects,
how can you identify that when you clicked that game object, that game object is clone1 or clone2 or clone3

thx for the help