Esempio n. 1
0
    public void Shake(float _xSwing, float _ySwing, float _zSwing, int _xRate, int _yRate, int _zRate, float _length)
    {
        CameraAnimData data = new CameraAnimData()
        {
            xRate  = _xRate,
            yRate  = _yRate,
            zRate  = _zRate,
            xSwing = _xSwing,
            ySwing = _ySwing,
            zSwing = _zSwing,
        };

        if (data == null)
        {
            return;
        }
        m_currentShake = data;
        m_animStarTime = Time.time;
        m_animLength   = _length;
        xDelta         = 0;
        yDelta         = 0;
        zDelta         = 0;
        xSpeed         = data.xRate * 4 * data.xSwing;
        ySpeed         = data.yRate * 4 * data.ySwing;
        zSpeed         = data.zRate * 4 * data.zSwing;
        m_isShaking    = true;
    }
Esempio n. 2
0
            public CameraAnimConfig(CameraAnim camAnim)
            {
                FrameCount  = camAnim.FrameCount;
                BakedSize   = camAnim.BakedSize;
                Name        = camAnim.Name;
                Loop        = camAnim.Flags.HasFlag(CameraAnimFlags.Looping);
                EulerZXY    = camAnim.Flags.HasFlag(CameraAnimFlags.EulerZXY);
                Perspective = camAnim.Flags.HasFlag(CameraAnimFlags.Perspective);

                BaseData = camAnim.BaseData;

                foreach (var curve in camAnim.Curves)
                {
                    Curves.Add(new CameraAnimCurve(curve));
                }
            }
Esempio n. 3
0
    /// <summary>
    /// ���ž�ͷ����
    /// </summary>
    /// <param name="cameraAnimId">����id</param>
    /// <param name="length">����</param>
    public void Shake(int cameraAnimId, float length)
    {
        CameraAnimData data = CameraAnimData.dataMap.GetValueOrDefault(cameraAnimId, null);

        if (data == null)
        {
            return;
        }
        m_currentShake = data;
        m_animStarTime = Time.time;
        m_animLength   = length;
        xDelta         = 0;
        yDelta         = 0;
        zDelta         = 0;
        xSpeed         = data.xRate * 4 * data.xSwing;
        ySpeed         = data.yRate * 4 * data.ySwing;
        zSpeed         = data.zRate * 4 * data.zSwing;
        m_isShaking    = true;
    }
Esempio n. 4
0
 public void Shake(float _xSwing, float _ySwing, float _zSwing, int _xRate, int _yRate, int _zRate, float _length)
 {
     CameraAnimData data = new CameraAnimData()
     {
         xRate = _xRate,
         yRate = _yRate,
         zRate = _zRate,
         xSwing = _xSwing,
         ySwing = _ySwing,
         zSwing = _zSwing,
     };
     if (data == null) return;
     m_currentShake = data;
     m_animStarTime = Time.time;
     m_animLength = _length;
     xDelta = 0;
     yDelta = 0;
     zDelta = 0;
     xSpeed = data.xRate * 4 * data.xSwing;
     ySpeed = data.yRate * 4 * data.ySwing;
     zSpeed = data.zRate * 4 * data.zSwing;
     m_isShaking = true;
 }
Esempio n. 5
0
 /// <summary>
 /// 播放镜头动画
 /// </summary>
 /// <param name="cameraAnimId">动画id</param>
 /// <param name="length">毫秒</param>
 public void Shake(int cameraAnimId, float length)
 {
     CameraAnimData data = CameraAnimData.dataMap.GetValueOrDefault(cameraAnimId, null);
     if (data == null) return;
     m_currentShake = data;
     m_animStarTime = Time.time;
     m_animLength = length;
     xDelta = 0;
     yDelta = 0;
     zDelta = 0;
     xSpeed = data.xRate * 4 * data.xSwing;
     ySpeed = data.yRate * 4 * data.ySwing;
     zSpeed = data.zRate * 4 * data.zSwing;
     m_isShaking = true;
 }