protected void Apply(float dt) { var ang = Mathf.Lerp(angleMin, angleMax, angle) + angleNoiseGen.Value(0f, Time.timeSinceLevelLoad); var ct = polar.Cartesian(target.Distance + distanceNoiseGen.Value(Time.timeSinceLevelLoad, 0f) + Mathf.Lerp(distanceMin, distanceMax, distance), ang); var to = ct + target.transform.position + offset; to.y = Mathf.Max(to.y, floorHeight); camera.transform.position = Vector3.Lerp(camera.transform.position, to, dt); Look(); }
protected override void Update() { base.Update(); var dt = Time.deltaTime; var p = center.position + polar.Cartesian(distance); var r = Quaternion.LookRotation(center.position - p, Vector3.up); position = p + WobblePosition(dt); rotation = r * WobbleRotation(dt); }
protected override void Update() { base.Update(); var dt = Time.deltaTime; polar.theta1 += dt * speed; var p = center.position + offset + polar.Cartesian(distance); var dir = p - center.position; var r = Quaternion.LookRotation(new Vector3(dir.x, 0f, dir.z), Vector3.up); position = p + WobblePosition(dt); rotation = r * WobbleRotation(dt); }