示例#1
0
        static BossGroup CurrentBossGroup(BossGroup inp)
        {
            if (!InstanceTracker.Any <BossGroup>())
            {
                return(null);
            }
            BossGroup        a             = null;
            List <BossGroup> instancesList = InstanceTracker.GetInstancesList <BossGroup>();
            int num = 0;

            //if (instancesList.Count == 0)
            //{
            //    bossInfo = null;
            //    return;
            //}

            for (int i = 0; i < instancesList.Count; i++)
            {
                if (instancesList[i].shouldDisplayHealthBarOnHud)
                {
                    num++;
                }
            }
            if (inp)
            {
                if (!inp.shouldDisplayHealthBarOnHud)
                {
                    a = null;
                }
            }
            if (num > 0)
            {
                if (num != 1 && inp != null)
                {
                    a = null;
                }
                for (int i = 0; i < instancesList.Count; i++)
                {
                    if (instancesList[i].shouldDisplayHealthBarOnHud)
                    {
                        a = instancesList[i];
                        break;
                    }
                }
            }
            else
            {
                a = null;
            }

            return(a);
        }