Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        getCurrentHp = getTurnsInfo.getGameState();
        redTanksHp   = getCurrentHp.getHealthForPlayerTanks(PlayerColors.Red);
        blueTanksHp  = getCurrentHp.getHealthForPlayerTanks(PlayerColors.Blue);

        //box = RedTank1.GetComponent<TextMeshPro>();
        //Debug.Log(redTank1);

        //redTank1.SetText("LeveL "+ whatLevelIsThis.ToString());
        //Debug.Log("Red Tanks 1 hp is " + redTanksHp[0]);                        //hp of red tank 1
        //Debug.Log("Red Tanks 2 hp is " + redTanksHp[1]);                        //hp og red tank 2
        //Debug.Log("blue Tanks 1 hp is " + blueTanksHp[0]);                        //hp of blue tank 1
        //Debug.Log("blue Tanks 2 hp is " + blueTanksHp[1]);                        //hp og blue tank 2

        //Debug.Log(redTank1Childern[4]);                                         //reads back the 4th child object of red tank 1, it should be fire10
        //redTankChildern[6].gameObject.SetActive(true);                        //turns on child 6 of red tank 1, it should be the normal fire pre fab

        /*if (redTanksHp[0] <= 90)
         * {
         *  redTank1Childern[6].gameObject.SetActive(true);
         * }
         * if (blueTanksHp[0] <= 90)
         * {
         *  blueTank1Childern[6].gameObject.SetActive(true);
         * }
         */

        UpdateRedTanksLook();
        UpdateBlueTanksLook();

        //Debug.Log("AI is " + aIOn);
        whatRoundAmi  = getTurnsInfo.round.ToString();
        whoesTurnisIt = getTurnsInfo.playerTurn.ToString();

        //Debug.Log("Inside GUI move is " + getTurnsInfo.round + " " + getTurnsInfo.playerTurn);
        //Debug.Log("whatRoundAmi " + whatRoundAmi);
        //Debug.Log("whoesTurnisIt " + whoesTurnisIt);

        RedTankGUIController();
        BlueTankGUIController();
        UpDateTanksHpNum();
    }