22 lines
569 B
C#
22 lines
569 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Building : MonoBehaviour
|
|
{
|
|
public string buildingName = "building01";
|
|
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;
|
|
}
|
|
}
|