forked from olie304/UnturnedScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebImage.cs
37 lines (30 loc) · 1.18 KB
/
WebImage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using UnityEngine;
namespace SDG.Unturned
{
// Not sure if this works but if it does it should load an image file at a URL into the targetImage
// which might be usable in a renderer or material.
// isExpanded, targetLayout and targetButton can be left Null as they don't do anything useful.
// Using animation events you might be able to call the setAddressAndRefresh and Refresh methods.
public class WebImage : MonoBehaviour
{
// Load image at URL
public void setAddressAndRefresh(string newURL, bool newShouldCache, bool forceRefresh)
{
}
// Refresh image
public void Refresh()
{
}
// Must have image set here, it will be replaced when image at URL is loaded
public Image targetImage;
public string url;
public bool shouldCache = true;
// Not really useful for anything
public Button targetButton;
public LayoutElement targetLayout;
public bool isExpanded;
// Ignore these. If you can access them you can use them in a material though I doubt it.
protected Texture2D texture;
protected Sprite sprite;
}
}