// 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);
        }
    }
Exemple #2
0
 // [SerializeField] VideoCapture VC;
 // Start is called before the first frame update
 void Start()
 {
     appInfo                    = GetComponentInParent <IAppInfo>();
     transform.parent           = appInfo.GetLeftController();
     transform.localPosition    = appInfo.GetRecordButtonPosition();
     transform.localEulerAngles = appInfo.GetRecordButtonEulerAngles();
     SetChildrenActive(false);
     currentstate = false;
     gameObject.GetComponent <Renderer>().material = recordButton;
 }
    // 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();
 }