コード例 #1
0
        /************************************************************************************************************************/

        private void DoLoopCounterGUI(ref Rect area, float length)
        {
            int loops = Mathf.Abs((int)(State.Time / length));
            var label = "x" + loops;
            var style = GUI.skin.label;

            var width = style.CalculateWidth(label);

            var labelArea = AnimancerEditorUtilities.StealWidth(ref area, width);

            GUI.Label(labelArea, label);
        }
コード例 #2
0
        private bool DoNormalizedTimeToggle(ref Rect area)
        {
            var content = AnimancerEditorUtilities.TempContent("N");
            var style   = AnimancerEditorUtilities.Styles.MiniButton;

            if (_UseNormalizedTimeSlidersWidth == 0)
            {
                _UseNormalizedTimeSlidersWidth = style.CalculateWidth(content);
            }

            var toggleArea = AnimancerEditorUtilities.StealWidth(ref area, _UseNormalizedTimeSlidersWidth);

            UseNormalizedTimeSliders.Value = GUI.Toggle(toggleArea, UseNormalizedTimeSliders, content, style);
            return(UseNormalizedTimeSliders);
        }
コード例 #3
0
        /************************************************************************************************************************/

        /// <summary>Draws all 'states' in the given list.</summary>
        private void DoStatesGUI(string label, List <AnimancerState> states, IAnimancerComponent owner)
        {
            var area = AnimancerEditorUtilities.GetRect();

            var width = GUI.skin.label.CalculateWidth("Weight");

            GUI.Label(AnimancerEditorUtilities.StealWidth(ref area, width), "Weight");

            EditorGUI.LabelField(area, label, states.Count.ToString());

            EditorGUI.indentLevel++;
            for (int i = 0; i < states.Count; i++)
            {
                DoStateGUI(states[i], owner);
            }
            EditorGUI.indentLevel--;
        }