Ejemplo n.º 1
0
    private ArmorModelSlotMask Initialize(ArmorModelMemberMap memberMap, ArmorModelSlotMask memberMask)
    {
        ActorMeshRenderer renderer;

        this.awake = true;
        string   rendererName = ArmorModelSlot.Head.GetRendererName();
        ActorRig actorRig     = this.defaultArmorModelGroup[ArmorModelSlot.Head].actorRig;

        if (this.originalRenderer != null)
        {
            renderer = ActorMeshRenderer.Replace(this.originalRenderer, actorRig, this.boneStructure.rigOrderedTransformArray, rendererName);
        }
        else
        {
            renderer = ActorMeshRenderer.CreateOn(base.transform, rendererName, actorRig, this.boneStructure.rigOrderedTransformArray, base.gameObject.layer);
        }
        this.renderers[ArmorModelSlot.Head] = renderer;
        for (ArmorModelSlot slot = ArmorModelSlot.Feet; slot < ArmorModelSlot.Head; slot = (ArmorModelSlot)(((int)slot) + 1))
        {
            this.renderers[slot] = renderer.CloneBlank(slot.GetRendererName());
        }
        for (ArmorModelSlot slot2 = ArmorModelSlot.Feet; slot2 < ArmorModelSlot.Head; slot2 = (ArmorModelSlot)(((int)slot2) + 1))
        {
            ActorMeshRenderer renderer2 = this.renderers[slot2];
            if (renderer2 != null)
            {
                renderer2.renderer.enabled = base.enabled;
            }
        }
        ArmorModelSlotMask mask = 0;
        ArmorModelGroup    defaultArmorModelGroup = this.defaultArmorModelGroup;

        if (defaultArmorModelGroup != null)
        {
            for (ArmorModelSlot slot3 = ArmorModelSlot.Feet; slot3 < ((ArmorModelSlot)4); slot3 = (ArmorModelSlot)(((int)slot3) + 1))
            {
                if (memberMask.Contains(slot3))
                {
                    ArmorModel armorModel = memberMap.GetArmorModel(slot3);
                    if ((armorModel != null) && this.BindArmorModelCheckedNonNull(armorModel))
                    {
                        mask |= slot3.ToMask();
                        continue;
                    }
                }
                ArmorModel model2 = defaultArmorModelGroup[slot3];
                if (model2 != null)
                {
                    this.BindArmorModelCheckedNonNull(model2);
                }
            }
            return(mask);
        }
        foreach (ArmorModelSlot slot4 in memberMask.EnumerateSlots())
        {
            ArmorModel model = memberMap.GetArmorModel(slot4);
            if ((model != null) && this.BindArmorModelCheckedNonNull(model))
            {
                mask |= slot4.ToMask();
            }
        }
        return(mask);
    }
Ejemplo n.º 2
0
    private ArmorModelSlotMask Initialize(ArmorModelMemberMap memberMap, ArmorModelSlotMask memberMask)
    {
        ActorMeshRenderer actorMeshRenderer;

        this.awake = true;
        string   rendererName = ArmorModelSlot.Head.GetRendererName();
        ActorRig item         = this.defaultArmorModelGroup[ArmorModelSlot.Head].actorRig;

        actorMeshRenderer = (!this.originalRenderer ? ActorMeshRenderer.CreateOn(base.transform, rendererName, item, this.boneStructure.rigOrderedTransformArray, base.gameObject.layer) : ActorMeshRenderer.Replace(this.originalRenderer, item, this.boneStructure.rigOrderedTransformArray, rendererName));
        this.renderers[ArmorModelSlot.Head] = actorMeshRenderer;
        for (ArmorModelSlot i = ArmorModelSlot.Feet; i < ArmorModelSlot.Head; i = (ArmorModelSlot)((byte)i + (byte)ArmorModelSlot.Legs))
        {
            this.renderers[i] = actorMeshRenderer.CloneBlank(i.GetRendererName());
        }
        for (ArmorModelSlot j = ArmorModelSlot.Feet; j < ArmorModelSlot.Head; j = (ArmorModelSlot)((byte)j + (byte)ArmorModelSlot.Legs))
        {
            ActorMeshRenderer item1 = this.renderers[j];
            if (item1)
            {
                item1.renderer.enabled = base.enabled;
            }
        }
        ArmorModelSlotMask mask             = (ArmorModelSlotMask)0;
        ArmorModelGroup    armorModelGroups = this.defaultArmorModelGroup;

        if (!armorModelGroups)
        {
            ArmorModelSlot[] armorModelSlotArray = memberMask.EnumerateSlots();
            for (int k = 0; k < (int)armorModelSlotArray.Length; k++)
            {
                ArmorModelSlot armorModelSlot = armorModelSlotArray[k];
                ArmorModel     armorModel     = memberMap.GetArmorModel(armorModelSlot);
                if (armorModel && this.BindArmorModelCheckedNonNull(armorModel))
                {
                    mask = mask | armorModelSlot.ToMask();
                }
            }
        }
        else
        {
            for (ArmorModelSlot l = ArmorModelSlot.Feet; (int)l < 4; l = (ArmorModelSlot)((byte)l + (byte)ArmorModelSlot.Legs))
            {
                if (memberMask.Contains(l))
                {
                    ArmorModel armorModel1 = memberMap.GetArmorModel(l);
                    if (!armorModel1 || !this.BindArmorModelCheckedNonNull(armorModel1))
                    {
                        goto Label1;
                    }
                    mask = mask | l.ToMask();
                    goto Label0;
                }
Label1:
                ArmorModel item2 = armorModelGroups[l];
                if (item2)
                {
                    this.BindArmorModelCheckedNonNull(item2);
                }
Label0:
            }
        }
        return(mask);
    }
