Пример #1
0
    /// <summary>
    ///
    /// </summary>
    private void Update()
    {
        if (!_paused)
        {
            if (!IsPvp())
            {
                XCameraUpdater.Update(false, _resetTwoPosX);

                float theDistance = (XCameraUpdater.sourcePosition - XCameraUpdater.targetPosition).magnitude;

                if (theDistance > _beginResetTwoPosX)
                {
                    _shouldResetTwoPos = true;
                    theDistance        = _resetTwoPosX;
                }
                else
                {
                    _shouldResetTwoPos = false;
                }

                if (_inMaxCameraDistanceMod == false)
                {
                    if (theDistance > _beginMaxDistanceModValue)
                    {
                        AddModifierForCharge(2, "modMaxDistance", 1, 0);
                        _inMaxCameraDistanceMod = true;
                    }
                }
                else
                {
                    if (theDistance < _endMaxDistanceModValue)
                    {
                        RemoveModifier("modMaxDistance");
                        _inMaxCameraDistanceMod = false;
                    }
                }

                if (_inMinCameraDistanceMod == false)
                {
                    if (theDistance < _beginMinDistanceModValue)
                    {
                        AddModifierForCharge(3, "modMinDistance", 1, 0);
                        _inMinCameraDistanceMod = true;
                    }
                }
                else
                {
                    if (theDistance > _endMinDistanceModValue)
                    {
                        RemoveModifier("modMinDistance");
                        _inMinCameraDistanceMod = false;
                    }
                }
            }
        }
    }
Пример #2
0
    /// <summary>
    ///
    /// </summary>
    private void LateUpdate()
    {
        if (!_paused)
        {
            XCameraUpdater.followMaxHeight = _followMaxHeight;
            XCameraUpdater.followMinHeight = _followMinHeight;

            // update camera
            XCameraUpdater.offsetFocus = _offsetFocus;
            XCameraUpdater.Update(_shouldResetTwoPos,
                                  _resetTwoPosX);

            LazyOrbitUpdate(_force);
        }
    }
Пример #3
0
    /// <summary>
    ///
    /// </summary>
    private void OnEnable()
    {
        if (!_paused)
        {
            transform.localRotation = Quaternion.identity;

            XCameraUpdater.ResetTransformList();

            // apply new camera config
            ApplyConfigure(
                XCameraHelper.confPvp
                );

            _t0 = XCameraUpdater.midPosition;
            _t1 = XCameraUpdater.midPosition;
        }
    }
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="trans"></param>
 public void AddTransform(Transform trans)
 {
     XCameraUpdater.AddTransform(trans);
 }
Пример #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="go"></param>
 public void SetTarget(GameObject go)
 {
     XCameraUpdater.SetEnemy(go);
 }
Пример #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="go"></param>
 public void SetSource(GameObject go)
 {
     XCameraUpdater.SetPlayer(go);
 }
Пример #7
0
 /// <summary>
 ///
 /// </summary>
 public void ResetTransformList()
 {
     XCameraUpdater.ResetTransformList();
 }
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="trans"></param>
 public void RemoveTransform(Transform trans)
 {
     XCameraUpdater.RemoveTransform(trans);
 }