예제 #1
0
        private void DrawBCLField(BitCullingLevel bcl, float fieldL, float fldWdth4th, float fldWdth8th, float fldWdth16th)
        {
            int holdindent = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;

            float lines = line;

            float left = fieldL + fldWdth4th * (3 - (int)bcl);

            if (fc.expandBCL)
            {
                if (bcl == BitCullingLevel.DropAll || bcl == BitCullingLevel.DropThird)
                {
                    SolidTextures.DrawTexture(new Rect(left, line, fldWdth4th, BCL_HEIGHT), SolidTextures.darken052D);
                }

                string clvl =
                    r.width > 300 ?
                    (((int)bcl == 0) ? "Cull None" : ((int)bcl == 1) ? "Lvl 1" : ((int)bcl == 2) ? "Lvl 2" : "Cull All") :
                    (((int)bcl == 0) ? "None" : ((int)bcl == 1) ? "Lvl 1" : ((int)bcl == 2) ? "Lvl 2" : "All");

                EditorGUI.LabelField(new Rect(left, lines, fldWdth4th, LINEHEIGHT), clvl, (GUIStyle)"ProjectBrowserGridLabel");
                lines += LINEHEIGHT;
            }

            EditorGUI.indentLevel = 0;
            int bits = EditorGUI.DelayedIntField(new Rect(left + fldWdth16th, lines + 1, fldWdth8th, LINEHEIGHT), fc.GetBits(bcl), MINI_TXT_FLD_STYLE);

            EditorGUI.indentLevel = 0;

            if (bits != fc.GetBits(bcl))
            {
                haschanged = true;
                Undo.RecordObject(p.serializedObject.targetObject, "BCL " + bcl + " changed");
                fc.SetBits(bits, bcl);

                Debug.Log("bcl " + bcl + " " + bits + " " + fc.GetBits(bcl));
            }

            if (fc.expandBCL)
            {
                lines += LINEHEIGHT;
                var    rng = (double)Math.Abs(fc.Max - fc.Min);
                string str = ((fc.GetBits(bcl) == 0) ? 0 : (rng / Math.Pow(2, fc.Bits - fc.GetBits(bcl)))).ToString("####0.#####");
                EditorGUI.LabelField(new Rect(left, lines, fldWdth4th, LINEHEIGHT), str, (GUIStyle)"ProjectBrowserGridLabel");
            }

            EditorGUI.indentLevel = holdindent;
        }