Владимир Шарик
Ученик
(137),
на голосовании
5 месяцев назад
error CS8773: Feature 'file-scoped namespace' is not available in C# 9.0. Please use language version 10.0 or greater. как решить данную ошибку? using System.Collections; using System.Collections.Generic; using UnityEngine; namespace App;
public class PlatformGenerator : MonoBehaviour {
public GameObject platform; public Transform generationPoint; public float distanceBetween;
float platformWidth;
// Start is called before the first frame update void Start() { platformWidth = platform.GetComponent<BoxCollider2D>().size.x; }
// Update is called once per frame void Update() { if (transform.position.x < generationPoint.position.x); { transform.position = new Vector3(transform.position.x + platformWidth + distanceBetween, transform.position.y, transform,position.z); Instantiate(platform, transform.position, transform.rotation); } } }
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace App;
public class PlatformGenerator : MonoBehaviour
{
public GameObject platform;
public Transform generationPoint;
public float distanceBetween;
float platformWidth;
// Start is called before the first frame update
void Start()
{
platformWidth = platform.GetComponent<BoxCollider2D>().size.x;
}
// Update is called once per frame
void Update()
{
if (transform.position.x < generationPoint.position.x);
{
transform.position = new Vector3(transform.position.x + platformWidth + distanceBetween, transform.position.y, transform,position.z);
Instantiate(platform, transform.position, transform.rotation);
}
}
}
помогите пожалуйста