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; }
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; }
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); }
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); }