public void MoveToWarpZone() { // Move to next zap grid m_NextRowIndicator.gameObject.SetActive(false); WarpZone newDeadZone = GameMaster.Instance.m_WarpZoneManager.SpawnDeadZone(); m_CurrZap = null; m_NextZap = null; m_NextCol = 0; m_CurrRow = 0; m_StartPosition = this.transform.position; m_TargetPosition = newDeadZone.transform.position; SetMovementState(MovementState.MovingToWarpZone); SetSpeedMultiplier(2.0f, false); m_LerpAmount = 0.0f; GameMaster.Instance.m_BackDropManager.ShowWarpStoreColors(); GameMaster.Instance.m_DadEventManager.StopEvents(); GameMaster.Instance.m_SolarSystemSpawner.StopSpawningSolarObjects(); // show flawless completion notification if grid completion flawless. StatsManager statsManager = GameMaster.Instance.m_StatsManager; if (statsManager && statsManager.GetFlawlessGridRun()) { UIManager uiManager = GameMaster.Instance.m_UIManager; if (uiManager) { uiManager.SpawnUINotification("+500 FLAWLESS RUN", true); statsManager.AddToScore(500); } } }
private void LateUpdate() { if (zone == WarpZone.spawn && GameManager.Level.IsTargetWithinPlayArea(this.transform.position)) { this.zone = WarpZone.play; } this.Warp(); }
private void MoveToDropEnd(WarpZone destination) { if (destination.postDropMove.steps == 0) { if (destination.postDropMove.direction != DIRECTION_BUTTON.NONE) { movementController.TriggerButtons(destination.postDropMove.direction, ACTION_BUTTON.NONE); } return; } if (!movementController.Move(destination.postDropMove.direction, destination.postDropMove.steps)) { Debug.LogWarning("!!! WARPER CANNOT BE MOVED"); } }
protected override void Awake() { base.Awake(); isPossible = startOnAwake; destinationWarpZone = destinationObject.GetComponent <WarpZone>(); }
public void AddWarpZone(Tile _a, Tile _b) { WarpZone warp = new WarpZone(_a, _b); warpZones.Add(warp); }
public void HandleInteractLeave(object sender, CollisionZoneEventArgs args) { interactBlock = null; }
public void HandleInteractEnter(object sender, CollisionZoneEventArgs args) { interactBlock = (WarpZone)sender; }
private void WarpToDropStart(WarpZone destination) { Vector2 coords = destination.dropZone.transform.position.AsVector2() + destination.dropZoneOffset; movementController.ClampPositionTo(new Vector3(coords.x, coords.y, 0)); }
protected override void Awake() { base.Awake(); isPossible = startOnAwake; destinationWarpZone = destinationObject.GetComponent<WarpZone>(); }