void Start() { wc = GetComponent <WordComponent>(); if (wc == null) { Debug.LogError("Car spawned without a WordComponent!"); } distToPark = Vector3.Distance(startPos, parkPos); distToEnd = Vector3.Distance(parkPos, endPos); startedDrive = Time.time; }
public void RemoveWordFromPlay(WordComponent go, bool completed) { if (ActiveWords.Contains(go) == false) { Debug.LogError("Trying to remove a word from play, that isn't in play!"); return; } if (completed) { st.ChangeWordsTyped(1); } ActiveWords.Remove(go); }
private List <CombinedAnimalAdjective> GetStoredString() { string fullString = storage.GetFullStringFromPreferences(); string[] splitString = fullString.Split(seperator); List <CombinedAnimalAdjective> allStoredAAs = new List <CombinedAnimalAdjective> (); foreach (string s in splitString) { if (!String.IsNullOrEmpty(s)) { string[] splitS = s.Split(animalToAdjectiveSeperator); Adjective adjective = new Adjective(splitS[0], fileReader); Animal animal = new Animal(splitS[1], fileReader); WordComponent[] wordComponents = new WordComponent[2]; wordComponents [0] = adjective; wordComponents [1] = animal; CombinedAnimalAdjective combined = new CombinedAnimalAdjective(wordComponents); allStoredAAs.Add(combined); } } return(allStoredAAs); }