Exemplo n.º 1
0
        //理想のタイミングとの差の表示
        protected void displayTimeDifference(Note aNote, float aDifference)
        {
            TextMesh    tText      = MyBehaviour.createObjectFromPrefab <TextMesh>("score/parts/evaluationDifference");
            MyBehaviour tBehaviour = tText.GetComponent <MyBehaviour>();

            tText.name = "timeDifference";
            //テキスト設定
            double tDifference = Math.Round(Mathf.Abs(aDifference), 2);

            if (tDifference == 0)
            {
                tText.text  = "just";
                tText.color = new Color(0, 1, 0);
            }
            else if (aDifference < 0)
            {
                tText.text  = "-" + tDifference.ToString();
                tText.color = new Color(0, 0, 1);
            }
            else if (aDifference > 0)
            {
                tText.text  = "+" + tDifference.ToString();
                tText.color = new Color(1, 0, 0);
            }
            //表示位置調整
            tBehaviour.transform.parent        = parent.mScore.transform;
            tBehaviour.transform.localScale    = new Vector3(1.7f, 1.7f, 1);
            tBehaviour.transform.localPosition = new Vector3(0, 0, 0);
            tBehaviour.transform.Translate(aNote.transform.position - parent.mScore.transform.position);
            tBehaviour.positionZ  = -2;
            tBehaviour.positionY -= 1.5f;
            //削除
            tBehaviour.setTimeout(2, () => {
                tBehaviour.delete();
            });
        }