Esempio n. 1
0
        // Token: 0x060003D0 RID: 976 RVA: 0x0000EB60 File Offset: 0x0000CD60
        private BlastAttack.HitPoint[] CollectHits()
        {
            Vector3 vector = this.position;

            Collider[] array = Physics.OverlapSphere(vector, this.radius, LayerIndex.entityPrecise.mask);
            int        num   = array.Length;
            int        num2  = 0;

            BlastAttack.< > c__DisplayClass27_0 CS$ < > 8__locals1;
            CS$ < > 8__locals1.encounteredHealthComponentsLength = 0;
            CS$ < > 8__locals1.hitOrderBufferLength = 0;
            HGArrayUtilities.EnsureCapacity <BlastAttack.HitPoint>(ref BlastAttack.hitPointsBuffer, num);
            HGArrayUtilities.EnsureCapacity <int>(ref BlastAttack.hitOrderBuffer, num);
            HGArrayUtilities.EnsureCapacity <HealthComponent>(ref BlastAttack.encounteredHealthComponentsBuffer, num);
            for (int i = 0; i < num; i++)
            {
                Collider collider  = array[i];
                HurtBox  component = collider.GetComponent <HurtBox>();
                if (component)
                {
                    HealthComponent healthComponent = component.healthComponent;
                    if (healthComponent && ((this.canHurtAttacker && healthComponent.gameObject == this.attacker) || healthComponent.GetComponent <TeamComponent>().teamIndex != this.teamIndex))
                    {
                        Vector3 vector2      = collider.transform.position;
                        Vector3 hitNormal    = vector2 - vector;
                        float   sqrMagnitude = hitNormal.sqrMagnitude;
                        BlastAttack.hitPointsBuffer[num2++] = new BlastAttack.HitPoint
                        {
                            hurtBox     = component,
                            hitPosition = vector2,
                            hitNormal   = hitNormal,
                            distanceSqr = sqrMagnitude
                        };
                    }
                }
            }
            if (true)
            {
                for (int j = 0; j < num2; j++)
                {
                    ref BlastAttack.HitPoint ptr = ref BlastAttack.hitPointsBuffer[j];
                    RaycastHit raycastHit;
                    if (ptr.hurtBox != null && ptr.distanceSqr > 0f && ptr.hurtBox.collider.Raycast(new Ray(vector, -ptr.hitNormal), out raycastHit, this.radius))
                    {
                        ptr.hitPosition = raycastHit.point;
                        ptr.hitNormal   = raycastHit.normal;
                    }
                }
            }
        // Token: 0x06002198 RID: 8600 RVA: 0x000914A8 File Offset: 0x0008F6A8
        private void BuildFromCharacterData(AllyCardManager.CharacterDataSet characterDataSet)
        {
            if (characterDataSet.count < this.displayElementCount)
            {
                Array.Clear(this.displayElements, characterDataSet.count, this.displayElementCount - characterDataSet.count);
            }
            this.displayElementCount = characterDataSet.count;
            HGArrayUtilities.EnsureCapacity <AllyCardManager.DisplayElement>(ref this.displayElements, this.displayElementCount);
            int i     = 0;
            int count = characterDataSet.count;

            while (i < count)
            {
                ref AllyCardManager.CharacterData ptr = ref characterDataSet[i];
                this.displayElements[i] = new AllyCardManager.DisplayElement
                {
                    master   = ptr.master,
                    priority = -1
                };
                i++;
            }