public void UpdateCollider() { var edgeCollider2D = GetComponent <EdgeCollider2D>(); List <Vector2> vector2List = LocalVector3Coords.ToVector2List(); edgeCollider2D.points = vector2List.ToArray(); }
public override void InitializeData() { if (!LocalVector3Coords.Any()) { LocalVector3Coords = new List <Vector3> { new Vector3(-1, 1, 0), new Vector3(1, 1, 0), new Vector3(1, -1, 0), new Vector3(-1, -1, 0) }; } }
public override void InitializeData() { if (!LocalVector3Coords.Any()) { LocalVector3Coords = new List <Vector3> { new Vector3(-1, 1, 0), new Vector3(1, 1, 0), }; var edgeCollider = gameObject.GetComponent <EdgeCollider2D>(); edgeCollider.edgeRadius = 0.05f; } }
public override void InitializeData() { if (!LocalVector3Coords.Any()) { LocalVector3Coords = new List <Vector3> { new Vector3(-1, 1, 0), new Vector3(1, 1, 0), new Vector3(1, -1, 0), new Vector3(-1, -1, 0) }; var meshCollider = GetComponent <MeshCollider>(); var meshFilter = GetComponent <MeshFilter>(); meshFilter.mesh = new Mesh(); meshCollider.sharedMesh = meshFilter.sharedMesh; meshCollider.convex = true; _meshHeightChecker = MeshHeight; } }