I am tasked with creating a progress bar using Unity’s GUI system. The way I am creating this GUI is that I made a background window and then I added a Texture2D that will represent the progress bar.
[30118-progressbar+issues.png|30118]
I got this showing on the screen during run time, which is good, but it spams an error message in my console window; it reads: Exception: not implemented and it points to a line of code found here: (I will go ahead and add the rest of my code)
using UnityEngine;
using System.Collections;
using Simulation;
using System;
[ExecuteInEditMode]
public class ProgressTracker : MonoBehaviour
{
//Singleton
public static ProgressTracker objectInstance;
//GUI Elements
public Rect GUIRectWindow; // the GUI background for the progress tracker
public Rect GUIRectProgressBar; // the GUI background for the progress tracker
public Texture2D m_texture; // draws our progress bar (I have a small white square)
private int _TotalGestureCount = 0;
private float percetange;
void Start()
{
if (objectInstance == null)
{
objectInstance = this;//keep using the same game object
DontDestroyOnLoad(gameObject);
}
else
Destroy(this);
percetange = 0;
_TotalTaskCount = TaskCollection._tasksSum;
}
// Update is called once per frame
void OnGUI()
{
if (!Application.isLoadingLevel)
{
percetange = (NewReferentManager.Get.CompletedTasks / _TotalTaskCount) * 100; //calculates the current percentage
GUI.Box(GUIRectWindow, "Progress: " + percetange.ToString() + "%");// outputs the percentage
GUI.DrawTexture(GUIRectProgressBar, m_texture);//draws our backdrop window
m_texture.width = (int)percetange; // THIS IS WHERE I AM GETTING THE ERROR
}
}
}
Can anyone help me figure out why I am getting this error? Thank you in advance!