- Home /
Question by
Wiyanto · May 30, 2016 at 09:26 PM ·
c#unity 5error message
"fillamount" not appear!
Hello everyone, i have little problem.. i can't solve it. I'm totally newbie in c# and Unity!
in condition, i want to create radial loading bar, and see tutorial from youtube. but the problem is "fillamount" not appear! Whats is my problem?
"Assets/01_Scripts/02_Loading/LoadingARSkel.cs(29,55): error CS1061: Type
Image' does not contain a definition for fillAmount' and no extension method
fillAmount' of type Image' could be found (are you missing a using directive or an assembly reference?)
"
there is myscript!
LoadingScript.cs
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class LoadingScript : MonoBehaviour
{
public Transform RadialProgress;
public Transform NilaiLoading;
public Transform LoadingText;
[SerializeField]private float currentAmount;
[SerializeField]private float Kecepatan;
void Update ()
{
if (currentAmount < 100)
{
currentAmount += Kecepatan * Time.deltaTime;
NilaiLoading.GetComponent<Text>().text = ((int)currentAmount).ToString()+"%";
LoadingText.gameObject.SetActive(true);
}
else
{
LoadingText.gameObject.SetActive(false);
NilaiLoading.GetComponent<Text>().text="Selesai!";
Application.LoadLevel("SceneLanjut");
}
RadialProgress.GetComponent<Image> ().fillAmount = currentAmount / 100;
}
}
Comment