GetPropertyColor() public static method

public static GetPropertyColor ( string name ) : Color
name string
return Color
コード例 #1
0
        public void RefreshCurves()
        {
            if (m_ClipDataSource == null || m_Selection == null)
            {
                return;
            }

            var bindings = new List <EditorCurveBinding>();

            foreach (int s in m_Selection)
            {
                var item = (CurveTreeViewNode)m_TreeView.FindItem(s);
                if (item != null && item.bindings != null)
                {
                    bindings.AddRange(item.bindings);
                }
            }

            AnimationClip clip           = m_ClipDataSource.animationClip;
            var           wrappers       = new List <CurveWrapper>();
            int           curveWrapperId = 0;

            foreach (EditorCurveBinding b in bindings)
            {
                var wrapper = new CurveWrapper
                {
                    id       = curveWrapperId++,
                    binding  = b,
                    groupId  = -1,
                    color    = CurveUtility.GetPropertyColor(b.propertyName),
                    hidden   = false,
                    readOnly = false,
                    renderer = new NormalCurveRenderer(AnimationUtility.GetEditorCurve(clip, b)),
                    getAxisUiScalarsCallback = GetAxisScalars
                };

                wrapper.renderer.SetCustomRange(0.0f, clip.length);
                wrappers.Add(wrapper);
            }

            m_CurveEditor.animationCurves = wrappers.ToArray();
        }
コード例 #2
0
 public void RefreshCurves()
 {
     if (this.m_ClipDataSource != null && this.m_Selection != null)
     {
         List <EditorCurveBinding> list = new List <EditorCurveBinding>();
         int[] selection = this.m_Selection;
         for (int i = 0; i < selection.Length; i++)
         {
             int num = selection[i];
             CurveTreeViewNode curveTreeViewNode = (CurveTreeViewNode)this.m_TreeView.FindItem(num);
             if (curveTreeViewNode != null && curveTreeViewNode.bindings != null)
             {
                 list.AddRange(curveTreeViewNode.bindings);
             }
         }
         AnimationClip       animationClip = this.m_ClipDataSource.animationClip;
         List <CurveWrapper> list2         = new List <CurveWrapper>();
         int num2 = 0;
         foreach (EditorCurveBinding current in list)
         {
             CurveWrapper curveWrapper = new CurveWrapper();
             curveWrapper.id       = num2++;
             curveWrapper.binding  = current;
             curveWrapper.groupId  = -1;
             curveWrapper.color    = CurveUtility.GetPropertyColor(current.propertyName);
             curveWrapper.hidden   = false;
             curveWrapper.readOnly = false;
             curveWrapper.set_renderer(new NormalCurveRenderer(AnimationUtility.GetEditorCurve(animationClip, current)));
             curveWrapper.getAxisUiScalarsCallback = new CurveWrapper.GetAxisScalarsCallback(this.GetAxisScalars);
             CurveWrapper curveWrapper2 = curveWrapper;
             curveWrapper2.get_renderer().SetCustomRange(0f, animationClip.get_length());
             list2.Add(curveWrapper2);
         }
         this.m_CurveEditor.set_animationCurves(list2.ToArray());
     }
 }