From 6a5bce416d783f70adde953d0172ec993635b724 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 19 Aug 2014 17:18:29 +0100 Subject: [PATCH] Deleted FixedHeightSprite --- Assets/Fungus/Scripts/FixedHeightSprite.cs | 36 ------------------- .../Fungus/Scripts/FixedHeightSprite.cs.meta | 8 ----- 2 files changed, 44 deletions(-) delete mode 100644 Assets/Fungus/Scripts/FixedHeightSprite.cs delete mode 100644 Assets/Fungus/Scripts/FixedHeightSprite.cs.meta diff --git a/Assets/Fungus/Scripts/FixedHeightSprite.cs b/Assets/Fungus/Scripts/FixedHeightSprite.cs deleted file mode 100644 index 47390b95..00000000 --- a/Assets/Fungus/Scripts/FixedHeightSprite.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace Fungus -{ - /** - * Adjusts the scale of a sprite to fit into a fixed number of vertical world units. - * This helps to keep room sprites neatly organised in the editor. - */ - [ExecuteInEditMode] - public class FixedHeightSprite : MonoBehaviour - { - public float height = 2f; - - public void Update() - { - if (!Application.isPlaying) - { - SpriteRenderer spriteRenderer = renderer as SpriteRenderer; - if (!spriteRenderer || !spriteRenderer.sprite) - { - return; - } - - transform.position = new Vector3(transform.position.x, transform.position.y, 0); - transform.rotation = Quaternion.identity; - - float spriteHeight = spriteRenderer.sprite.bounds.extents.y * 2; - - float scale = height / spriteHeight; - - transform.localScale = new Vector3(scale, scale, 1f); - } - } - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/FixedHeightSprite.cs.meta b/Assets/Fungus/Scripts/FixedHeightSprite.cs.meta deleted file mode 100644 index 25ef11a6..00000000 --- a/Assets/Fungus/Scripts/FixedHeightSprite.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 09bfb0dc7847247568d08205da364d93 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: