public static MediaGallery CreateInstance(Profiable profiable, List <Sprite> images) { MediaGallery gallery = CreateInstance <MediaGallery>(); gallery.init(profiable, images); return(gallery); }
protected override void setAttributes() { if (gallery.getProfiable() != null) { Profiable profiable = gallery.getProfiable(); // set up gallery label label.text = profiable.getLabel() + " Gallery"; // set up profiable header switch (profiable.getTypeID()) { case DatabaseObject.DEPARTMENT: profiableHeader.text = "Department:"; break; case DatabaseObject.EMPLOYEE: profiableHeader.text = "Employee:"; break; default: break; } // set up profiable button profiableButton.setup(this, profiable); } // set up pictures if (gallery.getImages() != null) { if (gallery.getImages().Count == 0 || gallery.getImages()[0] == null) { noPicsLabel.gameObject.SetActive(true); } else { List <Sprite> images = gallery.getImages(); foreach (Sprite image in images) { Image imageHolder = Instantiate(imagePrefab, transform.position, Quaternion.identity) as Image; imageHolder.sprite = image; imageHolder.transform.SetParent(picturesParent.transform, true); } } } else { noPicsLabel.gameObject.SetActive(true); } }
public void setup(SearchManager searchManager, Profiable profiable, string keyword) { this.profiable = profiable; this.numExtraChars = Mathf.Abs(keyword.Length - profiable.getLabel().Length); switch (profiable.getTypeID()) { case DatabaseObject.DEPARTMENT: labelText.text = SearchManager.DEP; break; case DatabaseObject.EMPLOYEE: labelText.text = SearchManager.EMP; break; default: break; } databaseObjectButton.setup(searchManager, profiable); }
public void setProfiable(Profiable profiable) { this.profiable = profiable; this.label = profiable.getLabel() + " " + constantLabel; }
private void init(Profiable profiable, List <Sprite> images) { this.profiable = profiable; this.images = images; this.databaseObjectInit(constantLabel); }
// constructors private void init() { profiable = null; images = new List <Sprite>(); this.databaseObjectInit(constantLabel); }