Ejemplo n.º 1
0
        public void Init(int power)
        {
            var bubbleDataIndex = Settings.Bubbles.FindIndex(x => x.number == Bubble.GetNumber(power));

            if (bubbleDataIndex == -1)
            {
                return;
            }

            var bubbleData = Settings.Bubbles[bubbleDataIndex];

            back.color   = bubbleData.backColor;
            border.color = bubbleData.borderColor;
        }
Ejemplo n.º 2
0
        private void OnCurrentPowerChanged(int currentPower)
        {
            var bubbleDataIndex = settings.Bubbles.FindIndex(x => x.number == Bubble.GetNumber(sessionController.BubblesController.CurrentPower));

            if (bubbleDataIndex == -1)
            {
                return;
            }

            var color = settings.Bubbles[bubbleDataIndex].backColor;

            color.a        = (byte)(renderer.color.a * 255);
            renderer.color = color;
        }
Ejemplo n.º 3
0
        private void OnStartRaycasting()
        {
            var bubbleDataIndex = settings.Bubbles.FindIndex(x => x.number == Bubble.GetNumber(sessionController.BubblesController.CurrentPower));

            if (bubbleDataIndex == -1)
            {
                return;
            }

            var color = settings.Bubbles[bubbleDataIndex].backColor;

            color.a        = (byte)(renderer.color.a * 255);
            renderer.color = color;
            gameObject.SetActive(true);
        }
Ejemplo n.º 4
0
        private void OnMerge(MergeInfo info)
        {
            var bubbleSettingsIndex = bubbleSettings.Bubbles.FindIndex(x => x.number == Bubble.GetNumber(info.power));

            if (bubbleSettingsIndex == -1)
            {
                return;
            }

            var bubbleData = bubbleSettings.Bubbles[bubbleSettingsIndex];

            var effect = effectsPool.GetOrInstantiate(MERGE_EFFECT_ID);

            effect.transform.position = sessionController.BubblesController.GetGlobalSpawnPosition(info.x, info.y);

            effect.SetColor(bubbleData.backColor);
            effect.Init(effectsPool);
        }