Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        initialPosition = this.transform.position;

        singleTap.Tapped += (object sender, System.EventArgs e) =>
        {
            lootmanager.showDetailPanel(this);
        };

        transformGesture.TransformStarted += (object sender, System.EventArgs e) =>
        {
            if (lootType == 2)
            {
                lootmanager.showGambleBag(true);
            }

            boxCollider.size = new Vector3(0.2f, 0.2f, 0.2f);
        };

        transformGesture.Transformed += (object sender, System.EventArgs e) =>
        {
            this.transform.position += transformGesture.DeltaPosition;
        };

        transformGesture.TransformCompleted += (object sender, System.EventArgs e) =>
        {
            if (isIllegal)
            {
                this.transform.position = initialPosition;
                boxCollider.size        = new Vector3(1.84f, 2.0f, 0.2f);

                if (lootType == 2)
                {
                    lootmanager.showGambleBag(false);
                }
            }
            else
            {
                lootmanager.showConfirmPanel(this);
            }
        };
    }