void Start() { if (FaceTrackErrorEffectMat == null) { Debug.LogError("FaceTrackErrorEffectMat is not set. You must set it."); return; } _srdManager = SRDSceneEnvironment.GetSRDManager(); var srdCameras = new SRDCameras(_srdManager); var camEvent = CameraEvent.BeforeImageEffects; var commandBufNameBase = "FaceTrackErrorEffect"; _cmdBufCtrlerL = new CommandBufferController(srdCameras.LeftEyeCamera, CreateFaceTrackErrorEffectCommand(commandBufNameBase + "L"), camEvent); _cmdBufCtrlerR = new CommandBufferController(srdCameras.RightEyeCamera, CreateFaceTrackErrorEffectCommand(commandBufNameBase + "R"), camEvent); _srdManager.OnFaceTrackStateEvent.AddListener(this.GetFaceTrackState); FaceTrackErrorObject.SetActive(false); _faceTrackErrorObjMat = FaceTrackErrorObject.GetComponent <MeshRenderer>().material; _defaultErrorObjAlpha = _currentErrorObjAlpha = _faceTrackErrorObjMat.GetFloat("_Alpha"); }
void Start() { _srdManager = SRDSceneEnvironment.GetSRDManager(); _srdCameras = new SRDCameras(_srdManager); _colorToggler = new ColorToggler(DraggingColor); if (PointerObject != null) { Cursor.visible = false; } }
private void Initialize() { _srdManager = SRDSceneEnvironment.GetSRDManager(); _srdCameras = new SRDCameras(_srdManager); foreach (var type in _eyeTypes) { var eyeCameraObj = _srdCameras.GetOrCreateEyeCameraObj(type); _eyeCamera[type] = SRDSceneEnvironment.GetOrAddComponent <Camera>(eyeCameraObj); _eyeCamera[type].targetTexture = _eyeCamRenderTextureCache[type]; var eyeAnchorName = SRDHelper.EyeSideName[type] + SRDHelper.SRDConstants.EyeAnchorGameObjDefaultName; var eyeAnchor = SRDSceneEnvironment.GetOrCreateChild(_srdCameras.AnchorTransform, eyeAnchorName); _eyeTransform[type] = eyeAnchor.transform; } _srdCameras.RemoveSourceCamera(); }
private void InitSRDFade() { var srdCameras = new SRDCameras(SRDSceneEnvironment.GetSRDManager()); var camLObject = srdCameras.LeftEyeCamera; var camRObject = srdCameras.RightEyeCamera; if (camLObject == null || camRObject == null) { if (IsFadeTransition) { Debug.LogError("CameraObject not found. Forced to turn off FadeTransition mode."); IsFadeTransition = false; return; } } _srdFade.Init(camLObject.GetComponent <Camera>(), camRObject.GetComponent <Camera>()); }
void Start() { this.GetComponent <TextMesh>().text = GetTextToShowKey(); _srdManager = SRDSceneEnvironment.GetSRDManager(); }