Top.Mail.Ru
Ответы

Помогите! Что за ошибка: Assets/Script/SpawnBombs.cs(20,13): error CS0029: Cannot implicitly convert type `int' to `bool'

using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class SpawnBombs : MonoBehaviour
{
public int score = 0;
public GameObject bomb;
public Text PlayScore;

void Start()
{
StartCoroutine(Spawn());
}

void Update ()
{
if (score = 30) //Здесь он ругается
{
SceneManager.LoadScene(2);
}
}

void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Ground")
{
score++;

}
}
IEnumerator Spawn()
{
while (!Player.lose) {
Instantiate (bomb, new Vector2 (Random.Range (-2.5f, 2.5f), 5.9f), Quaternion.identity);
yield return new WaitForSeconds(0.8f);
score++;
}
}

}

Вроде делаю всё праввильно

По дате
По рейтингу
Аватар пользователя
Профи
7лет

там стоит "=" вместо "=="