2015-09-26から1日間の記事一覧
先日Unityのプロファイラーを眺めていたところ、string.StartsWithが激重いことに気づいたので共有。テスト用にこんなスクリプトを実行。 using UnityEngine; using System.Collections; public class Hoge : MonoBehaviour { void Update () { string hoge …
Vector3.Dotで取得したラジアン値をMathf.Acosに突っ込んだところNanが発生することがあったので共有。 以下のようなソースで出ました。 Vector3 a = (end - start).normalize; Vector3 b = hoge.transform.rotation * Vector3.forward; float rad = Vector3…