Example #1
0
 void Start()
 {
     if (transform.parent)
     {
         _componentInterface = transform.parent.GetComponent <componentInterface>();
     }
 }
Example #2
0
    public override void Awake()
    {
        base.Awake();
        if (transform.parent)
        {
            _compInterface = transform.parent.GetComponent <componentInterface>();
        }

        offColor = Color.HSVToRGB(.5f, 230f / 255, 118f / 255);
        onColor  = Color.HSVToRGB(.5f, 0f, 118f / 255);
        textMat  = label.GetComponent <Renderer>().material;
        textMat.SetColor("_TintColor", offColor);

        outline.GetComponent <Renderer>().material.SetColor("_TintColor", offColor);
        outline.GetComponent <Renderer>().material.SetFloat("_EmissionGain", .428f);
        outline.GetComponent <Renderer>().material.SetFloat("_InvFade", 1f);
    }
Example #3
0
    public void Setup(int IDx, int IDy, bool on, Color c)
    {
        singleID = false;

        if (_componentInterface == null)
        {
            if (transform.parent.GetComponent <componentInterface>() != null)
            {
                _componentInterface = transform.parent.GetComponent <componentInterface>();
            }
            else
            {
                _componentInterface = transform.parent.parent.GetComponent <componentInterface>();
            }
        }
        button2DID[0] = IDx;
        button2DID[1] = IDy;
        glowColor     = c;
        keyHit(on);
        startToggled = on;
        glowMat.SetColor("_TintColor", glowColor);
    }
Example #4
0
    public override void Awake()
    {
        base.Awake();
        if (transform.parent)
        {
            _componentInterface = transform.parent.GetComponent <componentInterface>();
        }

        onColor  = Color.HSVToRGB(182f / 359, 1f, 118f / 255);
        offColor = Color.HSVToRGB(182f / 359, 0f, 118f / 255);
        textMat  = label.GetComponent <Renderer>().material;
        setTextState(false);

        outlineRender = outline.GetComponent <Renderer>();
        outlineRender.material.SetColor("_TintColor", onColor);
        outlineRender.material.SetFloat("_EmissionGain", .428f);
        outlineRender.material.SetFloat("_InvFade", 1f);

        outline.SetActive(false);

        AwakeB();
    }
Example #5
0
    public override void Awake()
    {
        base.Awake();
        toggleKey = false;
        glowColor = Color.HSVToRGB(glowHue, .5f, .25f);

        if (_componentInterface == null)
        {
            if (transform.parent)
            {
                _componentInterface = transform.parent.GetComponent <componentInterface>();
            }
        }

        rend     = GetComponent <Renderer>();
        offMat   = rend.material;
        offColor = offMat.GetColor("_Color");
        glowMat  = new Material(onMat);
        glowMat.SetFloat("_EmissionGain", glowEmission);
        glowMat.SetColor("_TintColor", glowColor);
        selectOverlay.SetActive(false);

        if (changeOverlayGlow)
        {
            selectOverlay.GetComponent <Renderer>().material.SetColor("_TintColor", glowColor);
            selectOverlay.GetComponent <Renderer>().material.SetFloat("_EmissionGain", glowEmission);
        }

        if (GetComponentInChildren <TextMesh>() != null)
        {
            labelRend = GetComponentInChildren <TextMesh>().transform.GetComponent <Renderer>();
        }
        if (labelRend != null)
        {
            labelRend.material.SetFloat("_EmissionGain", .1f);
            labelRend.material.SetColor("_TintColor", labelColor);
        }
    }