Quantcast
Viewing latest article 21
Browse Latest Browse All 60

increases the progress bar

  var progressbarempty : Texture2D;
  var progressbarfull : Texture2D;
  var progress : float = 0;

  function OnGUI()
  {
    GUI.DrawTexture(Rect(Screen.width*(0.3/6.55),Screen.height*(0.8/6.55),Screen.width*(0.4/6.55),Screen.height*(1.8/6.55)), progressbarempty);

    GUI.DrawTexture(Rect(Screen.width*(0.46/6.55),Screen.height*(2.52/6.55),Screen.width*(0.06/6.5  5),Screen.height*(1.23/6.55)* -Mathf.Clamp01(progress)), progressbarfull);   
  }

  function Update()
  {
    progress += 0.5 ; 
  }

Here my progress bar should increases depend on score. when my player answer a correct question he will get 10 marks.for every correct answer he will get 10 marks.when marks of the player increases my progress bar should also increases.

i want to increase the progress bar depend on the correct marks player get.

if he get 10 marks it should increase 0.03 in progress bar.

if he gets 30 marks it should increase 0.09 in progress bar.

like wise i want to increase the progress bar.how to make in this coding.


Viewing latest article 21
Browse Latest Browse All 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>