Beispiel #1
0
    public static void PlayerTurn(int playerNumber)
    {
        GUIScript.LogStatus("Player {0} turn", playerNumber);
        var cardSelect = GameObject.FindObjectOfType <CardSelectScript>();

        cardSelect.canDrawCards = CardDrawPerTurn;
    }
Beispiel #2
0
    public static void StartRound(int playerNumber)
    {
        GUIScript.LogStatus("Starting round");
        var charSelect = GameObject.FindObjectOfType <CharSelectScript>();

        charSelect.FlopUnselectedChars();
        // TODO: Set players turns
        PlayerTurn(playerNumber);
    }
Beispiel #3
0
    public void StartGame()
    {
        startButton.enabled = false;
        startButton.GetComponentInChildren <CanvasGroup>().alpha = 0;
        GUIScript.LogStatus("Starting game");
        var charSelect = GameObject.FindObjectOfType <CharSelectScript>();

        charSelect.InitCharSelect();
    }
Beispiel #4
0
 public void FlopUnselectedChars()
 {
     foreach (var characterObj in this.charsObjs)
     {
         var charScript = characterObj.GetComponent(typeof(CharacterScript)) as CharacterScript;
         if (!charScript.isSelected)
         {
             GUIScript.LogStatus("Char {0} flipped", charScript.charType);
             characterObj.SetActive(false);
         }
     }
 }
Beispiel #5
0
    public void takeCard(GameObject card)
    {
        card.transform.position =
            new Vector3(
                cardPlace.transform.position.x,
                cardPlace.transform.position.y,
                cardPlace.transform.position.z
                );
        cardPlace.SetActive(false);
        availableCards[0] = card;
        var cardScript = card.GetComponent(typeof(CardScript)) as CardScript;

        GUIScript.LogStatus("Card {0} taken by player no {1}", cardScript.price, this.playerNumber);
    }
Beispiel #6
0
    public void playCharacter(GameObject charObject)
    {
        var charScript = charObject.GetComponent(typeof(CharacterScript)) as CharacterScript;

        GUIScript.LogStatus(
            "Player no {0} playing character {1}",
            this.playerNumber,
            charScript.charType);
        charObject.transform.position =
            new Vector3(
                activeCharacter.transform.position.x,
                activeCharacter.transform.position.y,
                activeCharacter.transform.position.z
                );
        activeCharacter = charObject;
    }
Beispiel #7
0
    public void setCharacter(GameObject charObject)
    {
        charObject.transform.position =
            new Vector3(
                selectedCharacter.transform.position.x,
                selectedCharacter.transform.position.y,
                selectedCharacter.transform.position.z
                );
        selectedCharacter.SetActive(false);
        selectedCharacter = charObject;

        var charScript = charObject.GetComponent(typeof(CharacterScript)) as CharacterScript;

        GUIScript.LogStatus(
            "Player no {0} picked character {1}",
            this.playerNumber,
            charScript.charType);

        GUIScript.StartRound(playerNumber);
    }