示例#1
0
    private void CycleLocalQueue()
    {
        var lastIndex = nextBubbles.Length - 1;
        var first     = nextBubbles[0];
        var firstType = nextTypes[0];

        for (var index = 0; index < lastIndex; index++)
        {
            nextBubbles[index] = nextBubbles[index + 1];
            nextTypes[index]   = nextTypes[index + 1];
        }

        nextTypes[lastIndex]   = firstType;
        nextBubbles[lastIndex] = first;

        for (var index = 0; index <= lastIndex; index++)
        {
            if (nextBubbles[index] != null)
            {
                MoveBubbleWithArc(index);
            }
        }

        SetShooterBubbleEvent.Dispatch(nextBubbles[0]);
    }
示例#2
0
    private void OnSetShooterBubble(SetShooterBubbleEvent gameEvent)
    {
        shooterBubble = gameEvent.bubble;

        if (currentAnimation != null)
        {
            UpdateAnimationTransform();
        }
    }
示例#3
0
 private void OnSetShooterBubble(SetShooterBubbleEvent gameEvent)
 {
     if (gameEvent.bubble != null)
     {
         if (modifiers.Count > 0)
         {
             OnAddShotModifier();
         }
         else
         {
             colors = new[] { gameEvent.bubble.GetComponent <BubbleModelBehaviour>().Model.definition.BaseColor };
         }
     }
 }
示例#4
0
    private void CreateBubbles()
    {
        var offset = new Vector3(0, -GlobalState.Instance.Config.bubbles.size / 2);

        for (var index = 0; index < nextBubbles.Length; index++)
        {
            if (nextBubbles[index] == null)
            {
                nextTypes[index]   = level.levelState.bubbleQueue.Peek(index);
                nextBubbles[index] = level.bubbleFactory.CreateByType(nextTypes[index]);

                nextBubbles[index].transform.SetParent(locations[index], false);
                nextBubbles[index].transform.position = locations[index].position + offset;
                nextBubbles[index].layer = (int)Layers.Default;

                StartCoroutine(MoveBubbleRoutine(nextBubbles[index].transform, locations[index], 0.0f));
            }
        }

        SetShooterBubbleEvent.Dispatch((nextBubbles.Length > 0) ? nextBubbles[0] : null);
    }
 private void OnSetShooterBubble(SetShooterBubbleEvent gameEvent)
 {
     shooterBubble = gameEvent.bubble;
 }