/// <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; } } } } }
/// <summary> /// /// </summary> private void LateUpdate() { if (!_paused) { XCameraUpdater.followMaxHeight = _followMaxHeight; XCameraUpdater.followMinHeight = _followMinHeight; // update camera XCameraUpdater.offsetFocus = _offsetFocus; XCameraUpdater.Update(_shouldResetTwoPos, _resetTwoPosX); LazyOrbitUpdate(_force); } }
/// <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; } }
/// <summary> /// /// </summary> /// <param name="trans"></param> public void AddTransform(Transform trans) { XCameraUpdater.AddTransform(trans); }
/// <summary> /// /// </summary> /// <param name="go"></param> public void SetTarget(GameObject go) { XCameraUpdater.SetEnemy(go); }
/// <summary> /// /// </summary> /// <param name="go"></param> public void SetSource(GameObject go) { XCameraUpdater.SetPlayer(go); }
/// <summary> /// /// </summary> public void ResetTransformList() { XCameraUpdater.ResetTransformList(); }
/// <summary> /// /// </summary> /// <param name="trans"></param> public void RemoveTransform(Transform trans) { XCameraUpdater.RemoveTransform(trans); }