Exemplo n.º 1
0
 void OnPostRender()
 {
     if (StaticVariables.drawBondLines)
     {
         for (int i = 0; i < Atom.AllAtoms.Count; i++)
         {
             for (int j = i + 1; j < Atom.AllAtoms.Count; j++)
             {
                 Atom currAtom     = Atom.AllAtoms[i];
                 Atom neighborAtom = Atom.AllAtoms[j];
                 if ((currAtom.transform.position - neighborAtom.transform.position).magnitude
                     < currAtom.BondDistance(neighborAtom))
                 {
                     //draw a line from currAtom to atomNeighbor
                     //if(bondColor == null)bondColor = Color.clear;
                     StaticVariables.DrawLine(currAtom.transform.position,
                                              neighborAtom.transform.position, bondColor, bondColor, 0.05f, mat);
                 }
             }
         }
     }
 }