protected override void Start() { base.Start(); this.SetPlacesToAttach(); this.SetPlacesToAttachTo(); this.m_ConstructionInfo = (ConstructionInfo)this.m_Info; for (int i = 0; i < this.m_ConstructionSlots.Length; i++) { ConstructionSlot constructionSlot = this.m_ConstructionSlots[i]; foreach (Construction construction in Construction.s_AllConstructions) { if (!(construction == this) && construction.m_Initialized && constructionSlot.m_MatchingItemIDs.Contains(construction.GetInfoID()) && (constructionSlot.transform.position - construction.transform.position).sqrMagnitude < 0.01f) { constructionSlot.SetConstruction(construction); break; } } } if (this.m_DisableFrame) { foreach (Construction construction2 in this.m_ConnectedConstructions) { ConstructionSlot[] constructionSlots = construction2.m_ConstructionSlots; for (int j = 0; j < constructionSlots.Length; j++) { if (constructionSlots[j].m_Construction == this) { construction2.ItemsManagerUnregister(); construction2.gameObject.SetActive(false); } } } } }
public override void SetupAfterLoad(int index) { base.SetupAfterLoad(index); IFirecampAttach[] components = base.gameObject.GetComponents <IFirecampAttach>(); if (components.Length != 0) { Bounds bounds = new Bounds(base.transform.TransformPoint(this.m_BoxCollider.center), this.m_BoxCollider.size); for (int i = 0; i < Firecamp.s_Firecamps.Count; i++) { Firecamp firecamp = Firecamp.s_Firecamps[i]; if (!(firecamp.gameObject == base.gameObject)) { Bounds bounds2 = new Bounds(firecamp.transform.TransformPoint(firecamp.m_BoxCollider.center), firecamp.m_BoxCollider.size); if (bounds.Intersects(bounds2)) { for (int j = 0; j < components.Length; j++) { components[j].SetFirecamp(firecamp); } } } } } if (SaveGame.m_SaveGameVersion >= GreenHellGame.s_GameVersionEarlyAccessUpdate4) { for (int k = 0; k < this.m_ConstructionSlots.Length; k++) { ConstructionSlot constructionSlot = this.m_ConstructionSlots[k]; if (SaveGame.LoadBVal(string.Concat(new object[] { "ConstructionSlot", index, constructionSlot.name, k }))) { Vector3 a = SaveGame.LoadV3Val(string.Concat(new object[] { "ConstructionSlotPos", index, constructionSlot.name, k })); foreach (Construction construction in Construction.s_AllConstructions) { if (!(construction == this) && (a - construction.transform.position).sqrMagnitude < 0.01f && constructionSlot.m_MatchingItemIDs.Contains(construction.GetInfoID())) { constructionSlot.SetConstruction(construction); break; } } } } } foreach (Construction construction2 in Construction.s_AllConstructions) { if (!(construction2 == this) && (this.m_ConstructionBelowPos - construction2.transform.position).sqrMagnitude < 0.01f && this.m_ConstructionBelowName == construction2.name) { this.m_ConstructionBelow = construction2; break; } } this.SetUpperLevel(this.m_UpperLevel, this.m_Level); }