// Update is called once per frame void Update() { if (rController == null) { rController = appInfo.GetRightController(); } if (lController == null) { lController = appInfo.GetLeftController(); } rStat = appInfo.GetUnusedButtonStatus(); //lStat = appInfo.GetLeftTriggerStatus(); GameObject o1 = checkRay(rController, rStat, rLine); //GameObject o2 = checkRay(lController, lStat, lLine); List <GameObject> toBeRemoved = new List <GameObject>(); foreach (GameObject o in regColor.Keys) { //if (!o.Equals(o1) && !o.Equals(o2)) //{ // o.GetComponent<Renderer>().material.color = regColor[o]; // toBeRemoved.Add(o); //} if (!o.Equals(o1)) { o.GetComponent <Renderer>().material.color = regColor[o]; toBeRemoved.Add(o); } } foreach (GameObject o in toBeRemoved) { regColor.Remove(o); } }
IEnumerator Held() { //Debug.Log("held 1"); while (appInfo.GetUnusedButtonStatus() == ButtonStatus.Held) { transform.parent.parent = appInfo.GetRightController(); yield return(null); transform.parent.parent = GameObject.Find("TutoriWidgets").transform; } }
///*IEnumerator EnableEffect()*/ // { // // Debug.Log("EnableEffect 1"); // // txt.text="4s"; // transform.parent.parent =GameObject.Find("TutoriWidgets").transform; // gameObject.GetComponent<Renderer>().material = stopButton; // // Debug.Log("EnableEffect 2"); // //RealMethod(); // } IEnumerator Held() { Debug.Log("held 1"); while (appInfo.GetUnusedButtonStatus() == ButtonStatus.Held) { if (transform.parent.GetComponent <VRVideoPlayer>().stereoMode == StereoMode.NONE) { transform.parent.parent = appInfo.GetRightController(); yield return(null); transform.parent.parent = GameObject.Find("VRVideoPlayer_UI (1)").transform; } else if (transform.parent.GetComponent <VRVideoPlayer>().stereoMode == StereoMode.LEFT_RIGHT) { transform.parent.parent = appInfo.GetRightController(); yield return(null); transform.parent.parent = GameObject.Find("TutoriWidgets").transform; } } }
// gets data of current frame public ButtonInstance createInstance(IAppInfo appInfo, float timeStamp, GameObject tracker) { time = timeStamp; instance = appInfo; //brushtype = null; //colorcon = GameObject.Find("App").GetComponent<TiltBrush.BrushColorController>(); //color = colorcon.CurrentColor; // script = check script that is running //if (TiltBrush.BrushController.m_Instance != null) //{ // brushtype = TiltBrush.BrushController.m_Instance.ActiveBrush; //} //Debug.Log(brushtype); //toolobj = GameObject.Find("SketchSurface").GetComponent<TiltBrush.SketchSurfacePanel>(); //tool = toolobj.ActiveToolType; //Debug.Log(tool); //brushcolor = TiltBrush.ColorController.trackColor; //Debug.Log(brushcolor); additionalInfo = instance.GetSerializedAdditionalInfo(); color = instance.GetColor(); Transform lc = instance.GetLeftController(); Transform rc = instance.GetRightController(); Transform root = instance.GetSceneRootTransform(); (leftControllerPos, leftControllerRot) = getRelativePosRot(lc, root, tracker); (rightControllerPos, rightControllerRot) = getRelativePosRot(rc, root, tracker); //leftControllerPos = instance.GetLeftController().position; //rightControllerPos = instance.GetRightController().position; //leftControllerRot = instance.GetLeftController().rotation; //rightControllerRot = instance.GetRightController().rotation; ButtonStatus r = instance.GetRightTriggerStatus(); ButtonStatus l = instance.GetLeftTriggerStatus(); rightTriggerDown = (r == ButtonStatus.Down || r == ButtonStatus.Held); leftTriggerDown = (l == ButtonStatus.Down || l == ButtonStatus.Held); //Debug.Log("Default: " + leftControllerPos + " | " + leftControllerRot); return(this); }
// Start is called before the first frame update void Start() { appInfo = GetComponent <IAppInfo>(); rController = appInfo.GetRightController(); lController = appInfo.GetLeftController(); }