public void createNewBlob(int i, int size) { if (size < 10) { GameObject blob = Instantiate(Resources.Load("blob"), dots[i].transform.position, Quaternion.identity) as GameObject; Blob blobScr = blob.GetComponent <Blob>(); blobScr.Initialize(size, i); blobs[i] = blobScr; } else if (size < 20) { GameObject blob = Instantiate(Resources.Load("exploder"), dots[i].transform.position, Quaternion.identity) as GameObject; Exploder expScr = blob.GetComponent <Exploder>(); expScr.Initialize(size - 10, i); blobs[i] = expScr; } else { GameObject blob = Instantiate(Resources.Load("tear"), dots[i].transform.position, Quaternion.identity) as GameObject; Tear expScr = blob.GetComponent <Tear>(); expScr.Initialize(size - 20, i); blobs[i] = expScr; } }