示例#1
0
 private void SetupPartsFromExisting()
 {
     if (existingArmor != null)
     {
         armorTypeIndex = (int)existingArmor.armorType;
         armorParts     = GetArmorParts(armorTypes[armorTypeIndex]);
         activePartID   = new int[armorParts.Count];
         for (int i = 0; i < activePartID.Length; i++)
         {
             activePartID[i]      = existingArmor.armorParts[i].partID;
             armorParts[i].partID = activePartID[i];
             if (armorParts[i].partID > -1)
             {
                 characterManager.ActivatePart(armorParts[i].bodyType, armorParts[i].partID);
             }
         }
     }
 }
示例#2
0
        private void SetupIconPreview(CustomPreviewEditor preview)
        {
            iconWindow.OnPreviewCreated -= SetupIconPreview;

            ModularCharacterManager iconCharacter = preview.TargetObject.GetComponent <ModularCharacterManager>();

            iconCharacter.SwapGender(currentGender);
            iconCharacter.ToggleBaseBodyDisplay(false);
            foreach (var part in armorParts)
            {
                if (part.partID > -1)
                {
                    iconCharacter.ActivatePart(part.bodyType, part.partID);
                    for (int i = 0; i < armorColors.Length; i++)
                    {
                        iconCharacter.SetPartColor(part.bodyType, part.partID, armorColors[i].property, armorColors[i].color);
                    }
                }
                else
                {
                    iconCharacter.DeactivatePart(part.bodyType);
                }
            }
        }