Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        Vector3    position    = UnityEngine.FoveInterface.GetHMDPosition();
        string     pos_str     = position.ToString();
        Quaternion orientation = UnityEngine.FoveInterface.GetHMDRotation();
        string     ori_str     = orientation.ToString();

        Debug.Log(pos_str);
        Debug.Log(ori_str);

        if (FoveInterface.IsLookingAtCollider(my_collider))
        {
            if (light_enabled)
            {
                l.enabled = true;
                m.SetColor("_EmissionColor", l.color);
                DynamicGI.SetEmissive(GetComponent <Renderer>(), l.color);
                m.EnableKeyword("_EMISSION");
            }
            //bool check = FoveInterface.IsLookingAtCollider(my_collider);
        }
        else
        {
            gameObject.GetComponent <Renderer> ().material.color = Color.white;
            //GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
            m.DisableKeyword("_EMISSION");
            if (light_enabled)
            {
                l.enabled = false;
                DynamicGI.SetEmissive(GetComponent <Renderer>(), Color.black);
            }
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        //sendMsg (my_collider);
        if (FoveInterface.IsLookingAtCollider(my_collider))
//send osc message mycollider.position
        {
            //Debug.Log ("HIER"+my_collider.transform.position.x+" "+my_collider.transform.position.y+" "+my_collider.transform.position.z);
            sendMsg(my_collider);
            //OscSender.sendMsg (my_collider);
            if (light_enabled)
            {
                l.enabled = true;
                m.SetColor("_EmissionColor", l.color);
                DynamicGI.SetEmissive(GetComponent <Renderer>(), l.color);
                m.EnableKeyword("_EMISSION");
            }
            //bool check = FoveInterface.IsLookingAtCollider(my_collider);
        }
        else
        {
            gameObject.GetComponent <Renderer> ().material.color = Color.white;
            //GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
            m.DisableKeyword("_EMISSION");
            if (light_enabled)
            {
                l.enabled = false;
                DynamicGI.SetEmissive(GetComponent <Renderer>(), Color.black);
            }
        }
    }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (FoveInterface.IsLookingAtCollider(my_collider))
     {
         if (light_enabled)
         {
             l.enabled = true;
             m.SetColor("_EmissionColor", l.color);
             DynamicGI.SetEmissive(GetComponent <Renderer>(), l.color);
             m.EnableKeyword("_EMISSION");
         }
         //bool check = FoveInterface.IsLookingAtCollider(my_collider);
     }
     else
     {
         gameObject.GetComponent <Renderer> ().material.color = Color.white;
         //GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
         m.DisableKeyword("_EMISSION");
         if (light_enabled)
         {
             l.enabled = false;
             DynamicGI.SetEmissive(GetComponent <Renderer>(), Color.black);
         }
     }
 }
Exemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (FoveInterface.IsLookingAtCollider(mCollider))
     {
         Debug.Log("COLLISION");
         this.GetComponent <Renderer>().material = _material[1];
     }
     else
     {
         this.GetComponent <Renderer>().material = _material[0];
     }
 }
Exemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     if (FoveInterface.IsLookingAtCollider(mCollider))
     {
         Debug.Log("COLLISION");
         mLight.enabled = true;
     }
     else
     {
         mLight.enabled = false;
     }
 }