public void StartFade(bool withRandomStartOffset, FadeType fadeType) { AnimationCfg animCfg = Root.Instance.ConfigManager.Animation; if (withRandomStartOffset) { Vector2 randomUnitCircle = UnityEngine.Random.insideUnitCircle.normalized * animCfg.textFloatRandomOffsetRadius; rectTransform.localPosition += new Vector3(randomUnitCircle.x, randomUnitCircle.y, 0); } textLabel.DOFade(0, animCfg.textChangeFloatDuration); switch (fadeType) { case FadeType.MoveUp: float targetY = rectTransform.localPosition.y + animCfg.textChangeFloatOffsetY; rectTransform.DOLocalMoveY(targetY, animCfg.textChangeFloatDuration).SetEase(animCfg.textChangeFloatEase) .OnComplete(() => OnFadeCompleted()); break; case FadeType.ZoomIn: float targetScale = rectTransform.localScale.x * animCfg.textChangeZoomInScale; rectTransform.DOScale(targetScale, animCfg.textChangeFloatDuration).SetEase(animCfg.textChangeFloatEase) .OnComplete(() => OnFadeCompleted()); break; default: Debug.LogError($"Unknown fade type {fadeType}"); break; } }
public void Init() { this.bubblesConfig = Root.Instance.ConfigManager.Bubbles; this.animationCfg = Root.Instance.ConfigManager.Animation; this.gridConfig = Root.Instance.ConfigManager.Grid; grid = new Bubble[gridConfig.gridWidth, gridConfig.gridHeight]; bubbleOutline.transform.localScale = new Vector3(gridConfig.BubbleSize, gridConfig.BubbleSize, 1); FinishTurn(); }
public void Init() { this.grid = Root.Instance.Grid; this.bubblesConfig = Root.Instance.ConfigManager.Bubbles; this.animationCfg = Root.Instance.ConfigManager.Animation; this.gridConfig = Root.Instance.ConfigManager.Grid; altBubbleOffset = Vector3.left * gridConfig.BubbleSize * 1.25f; distanceFromCamera = Vector3.Distance(muzzlePoint.position, Camera.main.transform.position); layerWalls = LayerMask.NameToLayer("Walls"); layerBubbles = LayerMask.NameToLayer("Bubbles"); Root.Instance.UI.OnGamePauseShown += UI_OnGamePauseShown;; LoadGun(); }
private void Start() { DOTween.SetTweensCapacity(500, 50); animationCfg = Root.Instance.ConfigManager.Animation; bubblesConfig = Root.Instance.ConfigManager.Bubbles; Root.Instance.BubbleCreator.Init(); Root.Instance.Grid.Init(); Root.Instance.Grid.OnBubblesMerged += OnBubblesMerged; Root.Instance.Grid.OnNothingMergedTurn += OnNothingMergedTurn; Root.Instance.Grid.OnGridCleared += () => OnGridCleared(); Root.Instance.Grid.OnMergeCombo += (mergeCombo) => OnMergeCombo(mergeCombo); Root.Instance.Gun.Init(); }
private void Awake() { this.animationCfg = Root.Instance.ConfigManager.Animation; this.bubblesConfig = Root.Instance.ConfigManager.Bubbles; }