Exemplo n.º 1
0
        public void InitStartGame(bool enablePaintWeapon)
        {
            #if UNITY_ANDROID
            if (ois.player1Exposer.playerAgent.players[0] && ois.player1Exposer.playerAgent.players[1])
            {
                PlayerGUI[0].SetActive(false);
                PlayerGUI[1].SetActive(true);
            }
            else
            {
                PlayerGUI[0].SetActive(true);
                PlayerGUI[1].SetActive(false);
            }
            #endif
            // TODO : reset position of players and to reset all values of intent
            gameIsStart = true;
            timer       = StartCoroutine(CounterTimeLeft());
            players.Add(ois.player1Exposer.playerTransform);
            players.Add(ois.player2Exposer.playerTransform);

            winnerId = -1;

            for (int i = 0; i < GameStateRules.MAX_ITEMS; i++)
            {
                items.Add(ois.itemExposer[i].ItemGameObject);
            }

            GameStateRules.Init(ref gs, enablePaintWeapon);
            SetItemsPosition();
            InitItemsType();
            PopObstacle();
        }
Exemplo n.º 2
0
    public void StartGame(IAgent[] agents)
    {
        for (var i = 0; i < players.Length; i++)
        {
            playerAgents[i] = agents[i];
            //    playerViews[i] = players[i].transform;
        }

        GameStateRules.Init(ref GameParameters.Instance.Parameters, ref gs, this);
    }