private void MoveWalls(Direction direction) { var move = Vector3.zero; float gameSpeedExp = MyLibrary.LinearToExponential(0, 1f, 10, PMWrapper.speedMultiplier); if (direction == Direction.Up) { move = Vector3.up * Time.deltaTime * gameSpeedExp * WallSpeed; } else if (direction == Direction.Down) { move = Vector3.down * Time.deltaTime * gameSpeedExp * WallSpeed; } Walls.transform.Translate(move); if (direction == Direction.Up && Walls.transform.localPosition.z > 0.2f) { isRasingWalls = false; isCharging = true; } else if (direction == Direction.Down && Walls.transform.localPosition.z < -0.3f) { isLoweringWalls = false; PMWrapper.UnpauseWalker(); } }
public void InputSubmitted(string submitedText) { LatestReadInput = submitedText; if (labelObject != null) { labelObject.GetComponent <InputLabel>().BubbleImage.sprite = InputLabelPlain; } valueObject.GetComponent <InputValue>().BubbleImage.sprite = InputValuePlain; CodeWalker.SubmitInput.Invoke(submitedText, CodeWalker.CurrentScope); PMWrapper.UnpauseWalker(); }
void Update() { float gameSpeedExp = MyLibrary.LinearToExponential(0, 0.5f, 5, PMWrapper.speedMultiplier); if (IsUnloading && !PMWrapper.IsCompilerUserPaused) { transform.Translate(-transform.up * UnloadingSpeed * gameSpeedExp); } if (transform.position.y > 7) { PMWrapper.UnpauseWalker(); Destroy(gameObject); } }
private void Update() { if (!isMoving) { return; } transform.position += transform.up * Time.deltaTime * PMWrapper.speedMultiplier * PlayerSpeed; // Calculate differance in distance without sqrt if (Mathf.Pow(transform.position.x - lastPosition.x, 2) + Mathf.Pow(transform.position.y - lastPosition.y, 2) > Mathf.Pow(CityGrid.DistanceBetweenPoints, 2)) { transform.position = lastPosition + transform.up * CityGrid.DistanceBetweenPoints; isMoving = false; lastPosition = transform.position; PMWrapper.UnpauseWalker(); } }
void Update() { if (isScanning) { float gameSpeedExp = MyLibrary.LinearToExponential(0, 0.5f, 5, PMWrapper.speedMultiplier); Vector3 targetDir = targetPos - scanner.position; float step = speed * gameSpeedExp * Time.deltaTime; Vector3 newDir = Vector3.RotateTowards(scanner.forward, targetDir, step, 0); scanner.rotation = Quaternion.LookRotation(newDir); if (Vector3.Angle(scanner.forward, targetDir) < 5) { DisableScanner(); int timeActivated = Mathf.Max(1, Mathf.CeilToInt(4 * (1 - PMWrapper.speedMultiplier))); StartCoroutine(ActivateDisplayForSeconds(timeActivated)); PMWrapper.UnpauseWalker(); } } }
private void Update() { if (isMovingByAnimation) { if (PMWrapper.IsCompilerUserPaused) { animator.speed = 0; } else { float gameSpeedExp = MyLibrary.LinearToExponential(0, 0.5f, 5, PMWrapper.speedMultiplier); animator.speed = AnimationSpeed * gameSpeedExp; } if (!AnimatorIsPlaying() && OperationsRunning == 1) { PMWrapper.UnpauseWalker(); isMovingByAnimation = false; OperationsRunning = 0; } } if (isMovingByScript && !PMWrapper.IsCompilerUserPaused) { float gameSpeedExp = MyLibrary.LinearToExponential(0, 0.5f, 5, PMWrapper.speedMultiplier); transform.Translate(new Vector3(0, 0, QueueSpeed * gameSpeedExp * Time.deltaTime)); if (Vector3.Distance(transform.position, targetPosition) < 2 * (QueueSpeed * gameSpeedExp * Time.deltaTime)) { transform.position = targetPosition; isMovingByScript = false; OperationsRunning--; } } }
public void CheckBattery(int currentBatteryLevel) { SceneController2_1.CheckChargeCounter++; Display.text = currentBatteryLevel.ToString(); PMWrapper.UnpauseWalker(); }
protected override void OnHideMessage() { PMWrapper.UnpauseWalker(); }