Ejemplo n.º 1
0
    private void OnMouseDown()
    {
        iTween.ColorFrom(gameObject, new Color32(0, 140, 255, 255), 0.5f);
        switch (buttonType)
        {
        case ButtonType.Right:
            songsLoader.ShiftPlaneToNext();
            break;

        case ButtonType.Left:
            songsLoader.ShiftPlaneToPrevious();
            break;
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown("right"))
        {
            iTween.ColorTo(rightButton, new Color32(0, 140, 255, 255), 0.05f);
            songsLoader.ShiftPlaneToNext();
        }
        if (Input.GetKeyUp("right"))
        {
            iTween.ColorTo(rightButton, new Color32(255, 255, 255, 255), 0.5f);
        }

        if (Input.GetKeyDown("left"))
        {
            iTween.ColorTo(leftButton, new Color32(0, 140, 255, 255), 0.05f);
            songsLoader.ShiftPlaneToPrevious();
        }
        if (Input.GetKeyUp("left"))
        {
            iTween.ColorTo(leftButton, new Color32(255, 255, 255, 255), 0.5f);
        }
    }