コード例 #1
0
ファイル: Product.cs プロジェクト: civalice/OryorSmartApp
    // Update is called once per frame
    void Update()
    {
        if (!isClickable || Game6Controller.GetInstance().IsPause())
        {
            return;
        }
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();
        var     isHit     = GetComponent <Collider2D>().OverlapPoint(pos);

        if (TouchDown && isHit)
        {
            Game6Controller.GetInstance().StartDrag(this);
        }
    }
コード例 #2
0
ファイル: Tile.cs プロジェクト: civalice/OryorSmartApp
    // Update is called once per frame
    void Update()
    {
        bool    TouchDown = TouchInterface.GetTouchDown();
        bool    TouchUp   = TouchInterface.GetTouchUp();
        Vector2 pos       = TouchInterface.GetTouchPosition();
        var     isHit     = GetComponent <Collider2D>().OverlapPoint(pos);

        if (isHit)
        {
            isSelected = true;
            Game6Controller.GetInstance().SetSelectTile(this);
        }
        else if (isSelected)
        {
            isSelected = false;
            Game6Controller.GetInstance().DeselectTile(this);
        }
    }