private void ChangeTimeOfDay(Note.Name forNote) { switch (forNote) { case Note.Name.Animals: TimeOfDayManager.Instance.CurrentTime = TimeOfDay.Day; break; case Note.Name.Earth: TimeOfDayManager.Instance.CurrentTime = TimeOfDay.Evening; break; case Note.Name.Plants: TimeOfDayManager.Instance.CurrentTime = TimeOfDay.Morning; break; case Note.Name.Weather: TimeOfDayManager.Instance.CurrentTime = TimeOfDay.Night; break; } }
private void ChangeSeason(Note.Name forNote) { switch (forNote) { case Note.Name.Animals: SeasonManager.Instance.SetSeason(Season.Summer); break; case Note.Name.Earth: SeasonManager.Instance.SetSeason(Season.Autumn); break; case Note.Name.Plants: SeasonManager.Instance.SetSeason(Season.Spring); break; case Note.Name.Weather: SeasonManager.Instance.SetSeason(Season.Winter); break; } }
public Entity GetClosestInWithNotes(Vector3 position, float range, Note.Name note1, Note.Name note2, NoteSequence self) { var rangeSquared = range * range; float closestDistance = float.MaxValue; Entity closest = null; for (int i = 0; i < entities.Count; i++) { if (!entities[i].recipe.Equals(self) && ((entities[i].recipe.note1.NoteName & note1) > 0) && ((entities[i].recipe.note2.NoteName & note2) > 0)) { var dist = Vector3.SqrMagnitude(position - entities[i].Position); if (dist <= rangeSquared && dist < closestDistance) { closest = entities[i]; closestDistance = dist; } } } return(closest); }
public NoteSequence(Note.Name noteName1, Note.Name noteName2, Note.Name noteName3) { note1 = new Note(noteName1); note2 = new Note(noteName2); note3 = new Note(noteName3); }