{"comment":{"url":"https://api.github.com/repos/poorprogramming/Resource/comments/9993936","html_url":"https://github.com/poorprogramming/Resource/commit/01d38a6480f8aa1199d6c8cec06883ca8e084977#commitcomment-9993936","id":9993936,"user":{"login":"nmetrock","id":2737589,"avatar_url":"https://avatars.githubusercontent.com/u/2737589?v=3","gravatar_id":"","url":"https://api.github.com/users/nmetrock","html_url":"https://github.com/nmetrock","followers_url":"https://api.github.com/users/nmetrock/followers","following_url":"https://api.github.com/users/nmetrock/following{/other_user}","gists_url":"https://api.github.com/users/nmetrock/gists{/gist_id}","starred_url":"https://api.github.com/users/nmetrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmetrock/subscriptions","organizations_url":"https://api.github.com/users/nmetrock/orgs","repos_url":"https://api.github.com/users/nmetrock/repos","events_url":"https://api.github.com/users/nmetrock/events{/privacy}","received_events_url":"https://api.github.com/users/nmetrock/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"01d38a6480f8aa1199d6c8cec06883ca8e084977","created_at":"2015-03-02T20:58:38Z","updated_at":"2015-03-02T20:58:38Z","body":"perm fix: open GameController.cs, replace:\r\n\r\n\tpublic void UpdateResources ()\r\n\t{\r\n\t\tstring txt = \"\";\r\n\r\n\t\tfor (int i=0; i < resourcePrefabs.Count; i++)\r\n\t\t{\r\n\t\t\tfloat total = 0.0f;\r\n\t\t\tfloat speed = 0.0f;\r\n\r\n\t\t\tforeach (ResourceController rc in resourceControllers[i])\r\n\t\t\t{\r\n\t\t\t\ttotal += rc.count;\r\n\t\t\t\tif (rc.gaining) { speed += rc.rate; }\r\n\t\t\t}\r\n\t\t\ttxt += resourceControllers[i][0].resourceName + \": \" + Mathf.FloorToInt(total) + \" (\" + speed.ToString(\"0.000\") + \"/s)\\n\";\r\n\t\t}\r\n\t\tresourceText.text = txt;\r\n\t}\r\n\r\nwith:\r\n\r\n\tpublic void UpdateResources ()\r\n\t{\r\n\t\tstring txt = \"\";\r\n\r\n\t\tfor (int i=0; i < resourcePrefabs.Count; i++)\r\n\t\t{\r\n\t\t\tfloat total = 0.0f;\r\n\t\t\tfloat speed = 0.0f;\r\n\r\n\t\t\tif (resourceControllers[i].Count > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach (ResourceController rc in resourceControllers[i])\r\n\t\t\t\t{\r\n\t\t\t\t\ttotal += rc.count;\r\n\t\t\t\t\tif (rc.gaining) { speed += rc.rate; }\r\n\t\t\t\t}\r\n\t\t\t\ttxt += resourceControllers[i][0].resourceName + \": \" + Mathf.FloorToInt(total) + \" (\" + speed.ToString(\"0.000\") + \"/s)\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tresourceText.text = txt;\r\n\t}"}}