Beispiel #1
0
    public void StartDrag()
    {
        _dragDist     = Camera.main.WorldToScreenPoint(this.transform.position);
        _dragOffset.x = Input.mousePosition.x - _dragDist.x;
        _dragOffset.y = Input.mousePosition.y - _dragDist.y;

        this.transform.SetParent(null, true);
        isDragging = true;

        _dragNest = (GameObject)Instantiate(nestConvertDragPrefab, Vector3.zero, Quaternion.identity);
        _dragNest.transform.position = this.transform.position;
        var spriteRenderer = _dragNest.transform.FindChild("NestConvertDrag/nest").GetComponent <SpriteRenderer>();

        spriteRenderer.sprite = getColoredSprite();

        convertHolder.GetComponent <Animator>().SetBool("draggingNest", true);
        _maxHighlightPercent = 0.0f;


        //TODO: KIWI SFX
        //Genie.instance.LogEvent(OE_INTERACT.Create(OE_INTERACT.Type.DRAG, "gameplay.nestConvert");
        Genie.I.LogEvent(OE_INTERACT.Create(OE_INTERACT.Type.DRAG, "gameplay.nestConvert"));

        onesColumn.Unbuckle();

        UpdateDragging();
    }