private void OnTriggerExit(Collider other) { if (DNA != null && other.gameObject.Equals(DNA.gameObject)) { DNAScript.IsStuck = false; DNAScript.IsInSphere = false; mixingData.IsSphereEmpty[myNum] = true; mixingData.NumOfDNA--; mixingData.SetMedicineData(myNum); DNAScript = null; DNA = null; nowInsert = false; } }
private void SpawnDNAs() { int i = 0; foreach (var item in DNAs) { DNAObj.Add(Instantiate(DNAPrefabs[item.DNAsize - 1], spawnPoints.GetChild(i).transform)); DNApart dna = DNAObj[DNAObj.Count - 1].GetComponent <DNApart>(); DNAObj[DNAObj.Count - 1].transform.parent = spawnPoints.GetChild(i); dna.LoadDNA(item.DNAsize, item.criticalAge, item.unknownNum, item.positive, item.negative, mixingPanel); i++; } }
private void OnTriggerEnter(Collider other) { if (DNA == null && other.tag == "DNA") { DNAScript = other.GetComponent <DNApart>(); if (!DNAScript.IsStuck) { DNAScript.IsStuck = true; DNAScript.IsInSphere = true; mixingData.DNAStructs[myNum] = DNAScript.DNAStruct; mixingData.IsSphereEmpty[myNum] = false; mixingData.NumOfDNA++; mixingData.SetMedicineData(myNum); DNA = other.transform; nowInsert = true; } else { DNAScript = null; } } }