Esempio n. 1
0
 public bool Contains <TArmorModel>(TArmorModel model) where TArmorModel : ArmorModel, new()
 {
     if (model == null)
     {
         return(false);
     }
     if (!this.awake)
     {
         ArmorModelGroup defaultArmorModelGroup = this.defaultArmorModelGroup;
         return((defaultArmorModelGroup != null) && (defaultArmorModelGroup.GetArmorModel <TArmorModel>() == model));
     }
     return(this.models.GetArmorModel <TArmorModel>() == model);
 }
Esempio n. 2
0
 public bool Contains(ArmorModel model)
 {
     if (model == null)
     {
         return(false);
     }
     if (!this.awake)
     {
         ArmorModelGroup defaultArmorModelGroup = this.defaultArmorModelGroup;
         return((defaultArmorModelGroup != null) && (defaultArmorModelGroup[model.slot] == model));
     }
     return(this.models[model.slot] == model);
 }
Esempio n. 3
0
    public ArmorModelMemberMap GetArmorModelMemberMapCopy()
    {
        if (this.awake)
        {
            return(this.models);
        }
        ArmorModelGroup armorModelGroups = this.defaultArmorModelGroup;

        if (armorModelGroups)
        {
            return(armorModelGroups.armorModelMemberMap);
        }
        return(new ArmorModelMemberMap());
    }
Esempio n. 4
0
    public bool Contains(ArmorModel model)
    {
        if (!model)
        {
            return(false);
        }
        if (this.awake)
        {
            return(this.models[model.slot] == model);
        }
        ArmorModelGroup armorModelGroups = this.defaultArmorModelGroup;

        return(!armorModelGroups ? false : armorModelGroups[model.slot] == model);
    }
Esempio n. 5
0
    public ArmorModelMemberMap GetArmorModelMemberMapCopy()
    {
        if (this.awake)
        {
            return(this.models);
        }
        ArmorModelGroup defaultArmorModelGroup = this.defaultArmorModelGroup;

        if (defaultArmorModelGroup == null)
        {
            return(new ArmorModelMemberMap());
        }
        return(defaultArmorModelGroup.armorModelMemberMap);
    }
Esempio n. 6
0
    public T GetArmorModel <T>() where T : ArmorModel, new()
    {
        if (this.awake)
        {
            return(this.models.GetArmorModel <T>());
        }
        ArmorModelGroup defaultArmorModelGroup = this.defaultArmorModelGroup;

        if (defaultArmorModelGroup != null)
        {
            return(defaultArmorModelGroup.GetArmorModel <T>());
        }
        return(null);
    }
Esempio n. 7
0
    public T GetArmorModel <T>()
        where T : ArmorModel, new()
    {
        if (this.awake)
        {
            return(this.models.GetArmorModel <T>());
        }
        ArmorModelGroup armorModelGroups = this.defaultArmorModelGroup;

        if (armorModelGroups)
        {
            return(armorModelGroups.GetArmorModel <T>());
        }
        return((T)null);
    }
Esempio n. 8
0
    public bool Contains <TArmorModel>(TArmorModel model)
        where TArmorModel : ArmorModel, new()
    {
        if (!model)
        {
            return(false);
        }
        if (this.awake)
        {
            return(this.models.GetArmorModel <TArmorModel>() == model);
        }
        ArmorModelGroup armorModelGroups = this.defaultArmorModelGroup;

        return(!armorModelGroups ? false : armorModelGroups.GetArmorModel <TArmorModel>() == model);
    }
Esempio n. 9
0
 public ArmorModel this[ArmorModelSlot slot]
 {
     get
     {
         if (this.awake)
         {
             return(this.models[slot]);
         }
         ArmorModelGroup armorModelGroups = this.defaultArmorModelGroup;
         if (!armorModelGroups)
         {
             return(null);
         }
         return(armorModelGroups[slot]);
     }
 }
Esempio n. 10
0
 public ArmorModel this[ArmorModelSlot slot]
 {
     get
     {
         if (this.awake)
         {
             return(this.models[slot]);
         }
         ArmorModelGroup defaultArmorModelGroup = this.defaultArmorModelGroup;
         if (defaultArmorModelGroup != null)
         {
             return(defaultArmorModelGroup[slot]);
         }
         return(null);
     }
 }
Esempio n. 11
0
    public ArmorModelSlotMask BindArmorGroup(ArmorModelGroup group)
    {
        ArmorModelSlotMask mask = (ArmorModelSlotMask)0;

        if (group)
        {
            for (ArmorModelSlot i = ArmorModelSlot.Feet; (int)i < 4; i = (ArmorModelSlot)((byte)i + (byte)ArmorModelSlot.Legs))
            {
                ArmorModel item = group[i];
                if (item && this.BindArmorModelCheckedNonNull(item))
                {
                    mask = mask | i.ToMask();
                }
            }
        }
        return(mask);
    }
Esempio n. 12
0
    public ArmorModelSlotMask BindArmorGroup(ArmorModelGroup group)
    {
        ArmorModelSlotMask mask = 0;

        if (group != null)
        {
            for (ArmorModelSlot slot = ArmorModelSlot.Feet; slot < ((ArmorModelSlot)4); slot = (ArmorModelSlot)(((int)slot) + 1))
            {
                ArmorModel model = group[slot];
                if ((model != null) && this.BindArmorModelCheckedNonNull(model))
                {
                    mask |= slot.ToMask();
                }
            }
        }
        return(mask);
    }
Esempio n. 13
0
    public ArmorModelSlotMask BindArmorGroup(ArmorModelGroup group, ArmorModelSlotMask slotMask)
    {
        if (!this.awake)
        {
            if (group == null)
            {
                return(0);
            }
            return(this.Initialize(group.armorModelMemberMap, slotMask));
        }
        ArmorModelSlotMask mask = 0;

        foreach (ArmorModelSlot slot in slotMask.EnumerateSlots())
        {
            ArmorModel model = group[slot];
            if ((model != null) && this.BindArmorModelCheckedNonNull(model))
            {
                mask |= slot.ToMask();
            }
        }
        return(mask);
    }
Esempio n. 14
0
    public ArmorModelSlotMask BindArmorGroup(ArmorModelGroup group, ArmorModelSlotMask slotMask)
    {
        if (!this.awake)
        {
            if (!group)
            {
                return(0);
            }
            return(this.Initialize(group.armorModelMemberMap, slotMask));
        }
        ArmorModelSlotMask mask = (ArmorModelSlotMask)0;

        ArmorModelSlot[] armorModelSlotArray = slotMask.EnumerateSlots();
        for (int i = 0; i < (int)armorModelSlotArray.Length; i++)
        {
            ArmorModelSlot armorModelSlot = armorModelSlotArray[i];
            ArmorModel     item           = group[armorModelSlot];
            if (item && this.BindArmorModelCheckedNonNull(item))
            {
                mask = mask | armorModelSlot.ToMask();
            }
        }
        return(mask);
    }
Esempio n. 15
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);
    }
Esempio n. 16
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);
    }