public void BattleBegin(DNA FDNA, DNA SDNA) { mob1DNA = FDNA; mob2DNA = SDNA; start = true; Mob1 = CreateMob(FDNA); Mob2 = CreateMob(SDNA); Mob1.GetComponent <EvolutionMob>().SetTarget(Mob2); Mob2.GetComponent <EvolutionMob>().SetTarget(Mob1); Mob1.SetActive(true); Mob2.SetActive(true); reload = waitingTime; }
public DNA setwin() { DNA winner; if (Mob1 == null) { winner = mob2DNA; return(winner); } if (Mob2 == null) { winner = mob1DNA; return(winner); } if (Mob1.GetComponent <EvolutionMob>().hp / Mob1.GetComponent <EvolutionMob>().GetDNA().hp * 1f > Mob2.GetComponent <EvolutionMob>().hp / Mob2.GetComponent <EvolutionMob>().GetDNA().hp) { winner = mob1DNA; } else { winner = mob2DNA; } return(winner); }