Buildings added, Info and Upgrade Menus Display data, Scriptable Object improved

This commit is contained in:
Sewmina
2022-04-11 03:53:31 +05:30
parent 3581fe785d
commit 50162171d6
77 changed files with 3747 additions and 8891 deletions

View File

@@ -5,20 +5,28 @@ using UnityEngine;
public class Building : MonoBehaviour
{
public BuildingData buildingData;
public Outline outline;
public int curLevel;
public Outline[] outlines;
void Awake(){
if(outline == null){outline = GetComponent<Outline>();}
outline.enabled=false;
//if(outline == null){outline = GetComponent<Outline>();}
outlines = GetComponentsInChildren<Outline>();
ToggleOutlines(false);
Selector.OnSelectedChanged.AddListener(OnSelectedChanged);
}
void OnSelectedChanged(){
if(Selector.selectedBuilding == null){outline.enabled=false; return;}
if(Selector.selectedBuilding == null){ToggleOutlines(false); return;}
outline.enabled = Selector.selectedBuilding == this;
ToggleOutlines(Selector.selectedBuilding == this);
// Debug.Log(buildingName);
}
void ToggleOutlines(bool value){
foreach(Outline outline in outlines){
outline.enabled = value;
}
}
/* */
}