public void AssignPlayersToInstructionFrame(int team, List <InstructionCard> instructions) { if (team == 1) { foreach (PlayerController pc in team1) { InstructionCardFrame icf = GetValidInstructionFrame(instructions); icf.instructionCard.isSelected = true; pc.currentlySelectedInstructionCard = icf.instructionCard; pc.currentSelectedColumn = icf.columnId; pc.currentSelectedRow = icf.rowId; pc.canvasPlayer.transform.position = new Vector3(icf.transform.position.x - (pc.canvasPlayer.GetComponent <RepairAvatar>().isPlayer2 ? -1.1f : 1.1f), icf.transform.position.y, icf.transform.position.z); pc.canvasPlayer.SetActive(true); pc.canMoveCanvasPlayer = true; pc.canvasPlayer.GetComponent <RepairAvatar>().animator.SetTrigger("NewCard"); pc.AssignCurrentInstructionCards(instructions); } } else { foreach (PlayerController pc in team2) { InstructionCardFrame icf = GetValidInstructionFrame(instructions); icf.instructionCard.isSelected = true; pc.currentlySelectedInstructionCard = icf.instructionCard; pc.currentSelectedColumn = icf.columnId; pc.currentSelectedRow = icf.rowId; pc.canvasPlayer.transform.position = new Vector3(icf.transform.position.x - (pc.canvasPlayer.GetComponent <RepairAvatar>().isPlayer2 ? -1.1f : 1.1f), icf.transform.position.y, icf.transform.position.z); pc.canvasPlayer.SetActive(true); pc.canMoveCanvasPlayer = true; pc.AssignCurrentInstructionCards(instructions); } } }
public void AssignToPlaceholder() { do { currentInstructionCard = _teamId == 1 ? GameManager.instance.instructionCardFramesTeam1[Random.Range(0, GameManager.instance.instructionCardFramesTeam1.Length)] : GameManager.instance.instructionCardFramesTeam2[Random.Range(0, GameManager.instance.instructionCardFramesTeam2.Length)]; } while (!currentInstructionCard || currentInstructionCard.InUse); currentInstructionCard.ActivateCard(this); }