public class MouseOverScroll : UIButton {
public enum Direction{Left, Right};
public Direction dir = Direction.Left;
public GameObject dragpanel;
UIDraggablePanel dps;
public bool pressed = false;
void Start () {
dps = dragpanel.GetComponent<UIDraggablePanel> ();
}
void Update() {
if(pressed) {
if (dir == Direction.Left) {
dps.SendMessage("Scroll", 0.5f);
}
else if (dir == Direction.Right) {
dps.SendMessage("Scroll", -0.5f);
}
}
}
public override void OnHover (bool isOver)
{
base.OnHover (isOver);
pressed = isOver;
}
}