Exemple #1
0
    void CheckTouch3(Vector3 pos)
    {
        Vector3 wp = Camera.main.ScreenToWorldPoint(pos);

        hit3 = Physics2D.OverlapPoint(new Vector2(wp.x, wp.y));

        if (hit3 != null && hit3.gameObject.name == "$.99 Button(Clone)" && instantiatedPressedButton != null && name == "$.99 Button(Clone)")
        {
            StoreAssets.BuyFiveThousandCoinPack();
        }

        else if (hit3 != null && hit3.gameObject.name == "$2.99 Button(Clone)" && instantiatedPressedButton != null && name == "$2.99 Button(Clone)")
        {
            StoreAssets.BuyTwentyThousandCoinPack();
        }

        else if (hit3 != null && hit3.gameObject.name == "$4.99 Button(Clone)" && instantiatedPressedButton != null && name == "$4.99 Button(Clone)")
        {
            StoreAssets.BuyFiftyThousandCoinPack();
        }

        else if (hit3 != null && hit3.gameObject.name == "$9.99 Button(Clone)" && instantiatedPressedButton != null && name == "$9.99 Button(Clone)")
        {
            StoreAssets.BuyOneHundredTwentyFiveThousandCoinPack();
        }

        else if (hit3 != null && hit3.gameObject.name == "$19.99 Button(Clone)" && instantiatedPressedButton != null && name == "$19.99 Button(Clone)")
        {
            StoreAssets.BuyThreeHundredThousandCoinPack();
        }

        else if (hit3 != null && hit3.gameObject.name == "$49.99 Button(Clone)" && instantiatedPressedButton != null && name == "$49.99 Button(Clone)")
        {
            StoreAssets.BuyOneMillionCoinPack();
        }



        if (instantiatedPressedButton != null)
        {
            soundHandler.PlayButtonClickUp();
            Destroy(instantiatedPressedButton);
        }
    }