У меня на машине все отлично работает. Но как позже оказалось, из 10-ти человек, которые тестили, у 4 не работал этот прогресс бар.
Вот исходный код:
Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class xxxx : MonoBehaviour {
public Texture circle;
public Texture circleProgress;
public Material mat;
void OnGUI () {
mat.SetFloat("_Cutoff", Mathf.InverseLerp(0, Screen.width, Input.mousePosition.x));
Graphics.DrawTexture(new Rect(183, 51, 20, 20), circleProgress, mat);
Graphics.DrawTexture(new Rect(171, 42, 48, 34), circle);
}
}
using System.Collections;
public class xxxx : MonoBehaviour {
public Texture circle;
public Texture circleProgress;
public Material mat;
void OnGUI () {
mat.SetFloat("_Cutoff", Mathf.InverseLerp(0, Screen.width, Input.mousePosition.x));
Graphics.DrawTexture(new Rect(183, 51, 20, 20), circleProgress, mat);
Graphics.DrawTexture(new Rect(171, 42, 48, 34), circle);
}
}
Материал Transparent Cutout.
Веб-версия для теста: http://oldskullent.com/project/clock/WebPlayer.html
Что посоветуете? Скорее всего это баг Юнити..