Code cleanup.

This commit is contained in:
2022-11-21 18:16:12 +08:00
parent 145c0ce6c8
commit e5d6e549bd
8 changed files with 9 additions and 15 deletions

View File

@@ -78,7 +78,7 @@ namespace Cryville.Crtr {
public void Init() {
if (Texture == null)
throw new InvalidOperationException(); // TODO
throw new InvalidOperationException("Missing texture");
_frame = new Rect(Vector2.zero, Size);
var w = _frame.width;
var h = _frame.height;
@@ -92,7 +92,7 @@ namespace Cryville.Crtr {
public void Init(int w, int h, Texture2D _base) {
if (Texture != null)
throw new InvalidOperationException(); // TODO
throw new InvalidOperationException("Missing texture");
Texture = _base;
float x = _frame.x / w;
float y = 1 - _frame.y / h;