Пример #1
0
    public void ShootBubble(Vector2 direction)
    {
        Vector2 shootDirection = GetTouchDistanceFromGivenObject(direction, transform.position);

        shootDirection *= StandardCoefficient(shootDirection);

        if (shootingSuperBubble)
        {
            //Debug.Log("shoot super power");
            superBubble.Move(shootDirection, finalPosition);
            shootingSuperBubble = false;
            selectedMoveableObj.DestroyMoveableObj();
            unSelectedMoveableObj.DestroyMoveableObj();
            StartCoroutine(SetMoveableObj(1));
            StartCoroutine(SetMoveableObj(2));
            superBubble = null;
        }
        else
        {
            selectedMoveableObj.Move(shootDirection, finalPosition);
            // swap
            selectedMoveableObj = unSelectedMoveableObj;
            selectedMoveableObj.ChangePosition(selectedMoveableObjPos, transform.position, false);
            StartCoroutine(SetMoveableObj(2));
        }
    }
Пример #2
0
    public void SwapBubble()
    {
        selectedMoveableObj.ChangePosition(unSelectedMoveableObjPos, transform.position, true);
        unSelectedMoveableObj.ChangePosition(selectedMoveableObjPos, transform.position, false);

        IMoveableAndHideable temp = null;

        temp = selectedMoveableObj;
        selectedMoveableObj   = unSelectedMoveableObj;
        unSelectedMoveableObj = temp;
        lastSelectedTag       = unSelectedMoveableObj.GetTag();
    }