// Start is called before the first frame update
 void Start()
 {
     atomFather              = transform.parent;
     atomsManager            = FindObjectOfType <AtomsManager>();
     centralCell             = FindObjectOfType <CentralCell>();
     originPos               = transform.position;
     renderer                = GetComponent <Renderer>();
     renderer.enabled        = true;
     renderer.sharedMaterial = materials[0];
     parent = GetComponentInParent <Atom>();
     //atomsManagerRep.AddAtom(this);
 }
Example #2
0
 void Awake()
 {
     atomManager = FindObjectOfType <AtomsManager>();
     centralCell = FindObjectOfType <CentralCell>();
     for (float x = -1.5f; x < 2f; x += 1.5f)
     {
         for (float y = -1.5f; y < 2f; y += 1.5f)
         {
             if (x != 0 || y != 0)
             {
                 atomsSpawnPositions.Add(atomManager.GetK() > 5
                     ? new Vector3(0, y * (atomManager.GetK() - 5), x * (atomManager.GetK() - 5))
                     : new Vector3(0, y, x));
             }
         }
     }
 }