3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 646|回复: 5
打印 上一主题 下一主题

[求助] 求助大佬。无视红黄框任意放置建造的代码

[复制链接]

1

主题

10

帖子

81

积分

初级玩家

Rank: 2

贡献度
0
金元
810
积分
81
精华
0
注册时间
2012-7-15
跳转到指定楼层
主题
发表于 2024-11-3 18:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
求助大佬。无视红黄框任意放置建造的代码是什么,搜索哪条修改哪项,谢谢
回复

使用道具 举报

1

主题

199

帖子

233

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
2330
积分
233
精华
0
注册时间
2019-11-10
舒服的沙发
发表于 2024-11-8 13:44 | 只看该作者
同求,~~~~~~~~~~~~~~~
回复 支持 反对

使用道具 举报

42

主题

418

帖子

1714

积分

版主

Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

贡献度
187
金元
9663
积分
1714
精华
0
注册时间
2020-9-8
硬硬的板凳
发表于 2024-11-13 22:09 | 只看该作者
ConstructionGhost.UpdateProhibitionType
回复 支持 反对

使用道具 举报

1

主题

10

帖子

81

积分

初级玩家

Rank: 2

贡献度
0
金元
810
积分
81
精华
0
注册时间
2012-7-15
冰凉的地板
 楼主| 发表于 2024-11-23 19:16 | 只看该作者
leeahngi 发表于 2024-11-13 22:09
ConstructionGhost.UpdateProhibitionType

然后怎么改呀,大佬
回复 支持 反对

使用道具 举报

0

主题

5

帖子

12

积分

新手玩家

Rank: 1

贡献度
0
金元
115
积分
12
精华
0
注册时间
2023-9-12
5#
发表于 2024-12-23 18:12 | 只看该作者
66666666666666666
回复 支持 反对

使用道具 举报

2

主题

28

帖子

37

积分

初级玩家

Rank: 2

贡献度
0
金元
370
积分
37
精华
0
注册时间
2021-7-6
6#
发表于 2025-3-11 22:00 | 只看该作者
从第13行全部更改


