public static void RemoveVote(EatLocation location) { if (_instance._votes.ContainsKey(location.Name)) { --_instance._votes[location.Name]; } else { Debug.LogError("No such location: " + location.Name); } UpdateVoteString(); }
public static void ShowSuggestion(EatLocation location) { if (!_instance.gameObject.activeInHierarchy) { _instance._card.IsSuggestion = true; CardMgr.singleton.AddSuggestion(_instance._card); _instance.ResetCardPos(); _instance._card.Setup(location); _instance.gameObject.SetActive(true); } else { QueueLoc.Enqueue(location); } }
public void Setup(EatLocation location) { Location = location; _txtName.text = location.Name; _txtDesc.text = location.Description; if (location.Sprite != null) { _img.sprite = location.Sprite; } if (location.MamaSays.Count > 0) { var random = Random.Range(0, location.MamaSays.Count); _txtMama.text = location.MamaSays[random]; } else { _txtMama.text = "..."; } }
void RpcSendSuggestion(string s, string desc) { EatLocation location; if (!EatLocation.Presets.TryGetValue(s, out location)) { location = new EatLocation(s, desc); } VoteTracker.AddVote(location); VotesWindow.singleton.RefreshVotes(); foreach (var player in Players) { if (player != this) { ++player.remainingSuggestions; } } if (!isLocalPlayer) { ReceiveSuggestion.ShowSuggestion(location); } }
public static void AddVote(EatLocation location) { AddVote(location.Name); }
void Awake() { EatLocation.Init(_locations); }