void SetBubbles(int i) { if (i == 0) { ActivateGameObject(speechBubble.gameObject, false); } else if (i == 1) { ActivateGameObject(speechBubble.gameObject, true); speechBubble.sprite = sideBubble; speechBubble.flipX = false; } else if (i == 2) { ActivateGameObject(speechBubble.gameObject, true); speechBubble.sprite = middleBubble; } else if (i == 3) { ActivateGameObject(speechBubble.gameObject, true); speechBubble.sprite = sideBubble; speechBubble.flipX = true; } if (i != 0) { wordRecognized = phrase; personGuessing = players[i - 1]; bubbleText.text = wordRecognized; } }
void SetBubbles(string word) { ActivateGameObject(speechBubble.gameObject, true); speechBubble.sprite = sideBubble; speechBubble.flipX = false; wordRecognized = word; personGuessing = players[0]; bubbleText.text = wordRecognized; }
void AIGuess(int i) { if ((gameState == Game2State.Demand || gameState == Game2State.Negate) && canGuess) { recognizedNewWord = false; wordRecognized = phrase; ActivateGameObject(phraseText.gameObject, true); SetBubbles(i + 1); gameState = Game2State.Phrase; phraseText.text = wordRecognized; phraseTimer = 0f; newState = true; personGuessing = players[i]; } }
public IEnumerator MoveCharacters(Game1Player player, Vector3 dest) { Vector3 startingPos = player.transform.position; Vector3 endPos = dest; //Vector3 endPos = ???? float moveTimer = 0f; float percent = 0f; while (moveTimer < movePlayerSpeed) { moveTimer += Time.deltaTime; percent = moveTimer / movePlayerSpeed; player.transform.position = Vector3.Lerp(startingPos, endPos, movePlayersCurve.Evaluate(percent)); player.transform.localScale = Vector3.Lerp(Vector3.one, Vector3.one * 0.35f, movePlayersCurve.Evaluate(percent)); yield return(null); } }
public WordSelection(bool selected, Game1Player player) { this.selected = selected; this.player = player; }