how antibodies work code example
Example: how do antibodies worrk
using UnityEngine;
using System.Collections;
public class ImmuneSystem : MonoBehaviour
{
public void ProtectBody(Disease disease)
{
if(disease.antiBody)
{
disease.Cure();
}
else
{
StartCoroutine(CreateAntibody(disease, disease.strength))
}
}
public IEnumerator CreateAntibody(Disease disease, int power)
{
for(int i = 0; i >= power; i++)
{
yield return new WaitForSeconds(1f);
return;
}
disease.antiBody = true;
}
public void Vaccine(Disease disease)
{
StartCoroutine(CreateAntibody(disease, 0));
}
}