Building Selection started + Outline

This commit is contained in:
Sewmina
2022-04-04 03:38:16 +05:30
parent b577d25a62
commit 0ace8baa66
289 changed files with 44124 additions and 2180 deletions

View File

@@ -0,0 +1,21 @@
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;
}
}