示例#1
0
        public override ENoteGrade OnTouch(EFingerAction action, int fingerId)
        {
            if (bGetResult)
            {
                return(ENoteGrade.UNKNOWN);
            }
            ENoteGrade grade = ENoteGrade.UNKNOWN;

            if (NoR2252Application.VideoTime <= Note.Info.endTime - NoR2252Data.Instance.TimeGrade [(int)ENoteGrade.MISS])
            {
                return(grade);
            }
            float offset = Mathf.Abs(NoR2252Application.VideoTime - Note.Info.endTime);

            //give the grade a factor make it much easier
            grade = GetGrade(offset, NoR2252Data.Instance.SlideChildGradeFactor);
            //if fingerID exist check if the same finger with pre note of slide
            if (Note.Controller.SlideFinger.ContainsKey(fingerId))
            {
                if (Note.Controller.SlideFinger [fingerId] != Note.Info.id)
                {
                    grade = ENoteGrade.MISS;
                }
            }
            //if its a new finger got miss grade
            else
            {
                grade = ENoteGrade.MISS;
            }
            GetResult(grade);
            return(grade);
        }
示例#2
0
 /// <summary>if this note being touch it will return the result of this touch</summary>
 /// <param name="action">which kind of touch action on this note</param>
 /// <param name="fingerId">the fingerIndex of this touch</param>
 public ENoteGrade OnTouch(EFingerAction action, int fingerId)
 {
     if (strategy != null)
     {
         ENoteGrade result = strategy.OnTouch(action, fingerId);
         return(result);
     }
     else
     {
         return(ENoteGrade.UNKNOWN);
     }
 }
示例#3
0
        public override ENoteGrade OnTouch(EFingerAction action, int fingerId)
        {
            ENoteGrade grade  = ENoteGrade.UNKNOWN;
            float      offset = 0f;

            //if action is down check its grade amd bJuding equals to false
            //bJudging is to prevent the sameNote being judge several times
            if (action == EFingerAction.DOWN && !bJudging)
            {
                offset = Mathf.Abs(NoR2252Application.VideoTime - Note.Info.startTime);
                grade  = GetGrade(offset);
                //if grade is miss or bad just return the result and recycle self
                if (grade == ENoteGrade.BAD || grade == ENoteGrade.MISS)
                {
                    bJudging = true;
                    GetResult(grade);
                }
                //if grade not equal to UNKNOWN MISS BAD then start holding this note
                else if (grade != ENoteGrade.UNKNOWN)
                {
                    bHolding = true;
                    bJudging = true;
                }
            }

            //if player release finger before note end time
            //give it a grade
            //if this note has bJuding about press down action and not get the result take the grade of it
            else if (action == EFingerAction.UP && bJudging && bHolding && !bGetResult)
            {
                bGetResult = true;
                bHolding   = false;
                offset     = Mathf.Abs(NoR2252Application.VideoTime - Note.Info.endTime);
                grade      = GetGrade(offset);
                if (grade == ENoteGrade.UNKNOWN)
                {
                    grade = ENoteGrade.MISS;
                }
                GetResult(grade);
            }
            //if player keep holding return UNKNOWN
            else if (action == EFingerAction.SET)
            {
                if (!bGetResult && bHolding)
                {
                    grade = ENoteGrade.UNKNOWN;
                }
            }
            return(grade);
        }
示例#4
0
        public override ENoteGrade OnTouch(EFingerAction action, int fingerId)
        {
            ENoteGrade grade = ENoteGrade.UNKNOWN;

            //if current video time is in the judge time range or not
            if (NoR2252Application.VideoTime <= Note.Info.endTime - NoR2252Data.Instance.TimeGrade [(int)ENoteGrade.MISS])
            {
                return(grade);
            }
            float offset = Mathf.Abs(NoR2252Application.VideoTime - Note.Info.endTime);

            grade = GetGrade(offset);
            GetResult(grade);
            return(grade);
        }
示例#5
0
 /// <summary>define the action when this note being touch</summary>
 public abstract ENoteGrade OnTouch(EFingerAction action, int fingerId);