Пример #1
0
 public void Drop(GameManager.gameState roomToGoTo)
 {
     GetComponent <Image>().color = GameManager.instance.transitionColor;
     move               = dropinState.dropIn;
     this.roomToGoTo    = roomToGoTo;
     winnerText.enabled = false;
 }
Пример #2
0
    // Use this for initialization

    public override void gameStateStart()
    {
        availableTransitions = new GameManager.gameState[1];
        //-----
        availableTransitions[0] = GameManager.gameState.inArena;
        //-----
        base.gameStateStart();
    }
 // Use this for initialization
 public override void gameStateStart()
 {
     availableTransitions = new GameManager.gameState[2];
     //-----
     availableTransitions[0] = GameManager.gameState.mainMenu;
     availableTransitions[1] = GameManager.gameState.cardMenu;
     //-----
 }
    int maxPlayers = 5;                                             //The max amount of players that we check input for.
    // Use this for initialization
    public override void gameStateStart()
    {
        //This code limits the gamemanager in what scenes it could change to.
        availableTransitions    = new GameManager.gameState[1];
        availableTransitions[0] = GameManager.gameState.inArena;
        //-----
        base.gameStateStart();

        //if this is the first round give the players the standard prefabs from a list.
        if (GameManager.instance.firstRound)
        {
            for (int i = 0; i < 5; i++)
            {
                GameManager.instance.prefabArray[i] = (GameObject[])defaultPrefabs.Clone();
            }
        }

        //Because the Gamemanager is a persistant object, We have to reassign all objects whenever the cardmenu gets loaded.
        if (textBanner == null)
        {
            textBanner = GameObject.Find("PressStartBanner");
            textBanner.SetActive(false);
        }
        if (playable == null)
        {
            playable = GameObject.Find("Playable");
            playable.SetActive(false);
        }
        if (helpMenu == null)
        {
            helpMenu = GameObject.Find("TutorialBanner");
            if (GameManager.instance.firstRound)
            {
                helpMenu.GetComponent <TutorialBanner>().moveDown();
            }                                                       //if it is the first round, it will automatically show the controls.
        }
        if (menu == null)
        {
            menu = GameObject.Find("Menu");
        }
        for (int i = 0; i < startScreen.Length; i++)
        {
            if (startScreen[i] == null)
            {
                startScreen[i] = GameObject.Find("Cards" + i).GetComponent <CustomizeCards>();
            }
        }
        isThisFirstRound(); //If it is the first round it will skip the part where players can enter the game, and it will go straight to the card menu.

        //Plays the game's music when it starts.
        if (GameManager.instance.firstRound == true)
        {
            //Plays the main song.
            GameManager.instance.SongPlay(1, true);
            GameManager.instance.SongTransition(GameManager.musicState.fadeOut);
        }
    }
Пример #5
0
 //Draws a text on the screen
 public void Drop(GameManager.gameState roomToGoTo, int winner)
 {
     winnerText.enabled           = true;
     GetComponent <Image>().color = GameManager.instance.transitionColor;
     move            = dropinState.dropIn;
     this.roomToGoTo = roomToGoTo;
     GameManager.instance.winnerText = string.Format(possibleTexts[Random.Range(0, possibleTexts.Length)], winner);
     winnerText.text = GameManager.instance.winnerText;
 }
Пример #6
0
 // Use this for initialization
 public override void gameStateStart()
 {
     availableTransitions = new GameManager.gameState[2];
     //-----
     availableTransitions[0] = GameManager.gameState.cardMenu;
     availableTransitions[1] = GameManager.gameState.endOfMatch;
     //-----
     base.gameStateStart();
     StartCoroutine(CalculateSwitch(5));
 }
Пример #7
0
 // Use this for initialization
 public override void gameStateStart()
 {
     availableTransitions = new GameManager.gameState[1];
     //-----
     availableTransitions[0] = GameManager.gameState.endOfMatchMenu;
     //-----
     base.gameStateStart();
     GameManager.instance.SpawnPlayers();
     timeToSwitch = 5;
 }
Пример #8
0
 public void Drop(Color textureColor, GameManager.gameState roomToGoTo)
 {
     if (textureColor != null)
     {
         GetComponent <Image>().color = textureColor;
     }
     move               = dropinState.dropIn;
     this.roomToGoTo    = roomToGoTo;
     winnerText.enabled = false;
 }
Пример #9
0
 public void Drop(Color textureColor, GameManager.gameState roomToGoTo, int bounces, float bounceFriction)
 {
     if (textureColor != null)
     {
         GetComponent <Image>().color = textureColor;
     }
     move                = dropinState.dropIn;
     this.roomToGoTo     = roomToGoTo;
     this.bounces        = bounces;
     this.bounceFriction = bounceFriction;
     winnerText.enabled  = false;
 }
    // Use this for initialization
    public override void gameStateStart()
    {
        availableTransitions = new GameManager.gameState[1];
        //-----
        availableTransitions[0] = GameManager.gameState.inbetweenRounds;

        GameManager.instance.firstRound = false;

        //-----
        base.gameStateStart();

        GameManager.instance.SpawnPlayers();
        Ps = gameObject.GetComponent <playerStats>();

        Ps.Init(GameManager.instance.playersHolder);


        // countdown round related
        finalCD = gameObject.GetComponent <ItsTheFinalCountdown>();
        finalCD.StartRoundCooldown();
    }
Пример #11
0
    void CheckCursorState(GameManager.gameState gameState)
    {
#if UNITY_WEBGL
        if (gameState == GameManager.gameState.game && !isOverPauseButton)
        {
            UnityEngine.Cursor.SetCursor(aimCursor, new Vector2(aimCursor.width / 2, aimCursor.height / 2), CursorMode.ForceSoftware);
        }
        else
        {
            UnityEngine.Cursor.SetCursor(null, Vector2.zero, CursorMode.ForceSoftware);
        }
#else
        if (gameState == GameManager.gameState.game && !isOverPauseButton)
        {
            UnityEngine.Cursor.SetCursor(aimCursor, new Vector2(aimCursor.width / 2, aimCursor.height / 2), CursorMode.Auto);
        }
        else
        {
            UnityEngine.Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
        }
#endif
    }
Пример #12
0
 private void CheckGameState(GameManager.gameState newGamestate)
 {
     gameState = newGamestate;
 }