private void ChangeDirection(DVDPlayerBehaviour otherDVD) { var vector = otherDVD.MovingVector; var multiplier = GameMaster.Instance.CurrState == GameMaster.GameState.REWIND ? 5f : 1f; if (_wallDirection == WallDirection.UP || _wallDirection == WallDirection.DOWN) { otherDVD.MovingVector = new Vector3(vector.x, -vector.y, 0f).normalized *multiplier; } else { otherDVD.MovingVector = new Vector3(-vector.x, vector.y, 0f).normalized *multiplier; } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { GameObject.Destroy(this.gameObject); } _player = GameObject.FindGameObjectWithTag("Player").GetComponent <DVDPlayerBehaviour>(); _bounces = 0; _bouncedPositions = new Stack <Vector3>(); _startingPosition = Vector3.zero; _elapsedTime = 0f; loadSceneTrigger = false; gameMode = ModeDecider.Devil ? GameMode.DEVIL : GameMode.NORMAL; }
private void Awake() { _playerBehaviour = GetComponent <DVDPlayerBehaviour>(); _trail = GetComponentInChildren <TrailBehaviour>(); }