【3Dゲームエンジン】Unity質問スレッド10
■ このスレッドは過去ログ倉庫に格納されています
0369名前は開発中のものです。
2014/07/10(木) 03:37:17.91ID:xx5UL/cuBというオブジェクトのTransformに近づけていくのに簡潔な書き方ってないでしょうか
下記のように書いたんですが
float x = Mathf.Lerp(A.transform.position.x, B.transform.position.x, t);.
float y = Mathf.Lerp(A.transform.position.y, B.transform.position.y, t);.
float z = Mathf.Lerp(A.transform.position.z, B.transform.position.z, t);.
float rotationX = Mathf.Lerp(A.transform.rotarion.x, B.transform.rotarion.x, t);.
float rotationY = Mathf.Lerp(A.transform.rotarion.y, B.transform.rotarion.y, t);.
float rotationZ = Mathf.Lerp(A.transform.rotarion.z, B.transform.rotarion.z, t);.
A.transform.position=new Vector3(x,y,z);
B.transform.rotation=new Vector3(rotationX,rotationY,rotationZ);
これだとちょっと冗長すぎて、もっと簡潔な書き方があると思えてなりません
どなたかアドバイス願えますでしょうか
■ このスレッドは過去ログ倉庫に格納されています