예제 #1
0
    public void DisplayProfile(ProfileBase profile)
    {
        VarRef.Tag[] profile_tags = profile.GetTagArray();

        int rand_user_nr = Random.Range(10000, 99999);

        user_number.text = "User #" + rand_user_nr;

        //Determine profile image, gender text and age text
        if (profile_tags[0] == VarRef.Tag.GenWoman)
        {
            text_fields[0].text = "Female";

            if (profile_tags[1] == VarRef.Tag.AgeChild)
            {
                profile_image.sprite = RandBlankImg(image_assets[0], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Child";
            }
            else if (profile_tags[1] == VarRef.Tag.AgeAdult)
            {
                profile_image.sprite = RandBlankImg(image_assets[2], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Adult";
            }
            else if (profile_tags[1] == VarRef.Tag.AgeElderly)
            {
                profile_image.sprite = RandBlankImg(image_assets[4], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Elderly";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Female Age");
            }
        }
        else if (profile_tags[0] == VarRef.Tag.GenMan)
        {
            text_fields[0].text = "Male";

            if (profile_tags[1] == VarRef.Tag.AgeChild)
            {
                profile_image.sprite = RandBlankImg(image_assets[1], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Child";
            }
            else if (profile_tags[1] == VarRef.Tag.AgeAdult)
            {
                profile_image.sprite = RandBlankImg(image_assets[3], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Adult";
            }
            else if (profile_tags[1] == VarRef.Tag.AgeElderly)
            {
                profile_image.sprite = RandBlankImg(image_assets[5], profile_tags[1], profile_tags[2]);
                text_fields[1].text  = "Elderly";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Male Age");
            }
        }
        else
        {
            Debug.Log("ProfileManager: Error in profile data - Gender");
        }

        //Determine locaion text
        {
            if (profile_tags[2] == VarRef.Tag.LiveCity)
            {
                text_fields[2].text = "Lives in a city";
            }
            else if (profile_tags[2] == VarRef.Tag.LiveCountry)
            {
                text_fields[2].text = "Lives in the countryside";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Location");
            }
        }

        //Determine occupation text
        {
            if (profile_tags[3] == VarRef.Tag.OccStudent)
            {
                text_fields[3].text = "Student";
            }
            else if (profile_tags[3] == VarRef.Tag.OccEmployed)
            {
                text_fields[3].text = "Employed";
            }
            else if (profile_tags[3] == VarRef.Tag.OccUnemployed)
            {
                text_fields[3].text = "Unemployed";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Occupation");
            }
        }

        //Determine family text
        {
            if (profile_tags[4] == VarRef.Tag.FamSingle)
            {
                text_fields[4].text = "Single";
            }
            else if (profile_tags[4] == VarRef.Tag.FamInRelationship)
            {
                text_fields[4].text = "In a relationship";
            }
            else if (profile_tags[4] == VarRef.Tag.FamHasKids)
            {
                text_fields[4].text = "Has children";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Family");
            }
        }

        //Determine financial text
        {
            if (profile_tags[5] == VarRef.Tag.FinPoor)
            {
                text_fields[5].text = "Poor";
            }
            else if (profile_tags[5] == VarRef.Tag.FinMiddleClass)
            {
                text_fields[5].text = "Middle class";
            }
            else if (profile_tags[5] == VarRef.Tag.FinRich)
            {
                text_fields[5].text = "Rich";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Financial");
            }
        }

        //Determine search text
        {
            if (profile_tags[6] == VarRef.Tag.SearchFashion)
            {
                text_fields[6].text = "Fashion and apparel";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchParty)
            {
                text_fields[6].text = "Parties and festivities";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchOutdoor)
            {
                text_fields[6].text = "Outdoor activities";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchEatOut)
            {
                text_fields[6].text = "Restaurants and eating out";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchVacation)
            {
                text_fields[6].text = "Vacation and travel";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchIndoor)
            {
                text_fields[6].text = "Indoor activities";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchBusiness)
            {
                text_fields[6].text = "Business meeting activities";
            }
            else if (profile_tags[6] == VarRef.Tag.SearchVehicle)
            {
                text_fields[6].text = "Vehicles and machinery";
            }
            else
            {
                Debug.Log("ProfileManager: Error in profile data - Searched " + profile_tags[6]);
            }
        }
    }