public override void Awake()
 {
     base.Awake();
     _buildingTypes = Resources.Load <BuildingTypeListScriptableObject>(typeof(BuildingTypeListScriptableObject).Name);
     if (_buildingTypes == null)
     {
         Debug.Log("*** Building Types List not found");
         return;
     }
     _activeBuildingType = null;
     _HQ.GetComponent <HealthSystem>().OnDeath += HQDied;
 }
Beispiel #2
0
    private void Awake()
    {
        float pos = startingPos;

        _buildingButtons = new Dictionary <BuildingTypeScriptableObject, Transform>();
        buildingSelect.gameObject.SetActive(false);
        _buildingTypes = Resources.Load <BuildingTypeListScriptableObject>(typeof(BuildingTypeListScriptableObject).Name);
        // Set up special "nothing selected" button
        _arrowButton = GenButton(pos, null);
        foreach (BuildingTypeScriptableObject buildingType in _buildingTypes.types)
        {
            if (ignoredBuildings.Contains(buildingType))
            {
                continue;
            }
            pos += offset;
            GenButton(pos, buildingType);
        }
        UpdateSelectedBuildingType(null);
    }