I wanted to get something like a progress bar in Unity for which I used Handles.drawsolidarc. The code is working fine but if I place any game object in front of it (in terms of the Z coordinate), when running the project anything in front of it comes behind. If I want to place progress bar behind sphere what should I do?
I have attached the following script to an empty game object to draw the progress bar :
using UnityEngine;
using System.Collections;
using UnityEditor;
public class circledraw : MonoBehaviour {
int angle = 180;
int radius = 100;
int angle2 = 0;
int angle3 = 0;
// Use this for initialization
void Start () {
}
void OnDrawGizmos()
{
Handles.color = Color.cyan;
Handles.DrawSolidArc (new Vector3 (0, 0, 0),new Vector3 (0, 0, 1), new Vector3 (1, 0, 0),angle, radius);
}
void Update () {
}
}
Link to Picture :
The sphere is in front of the semicircle ( z coordinates )