private IEnumerator Start() { var plugin = new MemoryInfoPlugin(); while (true) { var info = plugin.GetMemoryInfo(); _text.text = string.Format("{0}/{1} KB ({2}%)", info.UsedSize, info.TotalSize, (int)(100f * info.UsedSize / info.TotalSize)); yield return(new WaitForSeconds(1.0f)); } }
void IInitializable.Initialize() { if (!_settings.Memory) { return; } Observable .Interval(TimeSpan.FromSeconds(_settings.MemoryUpdateInterval)) .Subscribe(_ => _onInfo.OnNext(_plugin.GetMemoryInfo())) .AddTo(_disposable); }