Example #1
0
        public static void UpdatePartLabelText(LabelTextGroup textGroup)
        {
            PartInfo part = textGroup.partList.parts[textGroup.partList.index];

            textGroup.labelTMP.text = part.partDisplayName + " (" + (textGroup.partList.index + 1).ToString() + "/" + textGroup.partList.parts.Count.ToString() + ")";

            string[] partInfo = part.partReferenceName.Split('.');
            textGroup.hoverHint.text = "Author : " + partInfo[0] + "\nPart Bundle : " + partInfo[1];
        }
Example #2
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());;
        }