From f72c17993866f7898b67caa6277f35ee524c933e Mon Sep 17 00:00:00 2001 From: Ben Rothman Date: Sat, 21 Feb 2015 14:46:49 -0600 Subject: [PATCH] blorb stored as float again --- Assets/Base/Center.cs | 12 ++++++------ Assets/Base/ResourceCollector.cs | 2 +- Assets/Enemy/Enemy.cs | 2 +- Assets/GUI/BlorbIndicator.cs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Assets/Base/Center.cs b/Assets/Base/Center.cs index b8b6d51..9a47b61 100644 --- a/Assets/Base/Center.cs +++ b/Assets/Base/Center.cs @@ -15,7 +15,7 @@ public class Center : MonoBehaviour { private const float placementOffset = 0.725f; private float healthInternal; - private int resourcesInternal; + private float resourcesInternal; public float speed; @@ -28,17 +28,17 @@ public float health } } - public int blorbAmount + public float blorbAmount { //made property so updates text dynamically get {return resourcesInternal;} set { - int diff = value - resourcesInternal; + float diff = value - resourcesInternal; resourcesInternal = value; resourcePoolText.text = ((int)resourcesInternal).ToString(); GUIManager.UpdateTowerGUI(blorbAmount); - if (Mathf.Abs(diff) > 0) { + if (Mathf.Abs(diff) > 0f) { // Add blorb indicator GameObject g = (GameObject)Instantiate(blorbIndicator, resourcePoolText.transform.position, Quaternion.identity); g.transform.parent = resourcePoolText.transform; @@ -76,7 +76,7 @@ void GameStart () { health = 100f; - blorbAmount = 100; + blorbAmount = 100f; //resourcePoolText.text = resourcePool.ToString (); collectingFromResource = false; @@ -296,7 +296,7 @@ public void takeDamage(float damage) } } - public void receiveBlorb(int blorb) + public void receiveBlorb(float blorb) { blorbAmount += blorb; //resourcePoolText.text = resourcePool.ToString (); diff --git a/Assets/Base/ResourceCollector.cs b/Assets/Base/ResourceCollector.cs index 2de2117..d6b517f 100644 --- a/Assets/Base/ResourceCollector.cs +++ b/Assets/Base/ResourceCollector.cs @@ -81,7 +81,7 @@ void ToggleResourceAttachment(){ void CollectFromResource(){ if (currentResource != null){ - int extraBlorb = currentResource.collectBlorb(); + float extraBlorb = currentResource.collectBlorb(); Debug.Log ("extraBlorb = " + extraBlorb.ToString() + "\n"); center.blorbAmount += extraBlorb; } diff --git a/Assets/Enemy/Enemy.cs b/Assets/Enemy/Enemy.cs index 97c6678..2b21120 100644 --- a/Assets/Enemy/Enemy.cs +++ b/Assets/Enemy/Enemy.cs @@ -6,7 +6,7 @@ public class Enemy : MonoBehaviour { public Transform healthbar; public float hitDamage = 10.0f; - private const int killValue = 10; + private const float killValue = 10f; private float health = 100.0f; diff --git a/Assets/GUI/BlorbIndicator.cs b/Assets/GUI/BlorbIndicator.cs index 41af6c7..4839dae 100644 --- a/Assets/GUI/BlorbIndicator.cs +++ b/Assets/GUI/BlorbIndicator.cs @@ -7,15 +7,15 @@ public class BlorbIndicator : MonoBehaviour { private TextMesh textMesh; - public void setDiff (int d) { + public void setDiff (float d) { textMesh = this.GetComponent(); pos = transform.position; if (d > 0) { - textMesh.text = "+" + d.ToString(); + textMesh.text = "+" + ((int)d).ToString(); color = new Color(0f, 1f, 0f, 1f); } else { - textMesh.text = d.ToString(); + textMesh.text = ((int)d).ToString(); color = new Color(1f, 0f, 0f, 1f); }