예제 #1
0
    private void OnMouseDown()
    {
        // Initialize the script by retrieving them from the ones attached to the game object
        moveAction    = GetComponent <IMoveItem>();
        mousePosition = GetComponent <IMousePosition>();

        rb.isKinematic = true;
        offset         = gameObject.transform.position - mousePosition.GetMousePosition();
        prevMousePos   = mousePosition.GetMousePosition();
    }
예제 #2
0
    IMousePosition mousePosition;                // Helps in getting the mouse position

    private void Awake()
    {
        // Initialize the script by retrieving them from the ones attached to the game object
        moveAction    = GetComponent <IMoveItem>();
        mousePosition = GetComponent <IMousePosition>();
    }