private void Update() { intervalTimer += Time.deltaTime; if (intervalTimer >= interval) { intervalTimer = 0f; heatMap.AddPosition(Mathf.RoundToInt(Input.mousePosition.x), Mathf.RoundToInt(Input.mousePosition.y)); } if (Input.GetKeyDown(KeyCode.Space)) { var tex = heatMap.Export(heatmapGradient, radius); exportTarget.sprite = Sprite.Create(tex, new Rect(0f, 0f, tex.width, tex.height), new Vector2(.5f, .5f)); } }