public void OnCubeClicked() { print("scan"); int rand = UnityEngine.Random.Range(1, 100); if (rand <= 50) { print(0); spriteImage.sprite = ResultImages[3]; } else if (rand <= 80 && rand > 50) { print(20); spriteImage.sprite = ResultImages[0]; ResourceValue = 20; } else if (rand <= 90 && rand > 80) { print(50); spriteImage.sprite = ResultImages[1]; ResourceValue = 50; } else if (rand > 90) { print(100); spriteImage.sprite = ResultImages[2]; ResourceValue = 100; } clicked = true; cs.ScanChanceCount--; cs.UpdateChanceAndReources(); }