25 lines
611 B
C#
25 lines
611 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Building : MonoBehaviour
|
|
{
|
|
public BuildingData buildingData;
|
|
public Outline outline;
|
|
|
|
void Awake(){
|
|
if(outline == null){outline = GetComponent<Outline>();}
|
|
outline.enabled=false;
|
|
Selector.OnSelectedChanged.AddListener(OnSelectedChanged);
|
|
}
|
|
|
|
void OnSelectedChanged(){
|
|
if(Selector.selectedBuilding == null){outline.enabled=false; return;}
|
|
|
|
outline.enabled = Selector.selectedBuilding == this;
|
|
// Debug.Log(buildingName);
|
|
}
|
|
|
|
/* */
|
|
}
|