public Bond getBond() { if (anchors[1] == null) { AtomBehaviour atomScript = AtomBehaviour.instantiateAtom(transform.position + Vector3.Normalize(transform.up), "z"); anchors[1] = atomScript; } return(new Bond(anchors[0].id, anchors[1].id, (int)bondType)); }
public void newAtom(string atomType) { GameObject molecule = GameObject.Find("Molecule"); Vector3 newLoc = molecule.transform.position; if (existsCenteredAtom()) { newLoc = new Vector3(Random.Range(-.5f, .5f), Random.Range(-.5f, .5f), newLoc.z); } AtomBehaviour atomScript = AtomBehaviour.instantiateAtom(newLoc, atomType); }