Example #1
0
    public void OnUnSelectAllWall(bool isCancel)
    {
        bool enableBuild = SceneManager.Instance.GetAllBuildingEnableState();

        for (int i = 0; i < SceneManager.Instance.SelectedAllWallList.Count; i++)
        {
            WallBehavior wallBehavior = SceneManager.Instance.SelectedAllWallList[i];
            wallBehavior.SetArrowState(false);
            wallBehavior.IsClick = false;
            this.RebuildWall(wallBehavior, enableBuild);
            wallBehavior.OnActiveBuildingFX(false);
            wallBehavior.AjustBoxColliderSize(false);
        }
        //this.m_EnableBuildAll = false;
        SceneManager.Instance.DestroyBuildingBorder();
        UIManager.Instance.HidePopuBtnByCurrentSelect(isCancel);
        SceneManager.Instance.ClearAllWallList();
    }
Example #2
0
    public void OnSelectWallRow()
    {
        print("OnSelectWallRow");
        SceneManager.Instance.ClearAllWallList();
        int rightIndex = 1;

        while (FindNeighourWallNotNull(BuildingObstacleDirection.Right, rightIndex).HasValue)
        {
            //if (FindNeighourWall(BuildingObstacleDirection.Right, rightIndex).Value)
            {
                WallBehavior wallBehavior = this.GetWallBehavior(BuildingObstacleDirection.Right, rightIndex);
                wallBehavior.SetTileState(true);
                SceneManager.Instance.WallListRight.Add(wallBehavior);
                wallBehavior.AjustBoxColliderSize();
            }
            rightIndex++;
        }
        int leftIndex = 1;

        while (FindNeighourWallNotNull(BuildingObstacleDirection.Left, leftIndex).HasValue)
        {
            //if (FindNeighourWall(BuildingObstacleDirection.Left, leftIndex).Value)
            {
                WallBehavior wallBehavior = this.GetWallBehavior(BuildingObstacleDirection.Left, leftIndex);
                wallBehavior.SetTileState(true);
                SceneManager.Instance.WallListLeft.Add(wallBehavior);
                wallBehavior.AjustBoxColliderSize();
            }
            leftIndex++;
        }
        if (SceneManager.Instance.WallListRight.Count > 0 || SceneManager.Instance.WallListLeft.Count > 0)
        {
            base.SetTileState(true);
            SceneManager.Instance.SelectedAllWallList.AddRange(SceneManager.Instance.WallListLeft);
            SceneManager.Instance.SelectedAllWallList.Add(this);
            SceneManager.Instance.SelectedAllWallList.AddRange(SceneManager.Instance.WallListRight);
            SceneManager.Instance.WallSelectedMode = WallSelectedMode.Row;
            UIManager.Instance.HidePopuBtnByCurrentSelect(true);
            UIManager.Instance.ShowPopupBtnByCurrentSelect();
            this.SetArrowPosition(false);
            //this.m_EnableBuildAll = true;
            return;
        }

        int topIndex = 1;

        while (FindNeighourWallNotNull(BuildingObstacleDirection.Top, topIndex).HasValue)
        {
            //if (FindNeighourWall(BuildingObstacleDirection.Top, topIndex).Value)
            {
                WallBehavior wallBehavior = this.GetWallBehavior(BuildingObstacleDirection.Top, topIndex);
                wallBehavior.SetTileState(true);
                SceneManager.Instance.WallListTop.Add(wallBehavior);
                wallBehavior.AjustBoxColliderSize();
            }
            topIndex++;
        }
        int bottomIndex = 1;

        while (FindNeighourWallNotNull(BuildingObstacleDirection.Bottom, bottomIndex).HasValue)
        {
            //if (FindNeighourWall(BuildingObstacleDirection.Bottom, bottomIndex).Value)
            {
                WallBehavior wallBehavior = this.GetWallBehavior(BuildingObstacleDirection.Bottom, bottomIndex);
                wallBehavior.SetTileState(true);
                SceneManager.Instance.WallListBottom.Add(wallBehavior);
                wallBehavior.AjustBoxColliderSize();
            }
            bottomIndex++;
        }
        if (SceneManager.Instance.WallListTop.Count > 0 || SceneManager.Instance.WallListBottom.Count > 0)
        {
            base.SetTileState(true);
            SceneManager.Instance.SelectedAllWallList.AddRange(SceneManager.Instance.WallListTop);
            SceneManager.Instance.SelectedAllWallList.Add(this);
            SceneManager.Instance.SelectedAllWallList.AddRange(SceneManager.Instance.WallListBottom);
            SceneManager.Instance.WallSelectedMode = WallSelectedMode.Column;

            UIManager.Instance.HidePopuBtnByCurrentSelect(true);
            UIManager.Instance.ShowPopupBtnByCurrentSelect();
            this.SetArrowPosition(false);
            //this.m_EnableBuildAll = true;
        }
    }