Beispiel #1
0
    protected override void setAttributes()
    {
        // set up department label
        label.text = department.getLabel();

        // set up description
        description.text = department.getDescription();

        // set up gallery button
        if (department.getGallery() != null)
        {
            galleryButton.setup(this, department.getGallery());
        }

        // set up divisions
        if (department.getDivisions() != null)
        {
            List <Division> divisions = department.getDivisions();
            foreach (Division division in divisions)
            {
                DatabaseObjectButton divisionButton = Instantiate(databaseObjectButtonPrefab, transform.position, Quaternion.identity) as DatabaseObjectButton;
                divisionButton.setup(this, division);
                divisionButton.transform.SetParent(divisionsParent.transform, true);
            }
        }

        // set up location button
        if (department.getLocationImage() != null)
        {
            locationButton.setup(profileManager, department.getLocationImage());
        }
    }
Beispiel #2
0
    protected override void setAttributes()
    {
        // set up employee label
        label.text = employee.getLabel();

        // set up role button
        if (employee.getRole() != null)
        {
            roleButton.setup(this, employee.getRole());
        }

        // set up gallery button
        if (employee.getGallery() != null)
        {
            galleryButton.setup(this, employee.getGallery());
        }

        // set up divisionButton
        if (employee.getDivision() != null)
        {
            divisionButton.setup(this, employee.getDivision());
        }

        // set up departmentButton
        if (employee.getDepartment() != null)
        {
            departmentButton.setup(this, employee.getDepartment());
        }


        // set up hobbies
        if (employee.getHobbies() != null && !employee.getHobbies().Equals(""))
        {
            hobbiesText.text = employee.getHobbies();
        }
        else
        {
            hobbiesText.text = "N/A";
        }

        // set up location button
        locationButton.setup(profileManager, employee.getLocationImage());

        // set up email text
        if (employee.getEmail() != null)
        {
            emailText.text = employee.getEmail();
        }

        // set up profile pic
        if (employee.getProfilePic() != null)
        {
            profilePic.sprite = employee.getProfilePic();
        }
        else
        {
            profilePic.sprite = Resources.Load <Sprite>("Sprites/GallerySprites/Default");
        }
    }