public virtual void UpdateProhibitionType(bool check_is_snapped = true, Construction decoration_align_construction = null)
        {
                if (!this.m_BoxCollider)
                {
                        return;
                }
                this.m_RaincutterCollider = null;
                if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.IsSnapped) && !this.m_ConstructionToAttachTo && EnumTools.IsItemToAttachToTree(this.m_ResultItemID) && this.m_SelectedSlot != null)
                {
                        if (this.m_SelectedSlot.m_Construction != null || this.m_SelectedSlot.m_Ghost != null)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                        Vector3 center = this.m_BoxCollider.bounds.center;
                        Vector3 vector = this.m_BoxCollider.size * 0.5f;
                        center.y += this.m_ColliderShrinkBottom * 0.5f;
                        vector.y -= this.m_ColliderShrinkBottom;
                        vector.y = Mathf.Max(vector.y, 0f);
                        int num = Physics.OverlapBoxNonAlloc(center, vector, ConstructionGhost.s_CollidersTemp, this.m_BoxCollider.transform.rotation);
                        for (int i = 0; i < num; i++)
                        {
                                Collider collider = ConstructionGhost.s_CollidersTemp[i];
                                ConstructionGhost constructionGhost = collider.gameObject.GetComponent<ConstructionGhost>();
                                if (!constructionGhost && collider.gameObject.transform.parent)
                                {
                                        constructionGhost = collider.gameObject.GetComponentInParent<ConstructionGhost>();
                                }
                                if (constructionGhost && constructionGhost != this && constructionGhost.m_ResultItemID == this.m_ResultItemID)
                                {
                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                        return;
                                }
                        }
                        return;
                }
                else
                {
                        if (this.GetConstructForbidden() == ConstructionGhost.ConstructForbidden.Forbidden)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (this.m_UseExpandedBoundsTocheckRegrowingTrees)
                        {
                                this.UpdateExpandedBounds();
                        }
                        if (this.AreExtendedBoundsCollidingWithTrunk() || this.AreExtendedBoundsCollidingWithRegrowingTree())
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (!this.m_CanBePlacedOnTopOfConstruction && this.m_OnTopOfConstruction)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (check_is_snapped && this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.IsSnapped) && !this.m_ConstructionToAttachTo)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (this.m_SelectedSlot)
                        {
                                foreach (ConstructionSlot constructionSlot in this.m_SelectedSlot.gameObject.GetComponents<ConstructionSlot>())
                                {
                                        if (constructionSlot.m_Construction && constructionSlot.m_Construction.gameObject.activeSelf && (!constructionSlot.m_Construction.m_Info.IsWall() || this.m_ResultInfo.IsWall()) && (constructionSlot.m_Construction.m_Info.IsWall() || !this.m_ResultInfo.IsWall()))
                                        {
                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                return;
                                        }
                                }
                        }
                        if (ItemInfo.IsStoneRing(this.m_ResultItemID) && this.m_Firecamp && this.m_Firecamp.m_StoneRing)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (this.m_Corners != null)
                        {
                                foreach (BoxCollider boxCollider in this.m_Corners)
                                {
                                        bool enabled = boxCollider.enabled;
                                        boxCollider.enabled = true;
                                        bool flag = this.IsInAir(boxCollider.bounds.center, boxCollider.bounds.min);
                                        boxCollider.enabled = enabled;
                                        if (flag)
                                        {
                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                return;
                                        }
                                }
                        }
                        if (this.IsOnUpperLevel() && this.m_UpperLevelCorners != null)
                        {
                                foreach (BoxCollider boxCollider2 in this.m_UpperLevelCorners)
                                {
                                        bool enabled2 = boxCollider2.enabled;
                                        boxCollider2.enabled = true;
                                        Vector3 center2 = boxCollider2.bounds.center;
                                        center2.y += boxCollider2.bounds.max.y;
                                        bool flag2 = this.IsCornerInAir(center2, boxCollider2.bounds.min);
                                        boxCollider2.enabled = enabled2;
                                        if (flag2)
                                        {
                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                return;
                                        }
                                }
                        }
                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                        if (this.m_AllignToTerrain && !this.m_Smoker && this.m_FirecampRacks.Count == 0 && Vector3.Angle(base.transform.up, Vector3.up) > this.m_MaxAllignAngle)
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        Vector3 center3 = this.m_BoxCollider.bounds.center;
                        Vector3 vector2 = this.m_BoxCollider.size * 0.5f;
                        center3.y += this.m_ColliderShrinkBottom * 0.5f;
                        vector2.y -= this.m_ColliderShrinkBottom;
                        vector2.y = Mathf.Max(vector2.y, 0f);
                        this.m_Colliders.Clear();
                        if (this.m_TestColliders != null)
                        {
                                foreach (BoxCollider boxCollider3 in this.m_TestColliders)
                                {
                                        Vector3 size = boxCollider3.size;
                                        size.x *= boxCollider3.transform.localScale.x;
                                        size.y *= boxCollider3.transform.localScale.y;
                                        size.z *= boxCollider3.transform.localScale.z;
                                        int num2 = Physics.OverlapBoxNonAlloc(boxCollider3.bounds.center, size * 0.5f, ConstructionGhost.s_CollidersTemp, boxCollider3.transform.rotation);
                                        for (int k = 0; k < num2; k++)
                                        {
                                                Collider collider2 = ConstructionGhost.s_CollidersTemp[k];
                                                Anthill anthill;
                                                if (collider2.TryGetComponent<Anthill>(out anthill))
                                                {
                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                        return;
                                                }
                                                if (!this.m_Colliders.Contains(collider2) && !this.m_TestColliders.Contains(collider2))
                                                {
                                                        if (this.m_ResultItemID != ItemID.TroughFood && this.m_ResultItemID != ItemID.TroughInsects && this.m_ResultItemID != ItemID.TroughWater && collider2.gameObject.GetComponent<Farm>())
                                                        {
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                        if (collider2.isTrigger && !collider2.gameObject.GetComponent<ConstructionGhost>())
                                                        {
                                                                Spikes component = collider2.gameObject.GetComponent<Spikes>();
                                                                Acre exists = collider2.gameObject.transform.parent ? collider2.gameObject.transform.parent.GetComponent<Acre>() : null;
                                                                FramePlacingObstacle component2 = collider2.gameObject.GetComponent<FramePlacingObstacle>();
                                                                ConstructBlockSensor component3 = collider2.gameObject.GetComponent<ConstructBlockSensor>();
                                                                if (component3)
                                                                {
                                                                        if (this.ShouldIgnoreConstructionBlocker(component3))
                                                                        {
                                                                                goto IL_727;
                                                                        }
                                                                        this.TryToShowRestrictedAreaHint();
                                                                }
                                                                if (!component && !exists && !component2 && !component3)
                                                                {
                                                                        goto IL_727;
                                                                }
                                                        }
                                                        if (!(collider2.gameObject == Terrain.activeTerrain.gameObject) && !(collider2.transform.parent == base.transform))
                                                        {
                                                                this.m_Colliders.Add(collider2);
                                                        }
                                                }
                                                IL_727:;
                                        }
                                }
                        }
                        else
                        {
                                int num3 = Physics.OverlapBoxNonAlloc(center3, vector2, ConstructionGhost.s_CollidersTemp, this.m_BoxCollider.transform.rotation);
                                this.m_Colliders.Resize(num3);
                                for (int l = 0; l < num3; l++)
                                {
                                        this.m_Colliders[l] = ConstructionGhost.s_CollidersTemp[l];
                                }
                        }
                        this.m_Colliders.Remove(Player.Get().m_Collider);
                        this.m_Colliders.Remove(this.m_BoxCollider);
                        if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.NeedFirecamp) && this.m_Firecamp)
                        {
                                this.m_Colliders.Remove(this.m_Firecamp.m_Collider);
                                if (this.m_Firecamp.m_StoneRing)
                                {
                                        this.m_Colliders.Remove(this.m_Firecamp.m_StoneRing.m_Collider);
                                }
                        }
                        if ((ItemInfo.IsFirecamp(this.m_ResultItemID) || ItemInfo.IsStoneRing(this.m_ResultItemID)) && this.m_FirecampRacks.Count > 0)
                        {
                                foreach (FirecampRack firecampRack in this.m_FirecampRacks)
                                {
                                        this.m_Colliders.Remove(firecampRack.m_Collider);
                                }
                        }
                        if ((ItemInfo.IsFirecamp(this.m_ResultItemID) || ItemInfo.IsStoneRing(this.m_ResultItemID)) && this.m_Smoker)
                        {
                                this.m_Colliders.Remove(this.m_Smoker.m_Collider);
                        }
                        if (ConstructionChainController.Get().IsActive())
                        {
                                using (List<ConstructionGhostChain>.Enumerator enumerator3 = ConstructionChainController.Get().m_Chain.GetEnumerator())
                                {
                                        while (enumerator3.MoveNext())
                                        {
                                                ConstructionGhostChain constructionGhostChain = enumerator3.Current;
                                                Collider[] components2 = constructionGhostChain.GetComponents<Collider>();
                                                this.m_Colliders.Remove(constructionGhostChain.m_Collider);
                                                for (int m = 0; m < components2.Length; m++)
                                                {
                                                        this.m_Colliders.Remove(components2[m]);
                                                }
                                        }
                                        goto IL_A41;
                                }
                        }
                        if (ConstructionFenceController.Get().IsActive())
                        {
                                foreach (ConstructionGhost constructionGhost2 in ConstructionFenceController.Get().m_Chain)
                                {
                                        Collider[] components3 = constructionGhost2.GetComponents<Collider>();
                                        this.m_Colliders.Remove(constructionGhost2.m_Collider);
                                        for (int n = 0; n < components3.Length; n++)
                                        {
                                                this.m_Colliders.Remove(components3[n]);
                                        }
                                        BoxCollider lastStoredBoxCollider = ConstructionFenceController.Get().GetLastStoredBoxCollider();
                                        if (lastStoredBoxCollider)
                                        {
                                                this.m_Colliders.Remove(lastStoredBoxCollider);
                                        }
                                }
                                if (this.m_FenceSnapCollider != null)
                                {
                                        this.m_Colliders.Remove(this.m_FenceSnapCollider);
                                }
                                if (ConstructionFenceController.Get().m_FenceSnapCollider != null)
                                {
                                        this.m_Colliders.Remove(ConstructionFenceController.Get().m_FenceSnapCollider);
                                }
                        }
                        IL_A41:
                        if (General.IsTrough(this.m_ResultItemID))
                        {
                                bool flag3 = false;
                                using (List<Collider>.Enumerator enumerator5 = this.m_Colliders.GetEnumerator())
                                {
                                        while (enumerator5.MoveNext())
                                        {
                                                if (enumerator5.Current.gameObject.GetComponent<Farm>() != null)
                                                {
                                                        flag3 = true;
                                                        break;
                                                }
                                        }
                                }
                                if (!flag3)
                                {
                                        this.ClearCollidingPlants();
                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                        return;
                                }
                        }
                        if (base.GetType() == typeof(DecorationGhost))
                        {
                                using (List<Collider>.Enumerator enumerator6 = this.m_Colliders.GetEnumerator())
                                {
                                        while (enumerator6.MoveNext())
                                        {
                                                Construction construction;
                                                if (enumerator6.Current.gameObject.TryGetComponent<Construction>(out construction) && !(this.m_SelectedSlot != null) && construction != (this as DecorationGhost).m_ConstructionParent && !construction.m_IsFrame && (this as DecorationGhost).m_AlignType == DecorationGhost.AlignType.Wall && construction != (this as DecorationGhost).m_MovableConstruction.GetBaseConstruction())
                                                {
                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                        return;
                                                }
                                        }
                                }
                        }
                        if (this.m_ResultItemID != ItemID.Stick_Fish_Trap && this.m_ResultItemID != ItemID.Big_Stick_Fish_Trap)
                        {
                                foreach (Collider collider3 in this.m_Colliders)
                                {
                                        Item component4 = collider3.gameObject.GetComponent<Item>();
                                        if (!(component4 != null) || component4.m_Info == null || component4.m_Info.IsConstruction() || component4.m_IsPlant || component4.m_IsTree)
                                        {
                                                Farm component5 = collider3.gameObject.GetComponent<Farm>();
                                                if (component5)
                                                {
                                                        if (!General.IsTrough(this.m_ResultItemID))
                                                        {
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                        if (General.IsTrough(this.m_ResultItemID) && this.m_Colliders.Contains(component5.m_DoorArea))
                                                        {
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                }
                                                if (collider3.isTrigger)
                                                {
                                                        if ((this.m_ResultItemID == ItemID.building_frame || this.m_ResultItemID == ItemID.building_bamboo_frame || this.m_ResultItemID == ItemID.wooden_frame_triangle || this.m_ResultItemID == ItemID.bamboo_frame_triangle) && collider3.gameObject.GetComponent<FramePlacingObstacle>())
                                                        {
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                        UnityEngine.Object component6 = collider3.gameObject.GetComponent<Spikes>();
                                                        Acre exists2 = collider3.gameObject.transform.parent ? collider3.gameObject.transform.parent.GetComponent<Acre>() : null;
                                                        ConstructBlockSensor component7 = collider3.gameObject.GetComponent<ConstructBlockSensor>();
                                                        if (component6 || exists2 || component7)
                                                        {
                                                                if (component7)
                                                                {
                                                                        if (this.ShouldIgnoreConstructionBlocker(component7))
                                                                        {
                                                                                continue;
                                                                        }
                                                                        this.TryToShowRestrictedAreaHint();
                                                                }
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                        ConstructionGhost component8 = collider3.gameObject.GetComponent<ConstructionGhost>();
                                                        if (!(component8 != null))
                                                        {
                                                                continue;
                                                        }
                                                        if (component8.m_ResultItemID == ItemID.mud_mixer)
                                                        {
                                                                this.ClearCollidingPlants();
                                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                return;
                                                        }
                                                        using (List<GhostStep>.Enumerator enumerator8 = component8.m_Steps.GetEnumerator())
                                                        {
                                                                while (enumerator8.MoveNext())
                                                                {
                                                                        GhostStep ghostStep = enumerator8.Current;
                                                                        foreach (GhostSlot ghostSlot in ghostStep.m_Slots)
                                                                        {
                                                                                if (base.m_Collider.bounds.Intersects(ghostSlot.m_Collider.bounds))
                                                                                {
                                                                                        this.ClearCollidingPlants();
                                                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                                        return;
                                                                                }
                                                                        }
                                                                }
                                                                continue;
                                                        }
                                                }
                                                if (!this.m_ConstructionToAttachTo || (!(collider3.gameObject == this.m_ConstructionToAttachTo.gameObject) && !(collider3.gameObject == Terrain.activeTerrain.gameObject)))
                                                {
                                                        ConstructionGhost component9 = collider3.gameObject.GetComponent<ConstructionGhost>();
                                                        if (component9 != null)
                                                        {
                                                                foreach (GhostStep ghostStep2 in component9.m_Steps)
                                                                {
                                                                        foreach (GhostSlot ghostSlot2 in ghostStep2.m_Slots)
                                                                        {
                                                                                if (base.m_Collider.bounds.Intersects(ghostSlot2.m_Collider.bounds))
                                                                                {
                                                                                        this.ClearCollidingPlants();
                                                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                                        return;
                                                                                }
                                                                        }
                                                                }
                                                        }
                                                        Construction construction2 = collider3.gameObject.GetComponent<Construction>();
                                                        if (!construction2 && collider3.gameObject.transform.parent)
                                                        {
                                                                construction2 = collider3.gameObject.GetComponentInParent<Construction>();
                                                        }
                                                        if (construction2)
                                                        {
                                                                if (!(construction2 == this.m_ConstructionToAttachTo) && (!decoration_align_construction || !(decoration_align_construction == construction2)) && (this.IsBalcony(this.m_ResultItemID) || this.IsFrameTriangle(this.m_ResultItemID) || this.IsFrameTriangle(construction2.GetInfoID()) || (this.m_ConstructionToAttachTo && this.IsFrameTriangle(this.m_ConstructionToAttachTo.GetInfoID())) || !this.m_ConstructionToAttachTo || !this.m_ConstructionToAttachTo.IsConstructionConnected(construction2)))
                                                                {
                                                                        if (ConstructionChainController.Get().IsActive())
                                                                        {
                                                                                if (ConstructionChainController.Get().IsStartOrEnd(construction2))
                                                                                {
                                                                                        continue;
                                                                                }
                                                                                if (construction2.m_Info.IsWall())
                                                                                {
                                                                                        this.ClearCollidingPlants();
                                                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                                        return;
                                                                                }
                                                                                bool flag4 = false;
                                                                                for (int num4 = 0; num4 < 2; num4++)
                                                                                {
                                                                                        Construction construction3 = (num4 == 0) ? ConstructionChainController.Get().GetStartConstructionToAttachTo() : ConstructionChainController.Get().GetEndConstructionToAttachTo();
                                                                                        if (construction3 && !this.IsBalcony(this.m_ResultItemID) && !this.IsFrameTriangle(this.m_ResultItemID) && !this.IsFrameTriangle(construction2.GetInfoID()) && (!this.m_ConstructionToAttachTo || !this.IsFrameTriangle(construction3.GetInfoID())) && construction3 && construction3.IsConstructionConnected(construction2))
                                                                                        {
                                                                                                flag4 = true;
                                                                                                break;
                                                                                        }
                                                                                }
                                                                                if (flag4)
                                                                                {
                                                                                        continue;
                                                                                }
                                                                        }
                                                                        if (this.m_SelectedSlot && this.m_SelectedSlot.m_ParentConstruction)
                                                                        {
                                                                                int num5 = this.m_SelectedSlot.m_UpperLevelSlot ? (this.m_SelectedSlot.m_ParentConstruction.m_Level + 1) : this.m_SelectedSlot.m_ParentConstruction.m_Level;
                                                                                if (construction2.m_Level != num5 || (this.IsFrameTriangle(this.m_SelectedSlot.m_ParentConstruction.m_Info.m_ID) && (this.m_ResultItemID == ItemID.FreeHandsLadder || this.m_ResultItemID == ItemID.FreeHandsLadder_bamboo)))
                                                                                {
                                                                                        continue;
                                                                                }
                                                                        }
                                                                        if ((!this.IsOnUpperLevel() || construction2.m_Level != 0) && (this.IsOnUpperLevel() || construction2.m_Level <= 0))
                                                                        {
                                                                                DecorationGhost decorationGhost = this as DecorationGhost;
                                                                                if (!decorationGhost || !(decorationGhost.GetResultConstruction() == construction2))
                                                                                {
                                                                                        this.ClearCollidingPlants();
                                                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                                        return;
                                                                                }
                                                                        }
                                                                }
                                                        }
                                                        else
                                                        {
                                                                ConstructionGhost exists3 = null;
                                                                if (collider3.transform.parent)
                                                                {
                                                                        exists3 = collider3.transform.parent.GetComponent<ConstructionGhost>();
                                                                }
                                                                if ((!this.m_IgnoreCollisionWithTerrain || !(collider3.GetType() == typeof(TerrainCollider))) && !collider3.gameObject.IsWater() && !this.m_LayerMasksToIgnore.Contains(collider3.gameObject.layer) && !collider3.isTrigger && !exists3 && !this.HackForTreePlatformFloor(collider3) && !this.HackForTreeHouse(collider3))
                                                                {
                                                                        this.ClearCollidingPlants();
                                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                                        return;
                                                                }
                                                        }
                                                }
                                        }
                                }
                        }
                        if (this.m_ResultItemID == ItemID.farm)
                        {
                                center3 = this.m_BoxCollider.bounds.center;
                                vector2 = this.m_BoxCollider.size * 0.5f;
                                vector2.y = Mathf.Max(vector2.y, 0f);
                                int num6 = Physics.OverlapBoxNonAlloc(center3, vector2, ConstructionGhost.s_CollidersTemp, this.m_BoxCollider.transform.rotation);
                                this.m_Colliders.Resize(num6);
                                for (int num7 = 0; num7 < num6; num7++)
                                {
                                        this.m_Colliders[num7] = ConstructionGhost.s_CollidersTemp[num7];
                                }
                                this.m_Colliders.Remove(Player.Get().m_Collider);
                                this.m_Colliders.Remove(this.m_BoxCollider);
                        }
                        Collider collider4 = null;
                        foreach (Collider collider5 in this.m_Colliders)
                        {
                                if (collider5.gameObject.IsWater())
                                {
                                        collider4 = collider5;
                                        break;
                                }
                        }
                        if (this.m_PlacingCondition == ConstructionGhost.GhostPlacingCondition.CantBeInRaincutter || this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.CantBeInRaincutter))
                        {
                                foreach (Collider collider6 in this.m_Colliders)
                                {
                                        if (collider6.gameObject.IsRaincutter())
                                        {
                                                this.m_RaincutterCollider = collider6;
                                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                return;
                                        }
                                }
                        }
                        if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.MustBeInWater) && !collider4)
                        {
                                if (this.m_Hook)
                                {
                                        center3 = this.m_Hook.bounds.center;
                                        vector2 = this.m_Hook.size * 0.5f;
                                        int num8 = Physics.OverlapBoxNonAlloc(center3, vector2, ConstructionGhost.s_CollidersTemp, this.m_Hook.transform.rotation);
                                        for (int num9 = 0; num9 < num8; num9++)
                                        {
                                                if (ConstructionGhost.s_CollidersTemp[num9].gameObject.IsWater())
                                                {
                                                        return;
                                                }
                                        }
                                }
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.MustBeInWater) && collider4 && this.m_Hook)
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if ((this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.CantBeInWater) || this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.NeedFirecamp)) && collider4)
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (collider4 && this.m_MaxDepthOfWater > 0f && collider4.bounds.max.y - this.m_BoxCollider.bounds.min.y > this.m_MaxDepthOfWater)
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.Depth;
                                return;
                        }
                        if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.Whatever) || this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.CantBeInWater) || this.m_ResultItemID == ItemID.bamboo_platform || this.m_ResultItemID == ItemID.bamboo_platform_triangle)
                        {
                                List<GameObject> list = new List<GameObject>();
                                foreach (Collider collider7 in this.m_Colliders)
                                {
                                        if (this.m_LayerMasksToIgnore.Contains(collider7.gameObject.layer) && collider7.gameObject.layer != this.m_ItemLayer && !collider7.gameObject.transform.root.GetComponent<DeadBody>() && !(collider7.GetComponent<Weapon>() != null) && !collider7.GetComponent<PaintingBrush>())
                                        {
                                                if (collider7.transform.root.GetComponent<ElevatorStand>())
                                                {
                                                        this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                                        return;
                                                }
                                                if (!this.m_CollidingPlants.ContainsKey(collider7.gameObject))
                                                {
                                                        this.AddCollidingPlant(collider7.gameObject);
                                                }
                                                list.Add(collider7.gameObject);
                                        }
                                }
                                int num10 = 0;
                                while (num10 < this.m_CollidingPlants.Keys.Count)
                                {
                                        if (!list.Contains(this.m_CollidingPlants.ElementAt(num10).Key))
                                        {
                                                this.RemoveCollidingPlant(this.m_CollidingPlants.ElementAt(num10).Key);
                                        }
                                        else
                                        {
                                                num10++;
                                        }
                                }
                        }
                        if (this.m_ConstructionBelow && this.m_ConstructionBelow.m_Level >= 3)
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        if (this.m_CollidingPlants.Count > 0)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        EternalFireArea overlappingArea = EternalFireArea.GetOverlappingArea(base.transform.position);
                        if (this.m_AdditionalPlacingConditions.Contains(ConstructionGhost.GhostPlacingCondition.MustBeInEternalArea) && (!overlappingArea || overlappingArea.IsBusy()))
                        {
                                this.ClearCollidingPlants();
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        this.m_EternalFireArea = overlappingArea;
                        bool flag5 = false;
                        foreach (Collider collider8 in this.m_Colliders)
                        {
                                if (collider8 == null)
                                {
                                        return;
                                }
                                Anthill anthill2;
                                if (collider8.TryGetComponent<Anthill>(out anthill2))
                                {
                                        flag5 = true;
                                        break;
                                }
                                ElevatorStand elevatorStand;
                                if (collider8.transform.root.TryGetComponent<ElevatorStand>(out elevatorStand))
                                {
                                        flag5 = true;
                                        break;
                                }
                                if (!(base.GetType() != typeof(DecorationGhost)))
                                {
                                        Decoration decoration;
                                        if (collider8.transform.root.TryGetComponent<Decoration>(out decoration) && (this as DecorationGhost).m_MovableConstruction.GetBaseConstruction().m_BoxCollider != decoration.m_BoxCollider)
                                        {
                                                flag5 = true;
                                                break;
                                        }
                                        DecorationShelf decorationShelf;
                                        if (collider8.transform.root.TryGetComponent<DecorationShelf>(out decorationShelf) && (this as DecorationGhost).m_MovableConstruction.GetBaseConstruction().m_BoxCollider != decorationShelf.m_BoxCollider)
                                        {
                                                flag5 = true;
                                                break;
                                        }
                                }
                        }
                        if (flag5)
                        {
                                this.m_ProhibitionType = ConstructionGhost.ProhibitionType.None;
                                return;
                        }
                        return;
                }
        }
}
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2025-4-16 12:20 , Processed in 0.114152 second(s), 15 queries , Memcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表