private void SetupBuildingInstance() { buildingInstance = Instantiate(_buildData.ConstructionPrefab); ConstructionBuilding construction = GetComponent <ConstructionBuilding>(); construction.Setup(_buildData.BuildingPrefab, _playerToBuildFor); Transform parent = GameObject.FindGameObjectWithTag("Active Buildings").transform; buildingInstance.transform.SetParent(parent, true); }
public override bool IsTargetValid(GameObject target) { StopAllCoroutines(); _target = target; _building = _target.GetComponent <ConstructionBuilding>(); if (!_building || !IsBuildingValid()) { return(false); } StartCoroutine(ConstructBuilding()); return(true); }