public GoatDnD NewGoat() { GoatDnD temp = GameObject.Instantiate(goatFab).GetComponent <GoatDnD>(); temp.genes = fac.createBaseCreature(); //temp.SetPop(Random.Range(0, 5)); //temp.SetSan(Random.Range(0, 5)); temp.InitStats(); for (int i = 0; i < 3; i++) { temp.sprites[i].sprite2D = temp.genes.parts[i].sprite; } return(temp); }
public void Cross(GoatDnD goatA, GoatDnD goatB) { if (totalGoats < maxGoats) { GoatDnD temp = GameObject.Instantiate(goatFab).GetComponent <GoatDnD>(); temp.genes = fac.breedCreatures(goatA.genes, goatB.genes); //temp.SetPop(Random.Range(0, 5)); //temp.SetSan(Random.Range(0, 5)); temp.InitStats(); for (int i = 0; i < 3; i++) { temp.sprites[i].sprite2D = temp.genes.parts[i].sprite; } AddGoat(temp); soundEffects.playCreatureSound(); } else { Debug.Log("SACRIFICE GOATS BEFORE CONSTRUCTING ADDITIONAL GOATS"); } }