{"author_name":"HoboMechanistic","cat":"LD #30","comments":[],"epoch":1408790700,"likes":0,"metadata":{"p_key":"28022","p_author":"HoboMechanistic","p_authorkey":"38275","p_urlkey":"63469","p_title":"Salvation \u2013 Working on the building functionality","p_cat":"LD #30","p_event":"LD30","p_time":"1408790700","p_likes":"0","p_comments":"0","p_status":"UPD5","us_key":"38275","us_name":"HoboMechanistic","us_username":"hobomechanistic","event_start":"1408665600","event_key":"24","event_name":"LD30"},"text":"<p>So far it&#8217;s going slower than I anticipated. I am gringing at how bad I&#8217;m writing my code. I&#8217;m using public GameObject variables to just store a buncha prefabs. I then plan on instantiating these prefabs based on button clicks. At the moment I&#8217;m just removing (Destroying) a GameObject and instantiating a new one in the same place (Vector). I do this because I really don&#8217;t think I have the time to code solution that overwrites the GameObjects components. And I can&#8217;t overwrite a GameOjbect with another one, gives me an indexing error. My solution is pretty hacky but it&#8217;ll work for now.<\/p>\n <p>This would probably be the view part of a MVC design. I feel like I&#8217;m working backwards as I have no assets yet. Just a lotta placeholder stuff.<\/p>\n <p>Still having fun though. I best get back to it.<\/p>\n <p>&nbsp;<\/p>\n <p>&#8211; Improvement ideas &#8211;<\/p>\n <p>Build building placement system, rather than the preplanned spots (EmptyRoom GameOject). Maybe instantiate &#8211; move with cursor (in Update()).<\/p>\n <p>Don&#8217;t use loads of different building prefabs, use a Building class instead and inherit from it.<\/p>\n <p>Find better way to load in buildings, or overwrite GameObject components. You can&#8217;t overwrite a GameObject with another directly.<\/p>","time":"August 23rd, 2014 5:45 am","title":"Salvation \u2013 Working on the building functionality"}