//protected override void OnDestroy()
        //{
        //	base.OnDestroy();
        //}
        public static void BuildPrefab()
        {
            if (prefab != null || CompanionBuilder.companionDictionary.ContainsKey(guid))
            {
                return;
            }

            //Create the prefab with a starting sprite and hitbox offset/size
            BabyGoodShellicopter.ChopperPrefab = CompanionBuilder.BuildPrefab("Baby Good Shellicopter", guid, BabyGoodShellicopter.spritePaths[0], new IntVector2(3, 3), new IntVector2(9, 9));
            BabyGoodShellicopter.ChopperBehavior chopperBehavior = BabyGoodShellicopter.ChopperPrefab.AddComponent <BabyGoodShellicopter.ChopperBehavior>();
            AIAnimator aiAnimator = chopperBehavior.aiAnimator;

            aiAnimator.directionalType = AIAnimator.DirectionalType.Rotation;
            bool flag3 = BabyGoodShellicopter.chopperCollection == null;

            if (flag3)
            {
                BabyGoodShellicopter.chopperCollection = SpriteBuilder.ConstructCollection(BabyGoodShellicopter.ChopperPrefab, "Penguin_Collection");
                UnityEngine.Object.DontDestroyOnLoad(BabyGoodShellicopter.chopperCollection);
                for (int i = 0; i < BabyGoodShellicopter.spritePaths.Length; i++)
                {
                    SpriteBuilder.AddSpriteToCollection(BabyGoodShellicopter.spritePaths[i], BabyGoodShellicopter.chopperCollection);
                }
                SpriteBuilder.AddAnimation(chopperBehavior.spriteAnimator, BabyGoodShellicopter.chopperCollection, new List <int>
                {
                    0,
                    1,
                    2
                }, "idle", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 15f;
            }
            chopperBehavior.aiActor.MovementSpeed = 9f;
            chopperBehavior.specRigidbody.Reinitialize();
            chopperBehavior.specRigidbody.CollideWithTileMap = false;
            chopperBehavior.aiActor.CanTargetEnemies         = true;
            chopperBehavior.aiActor.SetIsFlying(true, "Flying Enemy", true, true);
            BehaviorSpeculator behaviorSpeculator = chopperBehavior.behaviorSpeculator;

            behaviorSpeculator.AttackBehaviors.Add(new BabyGoodShellicopter.ChopperAttackBehavior());
            behaviorSpeculator.MovementBehaviors.Add(new BabyGoodShellicopter.ApproachEnemiesBehavior());
            behaviorSpeculator.MovementBehaviors.Add(new CompanionFollowPlayerBehavior());
            UnityEngine.Object.DontDestroyOnLoad(BabyGoodShellicopter.ChopperPrefab);
            FakePrefab.MarkAsFakePrefab(BabyGoodShellicopter.ChopperPrefab);
            BabyGoodShellicopter.ChopperPrefab.SetActive(false);
        }
            // Token: 0x06000129 RID: 297 RVA: 0x0000B104 File Offset: 0x00009304
            private void PickNewTarget()
            {
                bool flag = this.m_aiActor == null;

                if (!flag)
                {
                    bool flag2 = this.Owner == null;
                    if (flag2)
                    {
                        this.Owner = this.m_aiActor.GetComponent <BabyGoodShellicopter.ChopperBehavior>().Owner;
                    }
                    this.Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All, ref this.roomEnemies);
                    for (int i = 0; i < this.roomEnemies.Count; i++)
                    {
                        AIActor aiactor = this.roomEnemies[i];
                        bool    flag3   = aiactor.IsHarmlessEnemy || !aiactor.IsNormalEnemy || aiactor.healthHaver.IsDead || aiactor == this.m_aiActor || aiactor.EnemyGuid == "ba928393c8ed47819c2c5f593100a5bc";
                        if (flag3)
                        {
                            this.roomEnemies.Remove(aiactor);
                        }
                    }
                    bool flag4 = this.roomEnemies.Count == 0;
                    BabyGoodShellicopter.ChopperBehavior chopperBehavior = BabyGoodShellicopter.ChopperPrefab.AddComponent <BabyGoodShellicopter.ChopperBehavior>();
                    if (flag4)
                    {
                        //this.m_aiActor.OverrideTarget = this.Owner.specRigidbody;
                        this.m_aiActor.OverrideTarget         = null;
                        chopperBehavior.aiAnimator.facingType = AIAnimator.FacingType.Movement;
                    }
                    else
                    {
                        AIActor aiActor  = this.m_aiActor;
                        AIActor aiactor2 = this.roomEnemies[UnityEngine.Random.Range(0, this.roomEnemies.Count)];
                        aiActor.OverrideTarget = ((aiactor2 != null) ? aiactor2.specRigidbody : null);
                        chopperBehavior.aiAnimator.facingType = AIAnimator.FacingType.Target;
                    }
                }
            }