示例#1
0
 public void Stay(NewRoombaController controller)
 {
     _seconds           -= Time.deltaTime;
     _rb.angularVelocity = new Vector3(0, 15 * _rotation, 0);
     if (_seconds <= 0)
     {
         controller.onChangeState(controller._normalState);
     }
 }
示例#2
0
 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");
 }
示例#3
0
 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;
     }
 }
示例#4
0
 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;
     }
 }
示例#5
0
    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());
            }
        }
    }
示例#6
0
 private void Awake()
 {
     _controller = GetComponent <NewRoombaController>();
     _pVar       = gameObject.GetComponent <PlayerVariables>();
     _invTime    = 2f;
 }
示例#7
0
 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;
 }
示例#8
0
 void Awake()
 {
     player   = GetComponent <NewRoombaController>();
     controls = new RoombaInputSystem();
 }
示例#9
0
 public void EnterState(NewRoombaController controller)
 {
     _currCD = _pVar._boostCD;
 }