Ejemplo n.º 3
0
    // Token: 0x06002F80 RID: 12160 RVA: 0x000B6ED8 File Offset: 0x000B50D8
    private global::ArmorModelSlotMask Initialize(global::ArmorModelMemberMap memberMap, global::ArmorModelSlotMask memberMask)
    {
        this.awake = true;
        string            rendererName = global::ArmorModelSlot.Head.GetRendererName();
        ActorRig          actorRig     = this.defaultArmorModelGroup[global::ArmorModelSlot.Head].actorRig;
        ActorMeshRenderer actorMeshRenderer;

        if (this.originalRenderer)
        {
            actorMeshRenderer = ActorMeshRenderer.Replace(this.originalRenderer, actorRig, this.boneStructure.rigOrderedTransformArray, rendererName);
        }
        else
        {
            actorMeshRenderer = ActorMeshRenderer.CreateOn(base.transform, rendererName, actorRig, this.boneStructure.rigOrderedTransformArray, base.gameObject.layer);
        }
        this.renderers[global::ArmorModelSlot.Head] = actorMeshRenderer;
        for (global::ArmorModelSlot armorModelSlot = global::ArmorModelSlot.Feet; armorModelSlot < global::ArmorModelSlot.Head; armorModelSlot += 1)
        {
            this.renderers[armorModelSlot] = actorMeshRenderer.CloneBlank(armorModelSlot.GetRendererName());
        }
        for (global::ArmorModelSlot armorModelSlot2 = global::ArmorModelSlot.Feet; armorModelSlot2 < global::ArmorModelSlot.Head; armorModelSlot2 += 1)
        {
            ActorMeshRenderer actorMeshRenderer2 = this.renderers[armorModelSlot2];
            if (actorMeshRenderer2)
            {
                actorMeshRenderer2.renderer.enabled = base.enabled;
            }
        }
        global::ArmorModelSlotMask armorModelSlotMask     = (global::ArmorModelSlotMask)0;
        global::ArmorModelGroup    defaultArmorModelGroup = this.defaultArmorModelGroup;

        if (defaultArmorModelGroup)
        {
            global::ArmorModelSlot armorModelSlot3 = global::ArmorModelSlot.Feet;
            while (armorModelSlot3 < (global::ArmorModelSlot)4)
            {
                if (!memberMask.Contains(armorModelSlot3))
                {
                    goto IL_14D;
                }
                global::ArmorModel armorModel = memberMap.GetArmorModel(armorModelSlot3);
                if (!armorModel || !this.BindArmorModelCheckedNonNull(armorModel))
                {
                    goto IL_14D;
                }
                armorModelSlotMask |= armorModelSlot3.ToMask();
IL_16D:
                armorModelSlot3 += 1;
                continue;
IL_14D:
                global::ArmorModel armorModel2 = defaultArmorModelGroup[armorModelSlot3];
                if (armorModel2)
                {
                    this.BindArmorModelCheckedNonNull(armorModel2);
                    goto IL_16D;
                }
                goto IL_16D;
            }
        }
        else
        {
            foreach (global::ArmorModelSlot slot in memberMask.EnumerateSlots())
            {
                global::ArmorModel armorModel3 = memberMap.GetArmorModel(slot);
                if (armorModel3 && this.BindArmorModelCheckedNonNull(armorModel3))
                {
                    armorModelSlotMask |= slot.ToMask();
                }
            }
        }
        return(armorModelSlotMask);
    }