Ejemplo n.º 1
0
        static void AddPartToList(PartBundleDescriptor partBundleDesc, PartDescriptor partDesc)
        {
            PartEditor.PartList partList = null;

            //add to the right list
            switch (partDesc.partType)
            {
            case (PartInfo.PartType.Blade):
                partList = PartEditor.BladeList;
                break;

            case (PartInfo.PartType.Guard):
                partList = PartEditor.GuardList;
                break;

            case (PartInfo.PartType.FingerGuard):
                partList = PartEditor.GuardList;
                break;

            case (PartInfo.PartType.Handle):
                partList = PartEditor.HandleList;
                break;

            case (PartInfo.PartType.Pommel):
                partList = PartEditor.PommelList;
                break;

            case (PartInfo.PartType.Accessory):
                partList = PartEditor.AccAList;
                break;
            }

            //create part key
            string partRefName = partBundleDesc.partBundleAuthor + "." + partBundleDesc.partBundleName + "." + partDesc.partType.ToString() + "." + partDesc.partName;

            foreach (PartInfo part in partList.parts)
            {
                if (part.partReferenceName == partRefName)
                {
                    Logger.log.Debug("A part with the name " + part.partReferenceName + " has already been added - skipping. Make sure all part and bundle names are unique!");
                    return;
                }
            }

            PartInfo newPart = new PartInfo(partDesc.partType, partDesc.gameObject, partRefName, partDesc.partDisplayName);

            partList.parts.Add(newPart);
            Logger.log.Debug("Added " + partRefName + " to the list of " + partDesc.partType.ToString());;
        }
Ejemplo n.º 2
0
        void IteratePartDescriptorMaterials(PartDescriptor partDesc)
        {
            foreach (GameObject partObj in partDesc.glowMatObjects)
            {
                SetMaterial(partObj, PartEditor.GlowList.mats[PartEditor.GlowList.index].material);
            }

            foreach (GameObject partObj in partDesc.secondaryMatObjects)
            {
                SetMaterial(partObj, PartEditor.SecondaryList.mats[PartEditor.SecondaryList.index].material);
            }

            foreach (GameObject partObj in partDesc.tertiaryMatObjects)
            {
                SetMaterial(partObj, PartEditor.TertiaryList.mats[PartEditor.TertiaryList.index].material);
            }

            foreach (GameObject partObj in partDesc.namePlateMatObjects)
            {
                SetMaterial(partObj, PartEditor.NamePlateList.mats[PartEditor.NamePlateList.index].material);
            }
        }