public void Stay(NewRoombaController controller) { _seconds -= Time.deltaTime; _rb.angularVelocity = new Vector3(0, 15 * _rotation, 0); if (_seconds <= 0) { controller.onChangeState(controller._normalState); } }
public void EnterState(NewRoombaController controller) { controller._boost = false; _pVar.MaxSpeed = _pVar._boostMaxSpeed; controller._phy.ResetVelocity(); _currentTime = _pVar._boostTime; _direction = new Vector2(controller.transform.forward.x, controller.transform.forward.z); controller.gameObject.GetComponent <Animation>().Play(); controller._vfx._boost.SendEvent("BoostPlay"); AudioManager.Instance._PlaySFX("Dash"); }
public void Stay(NewRoombaController controller) { controller._phy.addForce(_direction, _pVar._boostForce); _currentTime -= Time.deltaTime; if (_currentTime <= 0) { controller.onChangeState(controller._normalState); } else if (controller._action) { _pMan.runPowerUp(); controller._action = false; } }
public void Stay(NewRoombaController controller) { controller._phy.addForce(controller._movement, _pVar._normalSpeed); controller._phy.addTorque(controller._movement * _pVar._rotateSpeed); _currCD -= Time.deltaTime; if (controller._boost && _currCD <= 0) { controller.onChangeState(controller._boostState); } else if (controller._action) { _pMan.runPowerUp(); controller._action = false; } }
public void Explosion(GameObject obj) { foreach (GameObject _target in _players) { if (ReferenceEquals(obj, _target)) { continue; } if (Vector3.Distance(_target.transform.position, obj.transform.position) < distance) { Vector3 direction = Vector3.Normalize(_target.transform.position - obj.transform.position); NewRoombaController _controller = _target.GetComponent <NewRoombaController>(); _target.GetComponent <PlayerVariables>().MaxSpeed = 100; _controller.GetStunned(1f, new Vector2(direction.x, direction.z), 2000); StartCoroutine(_controller.changeKnife()); } } }
private void Awake() { _controller = GetComponent <NewRoombaController>(); _pVar = gameObject.GetComponent <PlayerVariables>(); _invTime = 2f; }
public void EnterState(NewRoombaController controller) { _rb = controller.gameObject.GetComponent <Rigidbody>(); controller._phy.addForce(new Vector2(_direction.x, _direction.y), _force); controller._pVar.MaxSpeed = _force / 2; }
void Awake() { player = GetComponent <NewRoombaController>(); controls = new RoombaInputSystem(); }
public void EnterState(NewRoombaController controller) { _currCD = _pVar._boostCD; }