コード例 #1
0
 private void OnMouseUp()
 {
     isBeingHeld = false;
     VFXPlayer.PlaySound("drop");
     TetriminoPlaceSignal.Dispatch(this.gameObject);
     this.gameObject.transform.localPosition = new Vector3(TetriminoPieceModel.spawPoint[number].x, TetriminoPieceModel.spawPoint[number].y, 0);
 }
コード例 #2
0
    private void OnMouseDown()
    {
        VFXPlayer.PlaySound("click");
        Vector3 mousePos = Input.mousePosition;

        mousePos    = Camera.main.ScreenToWorldPoint(mousePos);
        startPosX   = mousePos.x - this.transform.localPosition.x;
        startPosY   = mousePos.y - this.transform.localPosition.y;
        isBeingHeld = true;
        if (this.gameObject.transform.localPosition == TetriminoPieceModel.spawPoint[0])
        {
            number = 0;
        }
        if (this.gameObject.transform.localPosition == TetriminoPieceModel.spawPoint[1])
        {
            number = 1;
        }
        if (this.gameObject.transform.localPosition == TetriminoPieceModel.spawPoint[2])
        {
            number = 2;
        }
    }