Exemplo n.º 1
0
 public void DeSelect()
 {
     if (selected != null)
     {
         Destroy(selected.gameObject);
     }
     selected  = null;
     buildable = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the building we want to spawn in
        /// </summary>
        /// <param name="newSelected"></param>
        public void SetSelected(GameObject newSelected)
        {
            DeSelect();
            //creates new building
            GameObject go = Instantiate(newSelected, this.gameObject.transform);

            selected  = go.transform;
            buildable = go.GetComponent <Buildable>();
        }