Exemplo n.º 1
0
 public override void OnMouseDown(UIMouseButton b)
 {
     lx    = VInput.MX;
     ly    = VInput.MY;
     State = ButState.Press;
     UISys.Skin().ClickSound();
 }
Exemplo n.º 2
0
 public override void OnLeave()
 {
     if (Leave != null)
     {
         Leave(this, null);
     }
     State = ButState.Norm;
 }
Exemplo n.º 3
0
 public override void OnEnter()
 {
     if (Enter != null)
     {
         Enter(this, null);
     }
     State = ButState.Hover;
 }
Exemplo n.º 4
0
 public override void OnMouseUp(UIMouseButton b)
 {
     if (Click != null)
     {
         Click();
     }
     State = ButState.Norm;
     Event(new UIEvent(this, EventType.Click));
     lx = 0;
     ly = 0;
 }
Exemplo n.º 5
0
        public VTex2D StateImg(ButState bs)
        {
            VTex2D bi = null;

            switch (bs)
            {
            case ButState.Norm:
                bi = But_Norm;
                break;

            case ButState.Hover:
                bi = But_Hover;
                break;

            case ButState.Press:
                bi = But_Press;
                break;
            }

            return(bi);
        }
Exemplo n.º 6
0
    public void ButSizeUpdate()
    {
        Vector2 hight1 = new Vector2(1, 2.3f);
        Vector2 hight2 = new Vector2(1, 6);
        Vector2 hight3 = new Vector2(1, 9);

        if (Nstock == 0)
        {
            butState = ButState.State1;
        }
        if (Nstock == 1)
        {
            butState = ButState.State2;
        }
        if (Nstock == 2)
        {
            butState = ButState.State3;
        }



        switch (butState)
        {
        case ButState.State1:
            GetComponent <BoxCollider2D>().size = hight1;
            break;

        case ButState.State2:
            GetComponent <BoxCollider2D>().size = hight2;
            animator.SetTrigger("1to2");
            break;

        case ButState.State3:
            GetComponent <BoxCollider2D>().size = hight3;
            animator.SetTrigger("2to3");
            break;
        }
    }