not sure where i should post this or100% how everything should be said.
i just want to make a randomize function that other functions can use that passes something into the function.
void SpawnAi()
{
if(spawnEnemy)
{
temp = spawners.GetComponent<SpawnEnemy>().SpawnRandomEnemy(); // Spawn a random enemy on the map
randomizer(temp); ////////////////////////////////////////////////////////////////
}
}
// KILL ENEMY BUTTON //
if(GUI.Button(new Rect(Screen.width - 395, Screen.height - 105, 75,75),kill)) // If this button is pressed
{
temp = Destroy(FindNearestEnemy()); // Destroy game object, this call has a return of a game object, either found or null
randomizer(temp);
}
void randomizer(gameObject temp){ ////////////////////////////////////////////////////////////////
int randNo = Random.Range(0,10); ////////////////////////////////////////////////////////////////
Debug.Log("randNo: "+ randNo); ////////////////////////////////////////////////////////////////
for(int i = 0; i < randNo; i++){ ////////////////////////////////////////////////////////////////
temp; ////////////////////////////////////////////////////////////////
} ////////////////////////////////////////////////////////////////
} ////////////////////////////////////////////////////////////////
not sure what should go in the gameObject place?
im more javascript and dont need to use types to do things.