Example #1
0
        public void SetBuildingType(SimpleBuildingType buildingType)
        {
            if (AvailableBuildingTypes.Contains(buildingType))
            {
                currentBuildingIndex = AvailableBuildingTypes.IndexOf(buildingType);
            }
            else
            {
                return;
            }

            SetTerraformType((int)TerraFormType.BUILD);
            currentTerraform             = TerraFormType.BUILD;
            playerDisplay.tmpBuildObject = (GameObject)GameObject.Instantiate(buildingType.prefab, transform.position, transform.rotation);
            playerDisplay.tmpBuildObject.GetComponent <SimpleBuildingBehaviour>().enabled = false;
            playerDisplay.tmpBuildObject.transform.SetParent(transform);
            playerDisplay.tmpBuildObject.transform.localScale = buildingType.scale;
        }
Example #2
0
        public void SetTerraformType(int newType)
        {
            direction             = 0;
            gridOverlay.isVisible = false;

            currentTerraform = (TerraFormType)newType;
            playerDisplay.SetTerraformType(currentTerraform);

            switch (currentTerraform)
            {
            case TerraFormType.BULLDOZE:
                gridOverlay.overlayType = GridOverlay.OverlayType.SQUARE;
                break;

            case TerraFormType.BULLDOZE_AREA:
                gridOverlay.overlayType = GridOverlay.OverlayType.SQUARE;
                break;

            case TerraFormType.RAISE_TERRAIN:
                gridOverlay.overlayType = GridOverlay.OverlayType.CROSS;
                break;

            case TerraFormType.LOWER_TERRAIN:
                gridOverlay.overlayType = GridOverlay.OverlayType.CROSS;
                break;

            case TerraFormType.LEVEL_TERRAIN:
                gridOverlay.overlayType = GridOverlay.OverlayType.SQUARE;
                break;

            case TerraFormType.BUILD:
                gridOverlay.overlayType = GridOverlay.OverlayType.SQUARE;

                break;

            default:
                break;
            }
        }
Example #3
0
 /// <summary>
 /// Returns true if the current terraform operation is performed on a tile. This has an effect of where player should be positioned
 /// if it is a tile then the arrow should mark the center of it otherwise a grid point (tile corner)
 /// </summary>
 protected bool IsTileOperation(TerraFormType terraform)
 {
     return(terraform == TerraFormType.BUILD ||
            terraform == TerraFormType.BULLDOZE);
 }