public void Set(Guess guess, int player, bool isAccusation = false) { text.text = "Player " + player + (isAccusation ? "'s Accusation" : "'s Guess"); character.texture = CharacterResourceManager.CardImageTexture(guess.Character); weapon.texture = CharacterResourceManager.CardImageTexture(guess.Weapon); room.texture = CharacterResourceManager.CardImageTexture(guess.Room); }
// Start is called before the first frame update void Start() { List <CharacterResourceManager.Cards> playerCards = ClueData.Instance.GetPlayerCards(0); for (int i = 0; i < rawImages.Length; i++) { Texture2D texture = CharacterResourceManager.CardImageTexture(playerCards[i]); rawImages[i].GetComponent <RawImage>().texture = texture; } }
// Start is called before the first frame update void Start() { character.target = CharacterResourceManager.CardImageTexture(ClueData.Instance.Solution.Character); weapon.target = CharacterResourceManager.CardImageTexture(ClueData.Instance.Solution.Weapon); room.target = CharacterResourceManager.CardImageTexture(ClueData.Instance.Solution.Room); currentActive = 0; character.Activate(); source.clip = drum; source.loop = true; source.Play(); }
public void Set(Guess guess) { character.texture = CharacterResourceManager.CardImageTexture(guess.Character); weapon.texture = CharacterResourceManager.CardImageTexture(guess.Weapon); room.texture = CharacterResourceManager.CardImageTexture(guess.Room); }
public void FindingCards() { CharacterResourceManager.Cards cardToShow = CharacterResourceManager.Cards.Antifreeze; TurnState targetState = TurnState.PreTurn; int showedCardSource = -1; // sure turnManager.PushStack(); int cT = turnManager.CurrentTurn; bool control = true; // yes, this is how lazy i am, no need to bother writing a real algorithm while (control) { turnManager.NextTurn(); if (turnManager.CurrentTurn == cT) { targetState = TurnState.AccusationOption; control = false; } else { // Yes, this is going to be how it works, deal with it (in real clue there is a choice of what card to show) if (ClueData.Instance.HasPlayerCard(guess.Character, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Character; showedCardSource = turnManager.CurrentTurn; } else if (ClueData.Instance.HasPlayerCard(guess.Weapon, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Weapon; showedCardSource = turnManager.CurrentTurn; } else if (ClueData.Instance.HasPlayerCard(guess.Room, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Room; showedCardSource = turnManager.CurrentTurn; } } } turnManager.PopStack(); if (targetState.Equals(TurnState.ShowingCards)) { ClueData.Instance.ShowPlayerCard(cardToShow, turnManager.CurrentTurn - 1); if (IsCurrentTurnHuman() || showedCardSource == 1) { cardShow.Set(CharacterResourceManager.CardImageTexture(cardToShow), showedCardSource); } else { cardShow.Set(cardBack, showedCardSource); } guessDisplay.gameObject.SetActive(false); humanCardsDisplay.ShowAll(); cardShow.gameObject.SetActive(true); turnState = TurnState.ShowingCards; } else if (targetState.Equals(TurnState.AccusationOption)) { guessDisplay.gameObject.SetActive(false); humanCardsDisplay.ShowAll(); isSelected = false; aiTimer = 0; makeAccusation = false; accusationOption.Set(guess); accusationOption.gameObject.SetActive(true); turnState = TurnState.AccusationOption; } }