示例#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
    public void ShowThumb()
    {
        ThumbBlur.SetActive(true);
        Thumb.SetActive(true);
        ThumbWhite.SetActive(true);
        TutorialBtnReact BtnReact = Hud.GetComponent <TutorialBtnReact>();
        GameObject       victim   = BtnReact.getVictim();
        //Debug.Log(victim);
        Parameters Parameters = victim.GetComponent <Parameters>();

        Delay = Parameters.Backfill; //backfill in seconds
        //Debug.Log(Delay);
    }
示例#3
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);
     }
 }
示例#4
0
 public void OnPointerUp(PointerEventData eventData)
 {
     ispressed  = false;
     RefillTime = ThumbWhite.GetComponent <Image>().color.a *Delay; //Reset from previous a
 }
示例#5
0
 public void OnPointerDown(PointerEventData eventData)
 {
     ispressed   = true;
     PressedTime = ThumbWhite.GetComponent <Image>().color.a * 2;
 }
示例#6
0
 // Update is called once per frame
 public void OnPointerClick(PointerEventData eventData)
 {
     Thumb.SetActive(false);
     ThumbWhite.SetActive(false);
     ThumbBlur.SetActive(false);
 }