void Start()
 {
     baseButtonGraphic.GetFeatureData <CustomVectorChannelData>().value     = buttonColors.baseColor.ToHSV();
     pressedButtonGraphic.GetFeatureData <CustomVectorChannelData>().value  = buttonColors.pressedColor.ToHSV();
     hoveringButtonGraphic.GetFeatureData <CustomVectorChannelData>().value = buttonColors.hoveringColor.ToHSV();
     toggledButtonGraphic.GetFeatureData <CustomVectorChannelData>().value  = buttonColors.toggledColor.ToHSV();
 }
Пример #2
0
    public void setGraphicColor(Color color)
    {
        if (graphic == null)
        {
            graphic = GetComponent <LeapGraphic>();
            if (graphic == null)
            {
                graphic = GetComponentInParent <LeapGraphic>();
            }
        }

        if (graphicColor == null)
        {
            graphicColor = graphic.GetFeatureData <CustomVectorChannelData>();
        }

        graphicColor.value = color.ToHSV();
    }
Пример #3
0
 private void setColor(Color c)
 {
     if (graphicToDrive != null)
     {
         var colorFeature = graphicToDrive.GetFeatureData <LeapRuntimeTintData>();
         if (colorFeature == null)
         {
             Debug.LogError("No runtime tint (color) feature available for "
                            + graphicToDrive.name, this);
         }
         else
         {
             colorFeature.color = c;
         }
     }
     else
     {
         materialInstance.color = c;
     }
 }
Пример #4
0
 void Start()
 {
     _tint   = graphic.GetFeatureData <LeapRuntimeTintData>();
     _button = GetComponent <InteractionButton>();
 }