private void Awake()
 {
     Debug.Log("Total Beat Count:" + BN_Current.GetNodes().Count);
 }
Пример #2
0
    void DrawViewExtra(Rect totalRect, Vector2 v2_mousePos)
    {
        //Draw Node Counter
        GUI.color = Color.white;
        tempRect  = new Rect(totalRect.xMin + 5, totalRect.yMin + 5, 120, 20);
        GUI.Box(tempRect, "Beats Set:" + beats.GetNodes().Count.ToString() + "/" + i_totalBeats.ToString());

        //Draw Total Time
        GUI.color = Color.white;
        tempRect  = new Rect(totalRect.xMin + 5, totalRect.yMin + 30, 120, 20);
        GUI.Box(tempRect, "Clip Length:" + string.Format("{0:000.0}", beats.AC_ClipToPlay.length));

        //Draw Node Select
        if (i_curSelectPos != -1)
        {
            Node tempNode = beats.GetNodeByPos(i_curSelectPos);
            if (tempNode == null)
            {
                return;
            }
            List <float> beatsCenter = beats.BeatsCenterWithOffset(tempNode.i_BeatPos, tempNode.e_Type, f_beatEach);
            GUI.color = Color.white;
            tempRect  = new Rect(totalRect.xMin + 5, totalRect.yMin + 55, 120, 40 + beatsCenter.Count * 20);
            GUI.Box(tempRect, "");

            tempRect = new Rect(totalRect.xMin + 10, totalRect.yMin + 60, 110, 20);
            GUI.Label(tempRect, "Ind:" + beats.GetNodeIndex(i_curSelectPos).ToString() + "/Pos:" + i_curSelectPos.ToString());
            tempRect = new Rect(totalRect.xMin + 10, totalRect.yMin + 80, 110, 20);
            GUI.Label(tempRect, "Type:" + beats.GetNodeByPos(i_curSelectPos).e_Type.ToString());

            for (int i = 0; i < beatsCenter.Count; i++)
            {
                tempRect = new Rect(totalRect.xMin + 10, totalRect.yMin + 80 + (i + 1) * 20, 110, 20);
                GUI.Label(tempRect, "Beat " + (i + 1).ToString() + ":" + beatsCenter[i].ToString());
            }
        }

        //Draw Node Type Select
        foreach (int i in System.Enum.GetValues(typeof(enum_BeatType)))
        {
            if (i == -1)
            {
                continue;
            }
            enum_BeatType type = (enum_BeatType)i;
            //HighLight
            if (type == e_CurNodeType)
            {
                GUI.color = Color.grey;
                tempRect  = new Rect(totalRect.xMin + 5 - .1f * I_ViewBtnScale, totalRect.yMax - I_BeatCheckLine - 5 - (i * 1.1f + 1 + .1f) * I_ViewBtnScale, I_ViewBtnScale * 1.2f, I_ViewBtnScale * 1.2f);
                GUI.DrawTexture(tempRect, t2_BeatBtn);
            }
            //Draw Tips
            GUI.color = Color.white;
            tempRect  = new Rect(totalRect.xMin + 5 + I_ViewBtnScale + 10f, totalRect.yMax - I_BeatCheckLine - 5 - (i * 1.1f + 1) * I_ViewBtnScale, 80, I_ViewBtnScale);
            GUI.Box(tempRect, type.ToString());

            //Draw Btn
            GUI.color = GetNodeColor(true, type);
            tempRect  = new Rect(totalRect.xMin + 5, totalRect.yMax - I_BeatCheckLine - 5 - (i * 1.1f + 1) * I_ViewBtnScale, I_ViewBtnScale, I_ViewBtnScale);
            GUI.DrawTexture(tempRect, t2_BeatBtn);
            //Btn Click
            if (tempRect.Contains(v2_mousePos))
            {
                if (e_CurNodeType == type && i_curSelectPos != -1)
                {
                    beats.AdjustNode(i_curSelectPos, e_CurNodeType);
                }
                e_CurNodeType = type;
            }
        }

        if (f_curTime - beats.F_BeatStartOffset > f_beatCheck)      //Check Beats
        {
            f_beatCheck  += f_beatEach;
            f_beatToScale = 1f;
        }
        f_beatToScale = Mathf.Lerp(f_beatToScale, 0f, .02f);

        //Draw Beat Check Box
        GUI.color = Color.white;
        tempRect  = new Rect(totalRect.xMax - 5 - 20, totalRect.yMax - 120 * f_beatToScale - 5, 20, 120 * f_beatToScale);
        GUI.Box(tempRect, "B");
    }