Exemple #1
0
 // Whenever a piece is being clicked/tapped
 private void OnMouseDown()
 {
     if (GameLogic.S.ValidPiecesToSelect(gameObject) && !locked)
     {
         //print("valid piece to move");
         followMouse = true;
         offset      = transform.position - Camera.main.ScreenToWorldPoint(Input.mousePosition);
         offset.z    = 0.0f;
         startTime   = Time.time;
         drag.StartLerpTime();
         positionSet = false;
     }
 }
Exemple #2
0
 private void OnMouseDown()
 {
     followMouse = true;
     drag.StartLerpTime();
     offset   = transform.position - Camera.main.ScreenToWorldPoint(Input.mousePosition);
     offset.z = 0.0f;
 }