20 protected Transform
cam;
23 protected Transform
trs;
27 private Matrix4x4 _cameraFacingMatrix = Matrix4x4.identity;
31 private static Mesh _mesh;
32 private static Mesh mesh
38 GameObject go = GameObject.CreatePrimitive(PrimitiveType.Quad);
39 _mesh = go.GetComponent<MeshFilter>().sharedMesh;
40 pb_ObjectUtility.Destroy(go);
48 cam = Camera.main.transform;
72 _cameraFacingMatrix.SetTRS(
trs.position, Quaternion.LookRotation(
cam.forward, Vector3.up), Vector3.one );
74 Graphics.DrawMesh(mesh, _cameraFacingMatrix,
icon, 0);
virtual bool CanEditType(Type rhs)
Material icon
The icon to be rendered facing the camera at the position of this object.
Matrix4x4 cameraFacingMatrix
Matrix with a camera facing rotation, world position of parent transform, and scale of 1.
Transform trs
A reference to this object's transform.
Transform cam
A reference to the main camera transform.
virtual void OnComponentModified()