private void OnMouseButtonUp() { LetterBox letterBox = GetLetterBox(); if (letterBox != null && letterBox.Letter == _letter.AlphabetLetter && letterBox.LetterBoxState != LetterBoxState.Filled) { letterBox.FillCell(); Destroy(_attachedLetter.gameObject); _attachedLetter = null; //Проверка на полностью составленное слово GameState.Instance.CheckWordOnCollection(); } else if (letterBox != null) { var letterRig = _attachedLetter.GetComponent <Rigidbody>(); letterRig.isKinematic = false; letterRig.AddForce(Vector3.forward * 2, ForceMode.Impulse); _attachedLetter = null; } else { _attachedLetter.GetComponent <Rigidbody>().isKinematic = false; _attachedLetter = null; } }
private void FontPreviewSurface_MouseDown(object sender, MouseEventArgs e) { var position = GetRelativeMouseLocation(e.Location, FontPreviewSurface); var selectedLetterBox = (LetterBox)null; foreach (var letterBox in m_letters) { if (letterBox.Rect.Contains(position)) { if (!letterBox.IsSelected) { letterBox.IsSelected = true; selectedLetterBox = letterBox; } else { letterBox.IsSelected = false; } } else { letterBox.IsSelected = false; } } m_selectedLetterBox = selectedLetterBox; FontPreviewSurface.Invalidate(); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + TitleUnicode.GetHashCode(); hash = hash * 23 + TitleRoman.GetHashCode(); hash = hash * 23 + ArtistUnicode.GetHashCode(); hash = hash * 23 + ArtistRoman.GetHashCode(); hash = hash * 23 + Creator.GetHashCode(); hash = hash * 23 + DiffName.GetHashCode(); hash = hash * 23 + Mp3Name.GetHashCode(); hash = hash * 23 + Md5.GetHashCode(); hash = hash * 23 + OsuFileName.GetHashCode(); hash = hash * 23 + Tags.GetHashCode(); hash = hash * 23 + Somestuff.GetHashCode(); hash = hash * 23 + _state.GetHashCode(); hash = hash * 23 + Circles.GetHashCode(); hash = hash * 23 + Sliders.GetHashCode(); hash = hash * 23 + Spinners.GetHashCode(); hash = hash * 23 + EditDate.GetHashCode(); hash = hash * 23 + ApproachRate.GetHashCode(); hash = hash * 23 + CircleSize.GetHashCode(); hash = hash * 23 + HpDrainRate.GetHashCode(); hash = hash * 23 + OverallDifficulty.GetHashCode(); hash = hash * 23 + SliderVelocity.GetHashCode(); hash = hash * 23 + DrainingTime.GetHashCode(); hash = hash * 23 + TotalTime.GetHashCode(); hash = hash * 23 + PreviewTime.GetHashCode(); hash = hash * 23 + MapId.GetHashCode(); hash = hash * 23 + MapSetId.GetHashCode(); hash = hash * 23 + ThreadId.GetHashCode(); hash = hash * 23 + OsuGrade.GetHashCode(); hash = hash * 23 + TaikoGrade.GetHashCode(); hash = hash * 23 + CatchGrade.GetHashCode(); hash = hash * 23 + ManiaGrade.GetHashCode(); hash = hash * 23 + Offset.GetHashCode(); hash = hash * 23 + StackLeniency.GetHashCode(); hash = hash * 23 + PlayMode.GetHashCode(); hash = hash * 23 + Source.GetHashCode(); hash = hash * 23 + AudioOffset.GetHashCode(); hash = hash * 23 + LetterBox.GetHashCode(); hash = hash * 23 + Played.GetHashCode(); hash = hash * 23 + LastPlayed.GetHashCode(); hash = hash * 23 + IsOsz2.GetHashCode(); hash = hash * 23 + Dir.GetHashCode(); //hash = hash * 23 + LastSync.GetHashCode(); //This value is updated by osu even if no changes were made to the actual data hash = hash * 23 + DisableHitsounds.GetHashCode(); hash = hash * 23 + DisableSkin.GetHashCode(); hash = hash * 23 + DisableSb.GetHashCode(); hash = hash * 23 + BgDim.GetHashCode(); hash = hash * 23 + ModPpStars.GetHashCode(); hash = hash * 23 + MaxBpm.GetHashCode(); hash = hash * 23 + MinBpm.GetHashCode(); hash = hash * 23 + MainBpm.GetHashCode(); return(hash); } }
void CheckForLetterGrab() { if (Input.GetMouseButtonDown(0)) { LetterBox letter = LetterUnderMouse(); if (letter != null) { letter.GrabLetter(); } } }
void RemoveAllLetters() { for (int i = 0; i < letterContainer.transform.childCount; i++) { LetterBox letter = letterContainer.transform.GetChild(i).GetComponent <LetterBox>(); if (letter != null && !letter.InPosition) { Destroy(letter.gameObject); } } }
LetterBox NewLetter(char c) { LetterBox letter = Instantiate <LetterBox>(letterBoxPrefab); letter.transform.SetParent(transform); letter.ContainedLetter = c; letter.audioSource.clip = null; for (int i = 0; i < audioData.Length; i++) { if (audioData[i].ch == c) { letter.audioSource.clip = audioData[i].clip; break; } } return(letter); }
public void SetupLetters(WordData wordData) { List <LetterBox> letters = new List <LetterBox>(); for (int i = 0; i < wordData.word.Length; i++) { letters.Add(NewLetter(wordData.word[i])); } while (letters.Count < letterCount) { letters.Add(NewLetter(wordData.word[Random.Range(0, wordData.word.Length)])); } int idx = 0; while (letters.Count > 0) { int pos = Random.Range(0, letters.Count); LetterBox letter = letters[pos]; letters.RemoveAt(pos); letter.transform.position = startPos + spawnSpacing * (idx++); } }