using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Line : MonoBehaviour {
[SerializeField] private LineRenderer _renderer;
[SerializeField] private EdgeCollider2D _collider;
private readonly List<Vector2> _points = new List<Vector2>();
void Start() {
_collider.transform.position -= transform.position;
}
void Update()
{
}
public void SetPosition(Vector2 pos) {
if(!CanAppend(pos)) return;
_points.Add(pos);
_renderer.positionCount++;
_renderer.SetPosition(_renderer.positionCount-1,pos);
_collider.points = _points.ToArray();
}
private bool CanAppend(Vector2 pos) {
if (_renderer.positionCount == 0) return true;
return Vector2.Distance(_renderer.GetPosition(_renderer.positionCount - 1), pos) > DrawManager.RESOLUTION;
}
}
No overload for method 'IsPointerOverGameObject' takes 2 arguments
'EventSystem' does not contain a definition for 'currentTouchEvent' and no accessible extension method 'currentTouchEvent' accepting a first argument of type 'EventSystem' could be found (are you missing a using directive or an assembly reference?)
Пространство имен в скрипте:
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;