void Start() { if (!selectionSystem) { selectionSystem = selectionSystem = gameObject.AddComponent <BuildingSelectionSystem>(); } //Calls whenever a building is selected from the UI. EventSystem.OnBuildingSelected += selectionSystem.EnableBuildingSelection; EventSystem.OnBuildingRemoval += selectionSystem.EnableBuildingDeletion; }
private void OnValidate() { selectionSystem = GetComponentInChildren <BuildingSelectionSystem>(); }