/// <summary>
    /// 设置额外的直线运动的参数
    /// <para>一般是被引力场影响</para>
    /// </summary>
    /// <param name="v"></param>
    /// <param name="angle"></param>
    /// <param name="acce"></param>
    /// <param name="accAngle"></param>
    public override void AddExtraSpeedParas(float v, float angle, float acce, float accAngle)
    {
        if (!_isInitAngle)
        {
            return;
        }
        angle = _curRotation;
        // 先计算投影长度
        Vector2 velocityVec = new Vector2(Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad)) * v;

        // 在激光角度方向上的速度
        v = velocityVec.x * Mathf.Cos(Mathf.Deg2Rad * _curVAngle) + velocityVec.y * Mathf.Sin(Mathf.Deg2Rad * _curVAngle);
        if (v < 0)
        {
            v = 0;
        }
        // 先计算投影长度
        Vector2 acceVec = new Vector2(Mathf.Cos(accAngle * Mathf.Deg2Rad), Mathf.Sin(accAngle * Mathf.Deg2Rad)) * acce;

        // 在激光角度方向上的加速度
        acce = acceVec.x * Mathf.Cos(Mathf.Deg2Rad * _curVAngle) + acceVec.y * Mathf.Sin(Mathf.Deg2Rad * _curVAngle);
        if (acce < 0)
        {
            acce = 0;
        }
        _movableObj.AddExtraSpeedParas(v, _curVAngle, acce, _curVAngle);
    }
Esempio n. 2
0
 public override void AddExtraSpeedParas(float v, float vAngle, float acce, float accAngle)
 {
     _movableObj.AddExtraSpeedParas(v, vAngle, acce, accAngle);
 }
Esempio n. 3
0
 /// <summary>
 /// 添加额外的速度参数
 /// </summary>
 /// <param name="v"></param>
 /// <param name="vAngle"></param>
 /// <param name="acce"></param>
 /// <param name="accAngle"></param>
 public virtual void AddExtraSpeedParas(float v, float vAngle, float acce, float accAngle)
 {
     _movableObj.AddExtraSpeedParas(v, vAngle, acce, accAngle);
 }