public void Press() { if (laneState == LaneState.none) { float hitTime = TimerScript.timePass; laneNotes = NoteRenderer.allnotes[laneNumber]; for (int i = 0; i < laneNotes.Count; i++) { NoteDescription note = laneNotes [i]; float hitDeltaTime = GetHitDeltaTime(hitTime, note.HitTime); if (InRange(hitDeltaTime)) { if (note.NoteState == 0) { CalculatePercentage(hitDeltaTime, note); DestroyNote(note); break; } } else { break; } } } }
//edit desc public void EditNoteApplication() { EditNote.ClickWait(); NoteDescription.EnterClearText("Description" + RandomNumber.smallNumber()); ConfirmCreateNote.ClickOn(); softAssert.VerifySuccessMsg(); }
//create new note applicaiton public void CreateNewNoteApplication() { CreateNewNote.ClickOn(); NoteDescription.SendKeys(Constant.noteName); ConfirmCreateNote.ClickOn(); softAssert.VerifySuccessMsg(); }
void GenTestNote(){ //for generating further notes, will be removed later float x = 20; GameObject note = Instantiate(Resources.Load("Note")) as GameObject; int random = Random.Range (0, 4); note.transform.position = new Vector3 (lanePosition [random].position.x, 0.03f, lanePosition [random].position.z - 13f + x); NoteDescription noteDescription = note.GetComponent<NoteDescription> (); //Debug.Log ("before " + noteDescription.ToString()); // s = vt noteDescription = new NoteDescription(TimerScript.timePass + x/Runner.speed, random, 1, 0); noteDescription.NoteObject = note; //Debug.Log ("after " + noteDescription); allnotes[random].Add(noteDescription); }
private float CalculatePercentage (float hitDeltaTime, NoteDescription note){ //120 max float score = 0; if (note.NoteState == 0) { if (hitDeltaTime < 60) { // Fantastic score = 100; } else if (hitDeltaTime < 100) { // Good score = 50; } else { // Bad score = 10; } note.NoteState = 1; } Debug.Log (score); return score; }
void GenTestNote() { //for generating further notes, will be removed later float x = 20; GameObject note = Instantiate(Resources.Load("Note")) as GameObject; int random = Random.Range(0, 4); note.transform.position = new Vector3(lanePosition [random].position.x, 0.03f, lanePosition [random].position.z - 13f + x); NoteDescription noteDescription = note.GetComponent <NoteDescription> (); //Debug.Log ("before " + noteDescription.ToString()); // s = vt noteDescription = new NoteDescription(TimerScript.timePass + x / Runner.speed, random, 1, 0); noteDescription.NoteObject = note; //Debug.Log ("after " + noteDescription); allnotes[random].Add(noteDescription); }
void Update() { allnotes = NoteRenderer.allnotes; for (int i = 0; i < allnotes.Length; i++) { laneNotes = NoteRenderer.allnotes[i]; if (laneNotes.Count > 0) { NoteDescription note = laneNotes [0]; float deltaTime = GetDeltaTime(note.HitTime); if (OutRange(deltaTime)) { Debug.Log(0); note.DestroySelf(); laneNotes.Remove(note); } } } }
private float CalculatePercentage(float hitDeltaTime, NoteDescription note) { //120 max float score = 0; if (note.NoteState == 0) { if (hitDeltaTime < 60) // Fantastic { score = 100; } else if (hitDeltaTime < 100) // Good { score = 50; } else // Bad { score = 10; } note.NoteState = 1; } Debug.Log(score); return(score); }
public void DestroyNote(NoteDescription note){ laneNotes.Remove (note); note.DestroySelf (); note = null; }
public void DestroyNote(NoteDescription note) { laneNotes.Remove(note); note.DestroySelf(); note = null; }