@Bogodar

Unity 2d c# code Выводит ошибку CS1041?

В моём коде выводит ошибку: Assets\Scripts\PlayerController.cs(5,13): error CS1041: Identifier expected; 'using' is a keyword.
Вот собственно код
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Transform;
using static
using System;

namespace Assets.Scripts
{
    public class PlayerController : MonoBehaviour
    {
		//Направление
		[SerializeField] private bool facingRight = true;
		
		//Прыжки
		[SerializeField] private bool isGrounded;
		[SerializeField] public Transform feetPos;
		[SerializeField] public Transform groundCheck;
		[SerializeField] public LayerMask whatIsGrounded;
		[SerializeField] private int extraJumps;
		[SerializeField] public int extraJumpsValue;
		
		//Движение
		[SerializeField] private float moveInput;
        [SerializeField] private float speed;
        [SerializeField] private float jumpForce;
		[SerializeField] private Rigidbody2D rigidbody;
		
        private void Start()
        {
			extraJumpsValue;
            rigidbody = GetComponent<Rigidbody2D>();
        }
		//Движение код
        private void FixedUpdate()
        {
			isGrounded = Physics2D.OverlapCircle(feetPos.position, groundCheck, whatIsGrounded);
			
            moveInput = Input.GetAxis("Horizontal");
            rigidbody.velocity = new Vector2(moveInput * speed, rigidbody.velocity.y);
			if(facingRight == false && moveInput > 0)
			{
				Flip();
			}
			else if(facingRight == true && moveInput < 0)
			{
				Flip();
			}
		}
		//Прыжки код
		void update()
		{
			if(isGrounded == true)
			{
				extraJumps = extraJumpsValue;
			}
			
			if(Input.GetKeyDown(KeyCode.Space) && extraJumps > 0)
			{
				rigidbody.velocity = Vector2.up * jumpForce;
				extraJumps--;
			}
			else if(Input.GetKeyDown(KeyCode.Space) && extraJumps == 0 && isGrounded == true)
			{
				rigidbody.velocity = Vector2.up * jumpForce;
			}
		}
		//Направление код
		void Flip()
		{
			facingRight = !facingRight;
			Vector3 Scaler = transform.localScale;
			Scaler.x *= -1;
			transform.localScale = Scaler;
		}
	}
}

Если убираю какой либо using, выдает еще больше ошибок.
  • Вопрос задан
  • 84 просмотра
Пригласить эксперта
Ответы на вопрос 1
@ninrez
Уберите using static. Ошибка должна пропасть.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы