// Update is called once per frame void Update() { if (TimerManager.instance == null) { return; } TimerManager.instance.Update(); if (!GameEngine.instance.cpuNode.gameObject.activeSelf) { return; } MemoryInformation memInfo = Rainity.GetMemoryInformation(); Ramt.text = Mathf.Round(memInfo.ramUsed / memInfo.ramTotal * 100).ToString() + "%"; RAM.fillAmount = memInfo.ramUsed / memInfo.ramTotal; // DiskInformation diskInfo = Rainity.GetDiskInformation("C:\\"); if (timer <= 0) { timer = 1f; var cpuUsage = GetCPUPercent() / 1000000f; cput.text = Mathf.Round(cpuUsage).ToString() + "%"; cpu.fillAmount = cpuUsage / 100; } timer -= Time.deltaTime; //var d = Rainity.GetWeatherInformation(); // Rainity.GetWallpaperImage(); //int x = 0; }
// Update is called once per frame void Update() { MemoryInformation memInfo = Rainity.GetMemoryInformation(); ramText.text = Mathf.Round(memInfo.ramUsed / memInfo.ramTotal * 100).ToString() + "%"; ramImage.fillAmount = memInfo.ramUsed / memInfo.ramTotal; vramText.text = Mathf.Round(memInfo.vRamUsed / memInfo.vRamTotal * 100).ToString() + "%"; vramImage.fillAmount = memInfo.vRamUsed / memInfo.vRamTotal; DiskInformation diskInfo = Rainity.GetDiskInformation("C:\\"); diskText.text = Mathf.Round((float)diskInfo.bytesFree / (float)diskInfo.bytesTotal * 100).ToString() + "%"; diskImage.fillAmount = (float)diskInfo.bytesFree / (float)diskInfo.bytesTotal; cpuText.text = Mathf.Round(Rainity.GetCPUUsagePercent()).ToString() + "%"; cpuImage.fillAmount = Rainity.GetCPUUsagePercent() / 100; }