Почему ошибка Assets\Scripts\Enemy.cs(69,25): error CS0103: The name 'startTimeBtwAttack' does not exist in the current context я нуб
вот код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
private float timeBtwAttack;
public float startTimeBrwAttack;
public int health;
public float speed;
public GameObject deathEffect;
public int damage;
private float stopTime;
public float startStopTime;
public float normalSpeed;
private Player player;
private Animator anim;
private void Start()
{
anim = GetComponent ();
player = FindObjectOfType ();
normalSpeed = speed;
}
private void Update()
{
if(stopTime<= 0)
{
speed = normalSpeed;
}
else
{
speed = 0;
stopTime -= Time.deltaTime;
}
if(health <= 0)
{
Destroy(gameObject);
}
transform.Translate(Vector2.left * speed * Time.deltaTime);
}
public void TakeDamage(int damage)
{
stopTime = startStopTime;
Instantiate(deathEffect, transform.position, Quaternion.identity);
health -= damage;
}
public void OnTriggerStay2D(Collider2D other)
{
if(other.CompareTag("Player"))
{
if(timeBtwAttack <= 0)
{
anim.SetTrigger("attack");
}
else
{
timeBtwAttack -= Time.deltaTime;
}
}
}
public void OnEnemyAttack()
{
Instantiate(deathEffect, player.transform.position, Quaternion.identity);
player.health -= damage;
timeBtwAttack = startTimeBtwAttack;
}
}
нужно перезагрузить вытащить и вставить симку и изменить ник