Skip to content

Commit 803c9cf

Browse files
committed
Updating core package
1 parent 29d2b23 commit 803c9cf

File tree

97 files changed

+81
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+81
-51
lines changed

Core.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

ElasticSea.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElasticSea/Framework.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Scripts.meta renamed to ElasticSea/Framework/Scripts.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

Core/Scripts/Extensions/BoundsExtensions.cs renamed to ElasticSea/Framework/Scripts/Extensions/BoundsExtensions.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using UnityEngine;
55

6-
namespace Core.Extensions
6+
namespace ElasticSea.Framework.Extensions
77
{
88
public static class BoundsExtensions
99
{
@@ -182,5 +182,25 @@ public static Bounds MoveToBottom(this Bounds from, Bounds to)
182182
var newCenter = from.center.SetY(to.min.y + from.extents.y);
183183
return new Bounds(newCenter, from.size);
184184
}
185+
186+
public static Rect ToRect(this IEnumerable<Vector2> vertices)
187+
{
188+
return vertices.ToArray().ToRect();
189+
}
190+
191+
public static Rect ToRect(this Vector2[] vertices)
192+
{
193+
var min = vertices[0];
194+
var max = vertices[1];
195+
196+
for (var i = 0; i < vertices.Length; i++)
197+
{
198+
var current = vertices[i];
199+
min = min.Min(current);
200+
max = max.Max(current);
201+
}
202+
203+
return Rect.MinMaxRect(min.x, min.y, max.x, max.y);
204+
}
185205
}
186206
}
File renamed without changes.

Core/Scripts/Extensions/ComponentExtensions.cs renamed to ElasticSea/Framework/Scripts/Extensions/ComponentExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using UnityEngine;
33

4-
namespace Core.Extensions
4+
namespace ElasticSea.Framework.Extensions
55
{
66
public static class ComponentExtensions
77
{
File renamed without changes.

Core/Scripts/Extensions/ExceptionExtensions.cs renamed to ElasticSea/Framework/Scripts/Extensions/ExceptionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace _Framework.Core.Scripts.Extensions
4+
namespace ElasticSea.Framework.Extensions
55
{
66
public static class ExceptionExtensions
77
{

0 commit comments

Comments
 (0)