示例#1
0
    public override void setState(manipState state)
    {
        if (curState == manipState.grabbed && state != manipState.grabbed)
        {
            if (_componentInterface != null)
            {
                _componentInterface.hit(false, buttonID);
            }
        }
        curState = state;
        if (curState == manipState.none)
        {
            mat.SetColor("_TintColor", normalColor);
            mat.SetFloat("_EmissionGain", .3f);


            if (textMat != null)
            {
                textMat.SetColor("_TintColor", normalColor);
                textMat.SetFloat("_EmissionGain", .3f);
            }
        }
        else if (curState == manipState.selected)
        {
            mat.SetColor("_TintColor", normalColor);
            mat.SetFloat("_EmissionGain", .6f);

            if (textMat != null)
            {
                textMat.SetColor("_TintColor", normalColor);
                textMat.SetFloat("_EmissionGain", .3f);
            }
        }
        else if (curState == manipState.grabbed)
        {
            mat.SetColor("_TintColor", Color.white);

            if (textMat != null)
            {
                textMat.SetColor("_TintColor", normalColor);
                textMat.SetFloat("_EmissionGain", .6f);
            }
            if (_componentInterface != null)
            {
                _componentInterface.hit(true, buttonID);
            }
        }
    }
示例#2
0
    public void keyHit(bool on)
    {
        isHit   = on;
        toggled = on;

        if (on)
        {
            if (singleID)
            {
                _componentInterface.hit(on, buttonID);
            }
            else
            {
                _componentInterface.hit(on, button2DID[0], button2DID[1]);
            }

            if (glowMatOnToggle)
            {
                rend.material = glowMat;
            }
            if (labelRend != null)
            {
                labelRend.material.SetFloat("_EmissionGain", labelEmission);
            }
        }
        else
        {
            if (singleID)
            {
                _componentInterface.hit(on, buttonID);
            }
            else
            {
                _componentInterface.hit(on, button2DID[0], button2DID[1]);
            }

            if (glowMatOnToggle)
            {
                rend.material = offMat;
            }
            if (labelRend != null)
            {
                labelRend.material.SetFloat("_EmissionGain", .1f);
            }
        }
    }
示例#3
0
 public void keyHit(bool on)
 {
     isHit   = on;
     toggled = on;
     if (on)
     {
         if (_componentInterface != null)
         {
             _componentInterface.hit(on, buttonID);
         }
         setToggleAppearance(true);
     }
     else
     {
         if (_componentInterface != null)
         {
             _componentInterface.hit(on, buttonID);
         }
         setToggleAppearance(false);
     }
 }
示例#4
0
 public void keyHit(bool on)
 {
     isHit   = on;
     toggled = on;
     if (on)
     {
         if (_compInterface != null)
         {
             _compInterface.hit(on, buttonID);
         }
         outline.GetComponent <Renderer>().material.SetColor("_TintColor", onColor);
         textMat.SetColor("_TintColor", onColor);
     }
     else
     {
         if (_compInterface != null)
         {
             _compInterface.hit(on, buttonID);
         }
         outline.GetComponent <Renderer>().material.SetColor("_TintColor", offColor);
         textMat.SetColor("_TintColor", offColor);
     }
 }