お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Closeオブジェクトのグローバルスケール (Read Only)
親がスケールと回転させている子を持つ場合は、スケールは傾いたり歪んだりするので注意してください。 よってスケールは3つの成分ベクターで正しく表現は出来なく、ただの3x3行列です。 とは言え、このような表現は作業する上で非常に不便です。 lossyScaleはそれと同じくらいに出来、実際のワールドスケールと一致させるための便利なプロパティです。 オブジェクトは歪んだりしない場合は値が完全に正しくなり、 歪みすぎている場合は多分とても異なる値になることはありません。
print (transform.lossyScale);
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { print(transform.lossyScale); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: print(transform.lossyScale)