Beispiel #1
0
    public void UpdateALL(List <Dictionary <string, List <DataInfo> > > DataList)
    {
        DataCenter.Instance.ArrayDataToBuildingDataMethod3(DataList);
        for (int iIndex = 0; iIndex < Buildings.Count; iIndex++)
        {
            BuildingObj        nowBuilding = Buildings[iIndex];
            PlatformController platform    = nowBuilding.platformController;

            //nowBuilding.ResetPlatformFunction(platform.platLength, platform.platWidth, platform.platHeight, platform.isStair);
            nowBuilding.ResetBodyFunction();
            nowBuilding.ResetRoofFunction();
        }
    }
Beispiel #2
0
    /**
     * 更新屋身
     */
    public void UpdateBodySliderInfo(Slider slider)
    {
        BuildingObj nowBuilding = Buildings[selectFloor];
        CombineTing CT          = nowBuilding.transform.GetComponentInParent <CombineTing>();

        switch (slider.name)
        {
        case BodyMenuHandler.ColumeHeightSlider_NAME:

            if (CT)
            {
                float moveOffset = slider.value - CT.bodyController.eaveColumnHeight;
                for (int i = 0; i < CT.BuildingsList.Count; i++)
                {
                    CT.BuildingsList[i].MoveBuildingRoof(new Vector3(0, moveOffset, 0));
                }
                CT.bodyController.eaveColumnHeight = slider.value;
                CT.bodyController.goldColumnHeight = slider.value;
                CT.UpdateBodyFunction();
            }
            else
            {
                float moveOffset = slider.value - nowBuilding.bodyController.eaveColumnHeight;
                nowBuilding.bodyController.eaveColumnHeight = slider.value;
                nowBuilding.bodyController.goldColumnHeight = slider.value;
                nowBuilding.MoveBuildingRoof(new Vector3(0, moveOffset, 0));
                nowBuilding.ResetBodyFunction();
            }
            break;

        case BodyMenuHandler.GoldColNumSlider_NAME:
            if (CT)
            {
                CT.bodyController.goldColumnbayNumber = (int)slider.value;
                CT.UpdateBodyFunction();
            }
            else
            {
                nowBuilding.bodyController.goldColumnbayNumber = (int)slider.value;
                nowBuilding.DeleteGoldColumn();
                nowBuilding.ResetGoldColumn(true);
                nowBuilding.ResetWindowAndDoorNum();
            }
            break;

        case BodyMenuHandler.UnitInBay_NAME:

            if (CT)
            {
                CT.bodyController.unitNumberInBay = (int)slider.value;
                CT.UpdateBodyFunction();
            }
            else
            {
                nowBuilding.bodyController.unitNumberInBay = (int)slider.value;
                nowBuilding.ResetWindowAndDoorNum();
            }
            break;

        case BodyMenuHandler.DoorNumSlider_NAME:

            if (CT)
            {
                CT.bodyController.doorNumber = (int)slider.value;
                CT.UpdateBodyFunction();
            }
            else
            {
                nowBuilding.bodyController.doorNumber = (int)slider.value;
                nowBuilding.ResetWindowAndDoorNum();
            }
            break;

        case BodyMenuHandler.BodyWidthSlider_NAME:

            if (CT)
            {
                nowBuilding.bodyController.bodyWidth = slider.value;
                nowBuilding.ResetBodyFunction();
                CT.UpdateBodyFunction();
                CT.UpdatePlatformFunction();
            }
            else
            {
                nowBuilding.bodyController.bodyWidth = slider.value;
                nowBuilding.ResetBodyFunction();
            }
            break;

        case BodyMenuHandler.BodyLengthSlider_NAME:

            if (CT)
            {
                nowBuilding.bodyController.bodyLength = slider.value;
                nowBuilding.ResetBodyFunction();
                CT.UpdateBodyFunction();
                CT.UpdatePlatformFunction();
            }
            else
            {
                nowBuilding.bodyController.bodyLength = slider.value;
                nowBuilding.ResetBodyFunction();
            }
            break;
        }
    }