// Token: 0x06000016 RID: 22 RVA: 0x00003624 File Offset: 0x00001824
        public static void Init()
        {
            bool initialized = OldShrineFactory.m_initialized;
            bool flag        = !initialized;

            if (flag)
            {
                DungeonHooks.OnFoyerAwake           += OldShrineFactory.PlaceBreachShrines;
                DungeonHooks.OnPreDungeonGeneration += delegate(LoopDungeonGenerator generator, Dungeon dungeon, DungeonFlow flow, int dungeonSeed)
                {
                    bool flag2 = flow.name != "Foyer Flow" && !GameManager.IsReturningToFoyerWithPlayer;
                    bool flag3 = flag2;
                    if (flag3)
                    {
                        foreach (OldShrineFactory.CustomShrineController customShrineController in UnityEngine.Object.FindObjectsOfType <OldShrineFactory.CustomShrineController>())
                        {
                            bool flag4 = !ShrineFakePrefab.IsFakePrefab(customShrineController);
                            bool flag5 = flag4;
                            if (flag5)
                            {
                                UnityEngine.Object.Destroy(customShrineController.gameObject);
                            }
                        }
                        OldShrineFactory.m_builtShrines = false;
                    }
                };
                OldShrineFactory.m_initialized = true;
            }
        }
        // Token: 0x06000064 RID: 100 RVA: 0x000061C8 File Offset: 0x000043C8
        public static GameObject Clone(GameObject obj)
        {
            bool flag       = ShrineFakePrefab.IsFakePrefab(obj);
            bool activeSelf = obj.activeSelf;
            bool flag2      = activeSelf;

            if (flag2)
            {
                obj.SetActive(false);
            }
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(obj);
            bool       flag3      = activeSelf;

            if (flag3)
            {
                obj.SetActive(true);
            }
            foreach (object obj2 in gameObject.GetComponentInChildren <Transform>())
            {
                UnityEngine.Object.DontDestroyOnLoad(gameObject);
            }
            ShrineFakePrefab.ExistingFakePrefabs.Add(gameObject);
            return(gameObject);
        }
        // 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);
        }
 public static Object InstantiateOP(Func <Object, Transform, Object> orig, Object original, Transform parent)
 {
     return(ShrineFakePrefab.Instantiate(original, orig(original, parent)));
 }
 public static Object InstantiateOPI(Func <Object, Transform, bool, Object> orig, Object original, Transform parent, bool instantiateInWorldSpace)
 {
     return(ShrineFakePrefab.Instantiate(original, orig(original, parent, instantiateInWorldSpace)));
 }
 public static T InstantiateGeneric <T>(Object original) where T : Object
 {
     return((T)ShrineFakePrefab.Instantiate(original, Object.Instantiate(original)));
 }
 public static Object InstantiateOPRP(Func <Object, Vector3, Quaternion, Transform, Object> orig, Object original, Vector3 position, Quaternion rotation, Transform parent)
 {
     return(ShrineFakePrefab.Instantiate(original, orig(original, position, rotation, parent)));
 }
 public static Object InstantiateOPR(Func <Object, Vector3, Quaternion, Object> orig, Object original, Vector3 position, Quaternion rotation)
 {
     return(ShrineFakePrefab.Instantiate(original, orig(original, position, rotation)));
 }
 public static Object InstantiateO(Func <Object, Object> orig, Object original)
 {
     return(ShrineFakePrefab.Instantiate(original, orig(original)));
 }