コード例 #1
0
ファイル: HealthBar.cs プロジェクト: jakji93/RPG_script
 // Update is called once per frame
 void Update()
 {
     if (healthComponent.GetAlreadyDead() || Mathf.Approximately(healthComponent.GetPercentage() / 100, 1))
     {
         rootCanvas.enabled = false;
         return;
     }
     rootCanvas.enabled    = true;
     foreground.localScale = new Vector3(healthComponent.GetPercentage() / 100, 1, 1);
 }