Ejemplo n.º 1
0
 /// <summary>
 /// set image property from serializable class
 /// </summary>
 /// <param name="image"></param>
 /// <param name="imageProperty"></param>
 public void SetImageProperty(Image image, ImageProperty imageProperty, ImageEnum imageEnum)
 {
     if (imageProperty != null && imageProperty.sprite != null)
     {
         image.sprite = imageProperty.sprite;
         image.color  = imageProperty.color;
         image.type   = imageProperty.type;
     }
     else if (imageEnum == ImageEnum.CloseButton && _spawningHotspot.GetComponentInParent <HotspotController>().closeButton.sprite != null)
     {
         ImageProperty closeButton = _spawningHotspot.GetComponentInParent <HotspotController>().closeButton;
         image.sprite = closeButton.sprite;
         image.color  = closeButton.color;
         image.type   = closeButton.type;
     }
     else if (imageEnum != ImageEnum.None)
     {
         image.sprite = DefaultAssets._instance.GetImage(imageEnum);
         image.color  = Color.white;
         image.type   = Image.Type.Simple;
     }
     else
     {
         image.color = imageProperty.color;
     }
 }
 public ImagePropertyJSON(ImageProperty property)
 {
     this.imageUrl = property.imageUrl;
     this.color    = property.color;
     this.type     = property.type;
 }