Example #1
0
        public void OnSynchronizedStart(Match m)
        {
            Debug.Log ("OnSychronizedStart");

            // Setting the Random seed must be done on Unity's main thread
            Loom.QueueOnMainThread (() => {
                UnityEngine.Random.seed = (int)m.GetId ();

                // Store the UXVCore.Match object so we can access it
                // in other places.
                GameManager.Instance.SetCurrentMatch (m);

                GameManager.Instance.SetGameStarted (true);

                // Notify GameManager that game has started. Check the player order
                // for the player to see if we are considered to be local or remote opponent,
                // The initial direction of the ball will be towards the local player.
                Me me = UXV.GetSession().GetMySelf();
                GameManager.Instance.StartGame((m.GetPlayerOrder(me) == 0 ? Player.LOCAL : Player.OPPONENT));
            });
        }