示例#1
0
    public void LoadCollectInfo(string collectId)
    {
        CollectDataHost.LoadXmlData(collectId);         //FIXME not sure if this should be called from this script
//		CollectDataHost.DebugCollectionStruct();

        Debug.Log("Should be loading");

        guiInfoPanel.SetActive(true);

        InstantFieldData(CollectDataHost.CollectionTitle, titleGroup);
        identifierText.text = CollectDataHost.CollectionIdentifier;
        InstantFieldData(CollectDataHost.CollectionCreator, creatorGroup);
        InstantFieldData(CollectDataHost.CollectionContributor, contributorGroup);
        InstantFieldData(CollectDataHost.CollectionDate, dateGroup);
        InstantFieldData(CollectDataHost.CollectionCoverage, coverageGroup);
        InstantFieldData(CollectDataHost.CollectionSubject, subjectGroup);
        descriptionText.text = CollectDataHost.CollectionDescription;
    }
示例#2
0
    /// <summary>
    /// Goes through field attributes and pulls data from their text objects to be returned as a list
    /// Only to be used from the Attribute Field panel save button (NOT main menu save)
    /// </summary>
    /// <param name="attrName">Name of the current attribute</param>
    /// <param name="fieldAttribute">Attribute gameobject assigned via editor</param>
    /// <param name="attributeList">List of attribute value(s) to be returned</param>
    public void GenerateFieldLists()     //string attrName, GameObject fieldAttribute, out List<string> attributeList
    {
        for (int i = 0; i < collectionFields.Length; i++)
        {
            List <string> attributeFieldContent = new List <string>();

            string attrName = collectionFields[i].name;

            for (int j = 0; j < collectionFields[i].transform.childCount; j++)             //cycle through all of the attribute's fields
            {
                GameObject attrChild = collectionFields[i].transform.GetChild(j).gameObject;
                if (attrChild.name == attrName + "_FieldGroup")
                {
                    for (int k = 0; k < attrChild.transform.childCount; k++)
                    {
                        GameObject fieldGroupChild = attrChild.transform.GetChild(k).gameObject;
                        if (fieldGroupChild.name == attrName + "_FieldAttr")
                        {
                            for (int l = 0; l < fieldGroupChild.transform.GetChild(0).transform.childCount; l++)
                            {
                                GameObject fieldAttrChild = fieldGroupChild.transform.GetChild(0).transform.GetChild(l).gameObject;
                                if (fieldAttrChild.name == "Text")
                                {
                                    string fieldAttrChildText = fieldAttrChild.GetComponent <Text>().text;
                                    if (fieldAttrChildText.Length > 0)                                     //if user has assigned input add it to the list
                                    {
                                        attributeFieldContent.Add(fieldAttrChildText);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (attrName == "Title")
            {
                CollectDataHost.CollectionTitle = attributeFieldContent;
            }
            else if (attrName == "Identifier")
            {
                collectionId = CollectDataHost.CollectionIdentifier;
                CollectDataHost.CollectionIdentifier = attributeFieldContent[0];
            }
            else if (attrName == "Creator")
            {
                CollectDataHost.CollectionCreator = attributeFieldContent;
            }
            else if (attrName == "Contributor")
            {
                CollectDataHost.CollectionContributor = attributeFieldContent;
            }
            else if (attrName == "Date")
            {
                CollectDataHost.CollectionDate = attributeFieldContent;
            }
            else if (attrName == "Coverage")
            {
                CollectDataHost.CollectionCoverage = attributeFieldContent;
            }
            else if (attrName == "Subject")
            {
                CollectDataHost.CollectionSubject = attributeFieldContent;
            }
            else if (attrName == "Description")
            {
                CollectDataHost.CollectionDescription = attributeFieldContent[0];
            }
        }
        CollectDataHost.DebugCollectionStruct();
        SaveCollectionData();
    }
示例#3
0
 public void loadCollection()
 {
     Application.LoadLevel("MetaPipe_CollectionScene");
     collectButton.interactable = false;
     CollectDataHost.ResetSaveData();
 }