InstanceFinder
public class MyButton : MonoBehaviour
{
public Image ButtonImage;
/* It wouldn't make sense to update the UI
* color on the server since it will have
* no graphical interface. To save performance
* we're only going to update color if client.
* However, since this is a MonoBehaviour class
* you do not have access to base.IsClientStarted.
* Instead the InstanceFinder may be used. */
private void SetColor(Color c)
{
if (InstanceFinder.IsClientStarted)
ButtonImage.color = c;
}
}Last updated