Ejemplo n.º 1
0
    void showGetItemEffect(Vector2 originPosInGlobal, NewItem itemCopy)
    {
        GRoot.inst.AddChild(itemCopy);
        itemCopy.position     = GRoot.inst.GlobalToLocal(new Vector2(originPosInGlobal.x - itemCopy.width / 2, originPosInGlobal.y - itemCopy.height / 2));
        itemCopy.sortingOrder = 100;
        itemCopy.touchable    = false;
        itemCopy.alpha        = 0.4f;
        //GRoot.inst.AddChild (copyView);


        itemCopy.TweenFade(1, 0.8f).OnComplete(delegate() {
            itemCopy.TweenMove(new Vector2(0, GRoot.inst.height - itemCopy.height * 0.4f), 0.3f).OnUpdate(delegate(GTweener tweener) {
                itemCopy.InvalidateBatchingState();
                float r = (tweener.deltaValue.vec2 - tweener.startValue.vec2).magnitude / (tweener.endValue.vec2 - tweener.startValue.vec2).magnitude;
                r       = 1 - r * 0.6f;
                //r = r*0.6;
                itemCopy.scale = new Vector2(r, r);
            }).OnComplete(delegate() {
                itemCopy.TweenFade(0, 0.2f).OnComplete(delegate() {
                    GRoot.inst.RemoveChild(itemCopy);
                    itemCopy.Dispose();
                });
            });
        });
    }