public override void CreateMesh(EyeName eye) { Eye = eye; MeshRenderer mr = GetComponent <MeshRenderer> (); if (mr == null) { _internalCreateMesh(eye); } else { CameraPostRenderer r = DisplayCamera.GetComponent <CameraPostRenderer>(); if (r == null) { r = DisplayCamera.gameObject.AddComponent <CameraPostRenderer>(); } r.AddRenderer(this); _RenderPlane = gameObject; mr.material = Mat; } /*if (eye == EyeName.LeftEye) * _RenderPlane.transform.localPosition = new Vector3 (-0.03f, 0, 0); * else * _RenderPlane.transform.localPosition = new Vector3 (0.03f, 0, 0);*/ }
void OnDestroy() { // Destroy (_RenderPlane); CameraPostRenderer r = DisplayCamera.GetComponent <CameraPostRenderer>(); if (r != null) { r.RemoveRenderer(this); } }
public override void CreateMesh(EyeName eye) { Eye = eye; CameraPostRenderer r = DisplayCamera.GetComponent <CameraPostRenderer>(); if (r == null) { r = DisplayCamera.gameObject.AddComponent <CameraPostRenderer>(); } r.AddRenderer(this); _RenderPlane = gameObject; Receiver.OnFrameBlitted += OnImageArrived; }
public override void CreateMesh(EyeName eye) { Eye = eye; Image.material = Mat; CameraPostRenderer r = DisplayCamera.GetComponent <CameraPostRenderer>(); if (r == null) { r = DisplayCamera.gameObject.AddComponent <CameraPostRenderer>(); } r.AddRenderer(this); _RenderPlane = gameObject; Enable(); }
public override void CreateMesh(EyeName eye) { Eye = eye; MeshRenderer mr = GetComponent <MeshRenderer> (); if (mr == null) { _internalCreateMesh(eye); } else { CameraPostRenderer r = DisplayCamera.GetComponent <CameraPostRenderer>(); if (r == null) { r = DisplayCamera.gameObject.AddComponent <CameraPostRenderer>(); } r.AddRenderer(this); _RenderPlane = gameObject; mr.material = Mat; } }
public override void CreateMesh(EyeName eye) { Eye = eye; MeshRenderer mr = GetComponent <MeshRenderer> (); if (mr == null) { mr = _internalCreateMesh(eye); } if (mr != null) { mr.material = Mat; } _postRenderer = DisplayCamera.GetComponent <CameraPostRenderer>(); if (_postRenderer == null) { _postRenderer = DisplayCamera.gameObject.AddComponent <CameraPostRenderer>(); } _postRenderer.AddRenderer(this); Enable(); }