Skip to content

Instantly share code, notes, and snippets.

Last active Apr 16, 2018
What would you like to do?
Vector3 GetMagnifiedOffset(){
// 規格化されたオフセットを取得
Vector3 normalizedOffset = offset.normalized;
// 『Sphere』オブジェクトとカメラの距離を取得
float offsetDistance = offset.magnitude;
// offsetDistanceに拡大率をかけて補正後の距離を取得
float magnifiedDistance = offsetDistance * (200f - magnify) / 100f;
// 規格化されたベクトルと拡大後の距離からオフセットを返す
Vector3 magnifiedOffset = magnifiedDistance * normalizedOffset;
return magnifiedOffset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment