Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        slots = new BubbleSlot[bubblesPerRow * boardHeightInBubbleRows];
        for (var i = 0; i < slots.Length; ++i)
        {
            slots[i] = new BubbleSlot();
        }

        hexagonSize = bubbleRadius / Mathf.Cos(Mathf.Deg2Rad * 30.0f);
        var hexagonHeight           = hexagonSize * 2;
        var hexagonVerticalDistance = hexagonHeight * 3 / 4;

        rightBoarder  = leftBoarder + bubbleRadius * bubblesPerRow * 2 + bubbleRadius;
        bottomBoarder = topBoarder - (boardHeightInBubbleRows - 1) * hexagonVerticalDistance - hexagonSize * 2;

        LoadBubblesFromFile(Path.Combine(Directory.GetCurrentDirectory(), "bubbles.txt"));
        ArrangeBubblesInSlots();

        ReloadCanon();
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        //score = GetComponent<Text>();
        slots = new BubbleSlot[bubblesPerRow * boardHeightInBubbleRows];
        for (var i = 0; i < slots.Length; ++i)
        {
            slots[i] = new BubbleSlot();
        }

        hexagonSize = bubbleRadius / Mathf.Cos(Mathf.Deg2Rad * 30.0f);
        var hexagonHeight           = hexagonSize * 2;
        var hexagonVerticalDistance = hexagonHeight * 3 / 4;

        rightBoarder  = leftBoarder + bubbleRadius * bubblesPerRow * 2 + bubbleRadius;
        bottomBoarder = topBoarder - (boardHeightInBubbleRows - 1) * hexagonVerticalDistance - hexagonSize * 2;

        LoadBubbles();

        ArrangeBubblesInSlots();

        ReloadCanon();
    }
Beispiel #3
0
 public void SetSlotLocation(BubbleSlot slot)
 {
     targetSlotLocation = slot;
 }