// Token: 0x06000304 RID: 772 RVA: 0x0002207C File Offset: 0x0002027C
 public void Copy(OldShrineFactory.CustomShrineController other)
 {
     this.ID             = other.ID;
     this.roomStyles     = other.roomStyles;
     this.isBreachShrine = other.isBreachShrine;
     this.offset         = other.offset;
     this.pixelColliders = other.pixelColliders;
     this.factory        = other.factory;
     this.OnAccept       = other.OnAccept;
     this.OnDecline      = other.OnDecline;
     this.CanUse         = other.CanUse;
 }
        // Token: 0x06000019 RID: 25 RVA: 0x00003ADC File Offset: 0x00001CDC
        private static void PlaceBreachShrines()
        {
            bool flag  = OldShrineFactory.m_builtShrines;
            bool flag2 = !flag;

            if (flag2)
            {
                foreach (GameObject gameObject in OldShrineFactory.builtShrines.Values)
                {
                    try
                    {
                        OldShrineFactory.CustomShrineController component = gameObject.GetComponent <OldShrineFactory.CustomShrineController>();
                        bool flag3 = !component.isBreachShrine;
                        bool flag4 = !flag3;
                        if (flag4)
                        {
                            OldShrineFactory.CustomShrineController component2 = UnityEngine.Object.Instantiate <GameObject>(gameObject).GetComponent <OldShrineFactory.CustomShrineController>();
                            component2.Copy(component);
                            component2.gameObject.SetActive(true);
                            component2.sprite.PlaceAtPositionByAnchor(component2.offset, tk2dBaseSprite.Anchor.LowerCenter);
                            IPlayerInteractable component3 = component2.GetComponent <IPlayerInteractable>();
                            bool flag5 = component3 is SimpleInteractable;
                            bool flag6 = flag5;
                            if (flag6)
                            {
                                ((SimpleInteractable)component3).OnAccept  = component2.OnAccept;
                                ((SimpleInteractable)component3).OnDecline = component2.OnDecline;
                                ((SimpleInteractable)component3).CanUse    = component2.CanUse;
                            }
                            bool flag7 = !RoomHandler.unassignedInteractableObjects.Contains(component3);
                            bool flag8 = flag7;
                            if (flag8)
                            {
                                RoomHandler.unassignedInteractableObjects.Add(component3);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Tools.PrintException(e, "FF0000");
                    }
                }
                OldShrineFactory.m_builtShrines = true;
            }
        }
        // Token: 0x06000017 RID: 23 RVA: 0x00003680 File Offset: 0x00001880
        public GameObject Build()
        {
            GameObject result;

            try
            {
                Texture2D  textureFromResource = ResourceExtractor.GetTextureFromResource(this.spritePath);
                GameObject gameObject          = SpriteBuilder.SpriteFromResource(this.spritePath, null);
                string     text = (this.modID + ":" + this.name).ToLower().Replace(" ", "_");
                //string roomPath = this.roomPath;
                gameObject.name = text;
                tk2dSprite component = gameObject.GetComponent <tk2dSprite>();
                component.IsPerpendicular = true;
                component.PlaceAtPositionByAnchor(this.offset, tk2dBaseSprite.Anchor.LowerCenter);
                Transform transform = new GameObject("talkpoint").transform;
                transform.position = gameObject.transform.position + this.talkPointOffset;
                transform.SetParent(gameObject.transform);
                bool flag  = !this.usesCustomColliderOffsetAndSize;
                bool flag2 = flag;
                if (flag2)
                {
                    IntVector2 intVector = new IntVector2(textureFromResource.width, textureFromResource.height);
                    this.colliderOffset = new IntVector2(0, 0);
                    this.colliderSize   = new IntVector2(intVector.x, intVector.y / 2);
                }
                SpeculativeRigidbody speculativeRigidbody = component.SetUpSpeculativeRigidbody(this.colliderOffset, this.colliderSize);

                speculativeRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.PlayerBlocker,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = this.colliderOffset.x,
                    ManualOffsetY          = this.colliderOffset.y,
                    ManualWidth            = this.colliderSize.x,
                    ManualHeight           = this.colliderSize.y,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                speculativeRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyBlocker,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = this.colliderOffset.x,
                    ManualOffsetY          = this.colliderOffset.y,
                    ManualWidth            = this.colliderSize.x,
                    ManualHeight           = this.colliderSize.y,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                speculativeRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.BulletBlocker,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = this.colliderOffset.x,
                    ManualOffsetY          = this.colliderOffset.y,
                    ManualWidth            = this.colliderSize.x,
                    ManualHeight           = this.colliderSize.y,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                speculativeRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.EnemyBulletBlocker,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = this.colliderOffset.x,
                    ManualOffsetY          = this.colliderOffset.y,
                    ManualWidth            = this.colliderSize.x,
                    ManualHeight           = this.colliderSize.y,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });
                speculativeRigidbody.PixelColliders.Add(new PixelCollider
                {
                    ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                    CollisionLayer         = CollisionLayer.BeamBlocker,
                    IsTrigger = false,
                    BagleUseFirstFrameOnly = false,
                    SpecifyBagelFrame      = string.Empty,
                    BagelColliderNumber    = 0,
                    ManualOffsetX          = this.colliderOffset.x,
                    ManualOffsetY          = this.colliderOffset.y,
                    ManualWidth            = this.colliderSize.x,
                    ManualHeight           = this.colliderSize.y,
                    ManualDiameter         = 0,
                    ManualLeftX            = 0,
                    ManualLeftY            = 0,
                    ManualRightX           = 0,
                    ManualRightY           = 0,
                });

                OldShrineFactory.CustomShrineController customShrineController = gameObject.AddComponent <OldShrineFactory.CustomShrineController>();
                customShrineController.ID             = text;
                customShrineController.roomStyles     = this.roomStyles;
                customShrineController.isBreachShrine = true;
                customShrineController.offset         = this.offset;
                customShrineController.pixelColliders = speculativeRigidbody.specRigidbody.PixelColliders;
                customShrineController.factory        = this;
                customShrineController.OnAccept       = this.OnAccept;
                customShrineController.OnDecline      = this.OnDecline;
                customShrineController.CanUse         = this.CanUse;
                bool flag3 = this.interactableComponent != null;
                bool flag4 = flag3;
                IPlayerInteractable item;
                if (flag4)
                {
                    item = (gameObject.AddComponent(this.interactableComponent) as IPlayerInteractable);
                }
                else
                {
                    SimpleShrine simpleShrine = gameObject.AddComponent <SimpleShrine>();
                    simpleShrine.isToggle    = this.isToggle;
                    simpleShrine.OnAccept    = this.OnAccept;
                    simpleShrine.OnDecline   = this.OnDecline;
                    simpleShrine.CanUse      = this.CanUse;
                    simpleShrine.text        = this.text;
                    simpleShrine.acceptText  = this.acceptText;
                    simpleShrine.declineText = this.declineText;
                    simpleShrine.talkPoint   = transform;
                    item = simpleShrine;
                }
                GameObject gameObject2 = ShrineFakePrefab.Clone(gameObject);
                gameObject2.GetComponent <OldShrineFactory.CustomShrineController>().Copy(customShrineController);
                gameObject2.name = text;
                bool flag5 = this.isBreachShrine;
                bool flag6 = flag5;
                if (flag6)
                {
                    bool flag7 = !RoomHandler.unassignedInteractableObjects.Contains(item);
                    bool flag8 = flag7;
                    if (flag8)
                    {
                        RoomHandler.unassignedInteractableObjects.Add(item);
                    }
                }
                else
                {
                    bool flag9  = !this.room;
                    bool flag10 = flag9;
                    if (flag10)
                    {
                        this.room = RoomFactory.CreateEmptyRoom(12, 12);
                    }
                    OldShrineFactory.RegisterShrineRoom(gameObject2, this.room, text, this.offset, this.RoomWeight);
                }
                OldShrineFactory.builtShrines.Add(text, gameObject2);
                result = gameObject;
            }
            catch (Exception e)
            {
                Tools.PrintException(e, "FF0000");
                result = null;
            }
            return(result);
        }