if(lose){
restart.SetActive(true);
Best.SetActive(true);
BestIm.SetActive(true);
Pausse.SetActive(false);
if (this.interstitial.IsLoaded())
{
this.interstitial.Show();
}
}
public bool Lost {get; private set;} = false;
public void MakeLose() {
if(Lost== false) {
Lost = true;
Say("Проиграл");
}
}x.MakeLoose() вместо x.Loose = true;
Сейчас я в нём уже неплохо разбираюсь
class Player тоже надо сделать public
Access modifiers are not allowed on a local function. Local functions are always private.
void OnTriggerEnter2D (Collider2D other)
{
if (other.gameObject.tag == "Enemy"){lives = lives - 1f;}
if (other.gameObject.tag == "med"){lives = lives + 1f;}
if(lives >= 3){lives = 3;}
if (lives < 1)
{
Time.timeScale = 0;
que = true;
Pausse.SetActive(false);
AdText.SetActive(true);
AdYes.SetActive(true);
AdNo.SetActive(true);
}
public void Makelose()
{
restart.SetActive(true);
Best.SetActive(true);
BestIm.SetActive(true);
Pausse.SetActive(false);
lose = true;
if (this.interstitial.IsLoaded())
{
this.interstitial.Show();
}
}
}
void Update()
{
Lives.text = $"{lives}";
}