//Updated upstream void CreateOnOfTheObject() { Vector3 spawnZone = centerSpawnZone + new Vector3(Random.Range(-sizeSpawnZone.x * 0.5f, sizeSpawnZone.x * 0.5f), 10, Random.Range(-sizeSpawnZone.z * 0.5f, sizeSpawnZone.z * 0.5f)); GameObject obj = _objectToCreated[UnityEngine.Random.Range(0, _objectToCreated.Length - 1)]; GameObject created = Instantiate(obj, spawnZone, Quaternion.identity); Aimant.MakeItGlue(created); /// }
public static void MakeItGlue(GameObject target, int score = 1) { Aimant createdscript = target.AddComponent <Aimant>(); createdscript.SetParams(target.transform, score); }