private void Awake() { turnmanager = FindObjectOfType <PlayerTurnManager>(); swapButton.SetActive(false); peekButton.SetActive(false); removeButton.SetActive(false); }
void Awake() { GameObject playerOne = Instantiate( playerPrefab, SpawnPositionOne, Quaternion.identity); GameObject playerTwo = Instantiate( playerPrefab, SpawnPositionTwo, Quaternion.Euler(0, 0, 180)); playerOnesTurn = playerOne.GetComponent <PlayerTurnManager>(); playerTwosTurn = playerTwo.GetComponent <PlayerTurnManager>(); playerOneDamageReceived = playerOne.GetComponent <PlayerDamageReceived>(); playerTwoDamageReceived = playerTwo.GetComponent <PlayerDamageReceived>(); playerOneMovement = playerOne.GetComponent <PlayerMovement>(); playerTwoMovement = playerTwo.GetComponent <PlayerMovement>(); playerOnesTurn.IsYourTurn = true; }
private void DisplayActiveUnits() { PlayerTurnManager turnManager = currentPlayer.turnManager; foreach (ActiveUnitUI unitUI in unitUIs) { unitUI.ClearUnit(); } int idx = 0; foreach (KeyValuePair <Unit, ActionPoints> activeUnit in turnManager.ActiveUnits) { ActiveUnitUI unitUI = unitUIs[idx]; unitUI.SetUnit(currentPlayer, activeUnit.Key, activeUnit.Value, true); idx++; } bool hasSelectedNonActiveUnit = currentPlayer.CurrentUnit && !turnManager.ActiveUnits.ContainsKey(currentPlayer.CurrentUnit); bool hasFreeSlots = turnManager.ActiveUnits.Count < turnManager.MaxUnitsPerTurn; if (hasSelectedNonActiveUnit && hasFreeSlots) { ActiveUnitUI unitUI = unitUIs[turnManager.ActiveUnits.Count]; unitUI.SetUnit(currentPlayer, currentPlayer.CurrentUnit, new ActionPoints(true, true), false); } }
// Start is called before the first frame update void Start() { diceSides = Resources.LoadAll <Sprite>("New Images Asset/Dice/Default/"); DiceSpriteRenderer.sprite = diceSides[0]; gameplayManager = GameObject.Find("GameManager").GetComponent <GameplayManager>(); playerTurnManager = GameObject.Find("GameManager").GetComponent <PlayerTurnManager>(); }
public void StartGame(int p_nb_players) { m_market = new RealEstateMarket(p_nb_players); TileManager.LoadSetUpTiles(m_market.Stacks.LoadedTiles); TileView.InitProperties(); m_game_manager = new TileManager(); m_game_manager.InitPlayers(p_nb_players); m_current_player = 0; m_remaining_turns = -1; m_turn_manager = new PlayerTurnManager(); m_eventBus.FireEvent(new EventGameStarted()); }
// Start is called before the first frame update void Start() { spawnPlayer(); newDice = GameObject.Find("Dice").GetComponent <NewDice>(); playerTurnManager = GameObject.Find("GameManager").GetComponent <PlayerTurnManager>(); cardManager = GameObject.Find("CardManager").GetComponent <CardManager>(); itemManager = GameObject.Find("ItemManager").GetComponent <ItemManager>(); cardManager.PlayerPointbarObject = playerPointbar; }
void Start() { turnManager = GetComponent <PlayerTurnManager>(); planetRadius = transform.position.magnitude; currentAngle = transform.rotation.z * 180 + 90; //print("PlayerMovement.currentAngle: " + currentAngle); //print("rotation.z = " + transform.rotation.z); IsFacingRight = transform.localScale.x > 0; animator = GetComponentInChildren <Animator>(); movesLeft = movesPerTurn; //TestCollisionWithExtraCollider(); unitCirclePosition.x = Cos(currentAngle * Deg2Rad); unitCirclePosition.y = Sin(currentAngle * Deg2Rad); }
private void Start() { turnManager = GetComponent <PlayerTurnManager>(); playerDirection = GetComponent <PlayerMovement>(); throwSound = GetComponent <AudioSource>(); }
//private readonly string mkTint = "_Color"; void Start() { glowRenderer = GetComponent <SpriteRenderer>(); turnManager = GetComponentInParent <PlayerTurnManager>(); emissionColor = Color.red; }
public void StartGame(int p_nb_players) { m_market = new RealEstateMarket (p_nb_players); TileManager.LoadSetUpTiles (m_market.Stacks.LoadedTiles); TileView.InitProperties (); m_game_manager = new TileManager (); m_game_manager.InitPlayers (p_nb_players); m_current_player = 0; m_remaining_turns = -1; m_turn_manager = new PlayerTurnManager(); m_eventBus.FireEvent(new EventGameStarted()); }