コード例 #1
0
 private void Awake()
 {
     turnmanager = FindObjectOfType <PlayerTurnManager>();
     swapButton.SetActive(false);
     peekButton.SetActive(false);
     removeButton.SetActive(false);
 }
コード例 #2
0
    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;
    }
コード例 #3
0
ファイル: PlayerUI.cs プロジェクト: nekorushi/ValleyOfFire
    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);
        }
    }
コード例 #4
0
    // 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>();
    }
コード例 #5
0
ファイル: Suburbia.cs プロジェクト: Nemikolh/suburbia
 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());
 }
コード例 #6
0
    // 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;
    }
コード例 #7
0
    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);
    }
コード例 #8
0
 private void Start()
 {
     turnManager     = GetComponent <PlayerTurnManager>();
     playerDirection = GetComponent <PlayerMovement>();
     throwSound      = GetComponent <AudioSource>();
 }
コード例 #9
0
    //private readonly string mkTint = "_Color";


    void Start()
    {
        glowRenderer  = GetComponent <SpriteRenderer>();
        turnManager   = GetComponentInParent <PlayerTurnManager>();
        emissionColor = Color.red;
    }
コード例 #10
0
ファイル: Suburbia.cs プロジェクト: dpekar/suburbia
 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());
 }