private void Restore(Camera camera) { var cameraState = SgtCameraState.Restore(cameraStates, camera); if (cameraState != null) { transform.localPosition = cameraState.LocalPosition; } }
private void CameraPreCull(Camera camera) { var cameraState = SgtCameraState.Find(ref cameraStates, camera); transform.localScale = MaxScale * cameraState.Value; // Store scale cameraState.LocalScale = transform.localScale; }
public void Restore(Camera camera) { var cameraState = SgtCameraState.Restore(cameraStates, camera); if (cameraState != null) { transform.localPosition = cameraState.LocalPosition; transform.localRotation = cameraState.LocalRotation; transform.localScale = cameraState.LocalScale; } }
private void CameraPreCull(Camera camera) { var cameraState = SgtCameraState.Find(ref cameraStates, camera); var eye = camera.transform.position; var tgt = transform.position; var occlusion = SgtOcclusion.Calculate(layers, new Vector4(eye.x, eye.y, eye.z, 0.0f), new Vector4(tgt.x, tgt.y, tgt.z, radius)); transform.localScale = maxScale * Mathf.Clamp01(1.0f - occlusion); // Store scale cameraState.LocalScale = transform.localScale; }
public void Save(Camera camera) { var cameraState = SgtCameraState.Find(ref cameraStates, camera); cameraState.LocalPosition = transform.localPosition; }
private void Save(Camera camera) { var cameraState = SgtCameraState.Find(ref cameraStates, camera); cameraState.LocalRotation = transform.localRotation; }
private void Save(Camera camera) { var cameraState = SgtCameraState.Save(ref cameraStates, camera); cameraState.LocalScale = transform.localScale; }
public void Save(Camera camera) { var cameraState = SgtCameraState.Save(ref cameraStates, camera); cameraState.LocalRotation = transform.localRotation; }
private void Save(Camera camera) { var cameraState = SgtCameraState.Save(ref cameraStates, camera); cameraState.LocalPosition = transform.position; }