public void DrawImageToScreen(string imageName, int x, int y) { DrawQueue.Enqueue(() => { Drawables[imageName].X = x; Drawables[imageName].Y = y; lock (SyncObj) TextureDictionary[imageName].Apply(false); if (!IsIngameImage(imageName)) { //TODO: Avoid shifting cost. //Remove from the list and then re-add //so that freshly updated textures are forced on top. DrawablesList.Remove(Drawables[imageName]); DrawablesList.Add(Drawables[imageName]); } else { //TODO: Avoid shifting cost. //Remove from the list and then re-add //so that freshly updated textures are forced on top. InGameDrawablesList.Remove(Drawables[imageName]); InGameDrawablesList.Add(Drawables[imageName]); } }); }
public void DrawImageToScreen(string imageName, int x, int y) { //WebGL doesn't need to defer this to a different thread. if (RsUnityPlatform.isWebGLBuild) { UpdateDrawableTexture(imageName, x, y); } else { DrawQueue.Enqueue(() => { UpdateDrawableTexture(imageName, x, y); }); } }