Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     //ThumbWhite.SetActive(false);
     //ThumbBlur.SetActive(false);
     temp   = ThumbWhite.GetComponent <Image>().color;
     temp.a = 0.0f;
     ThumbWhite.GetComponent <Image>().color = temp;
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     temp = ThumbWhite.GetComponent <Image>().color;
     if (ispressed)
     {
         PressedTime += Time.deltaTime;
         temp.a       = Mathf.Min(PressedTime / 2, 1.0f);//2 seconds until white
         //Debug.Log("changing alpha");
         ThumbWhite.GetComponent <Image>().color = temp;
     }
     else if (temp.a > 0)
     {
         RefillTime -= Time.deltaTime;
         //Debug.Log(temp.a);
         //Debug.Log(Delay);
         temp.a = Mathf.Max(RefillTime / Delay, 0.0f);
         //Debug.Log(temp.a);
         ThumbWhite.GetComponent <Image>().color = temp;
         //Debug.Log(temp);
     }
 }
Пример #3
0
 public void OnPointerUp(PointerEventData eventData)
 {
     ispressed  = false;
     RefillTime = ThumbWhite.GetComponent <Image>().color.a *Delay; //Reset from previous a
 }
Пример #4
0
 public void OnPointerDown(PointerEventData eventData)
 {
     ispressed   = true;
     PressedTime = ThumbWhite.GetComponent <Image>().color.a * 2;
 }