Exemplo n.º 1
0
        void Awake()
        {
            frame = FindObjectOfType<Frame>();
            if (!frame)
                throw new Exception("Couldn't find UPF Frame");

            currentState = StartMenuState.InitialMenu;
        }
    public override void Initialize() 
    {
        LoadingState loadingState = new LoadingState();
        StartMenuState startMenuState = new StartMenuState();

        AddState(loadingState);
        AddState(startMenuState);
    }
Exemplo n.º 3
0
        bool checkButtons()
        {
            if (createButton.Triggered)
            {
                cleanup();
                returnControl("create");
                return true;
            }
            else if (joinLanButton.Triggered)
            {
                NetPeerConfiguration config = new NetPeerConfiguration("rts");
                config.Port = 14243;

                client = new NetClient(config);
                client.Start();

                //client.Configuration.SimulatedMinimumLatency = .5f;
                //client.Configuration.SimulatedRandomLatency = .01f;

                client.DiscoverLocalPeers(14242);

                state = StartMenuState.Joining;
            }
            else if (joinIPButton.Triggered)
            {
                if (!File.Exists("C:\\rts hosts.txt"))
                    File.Create("C:\\rts hosts.txt");

                string[] hosts = File.ReadAllLines("C:\\rts hosts.txt");

                NetPeerConfiguration config = new NetPeerConfiguration("rts");
                config.Port = 14243;

                client = new NetClient(config);
                client.Start();

                //client.Configuration.SimulatedMinimumLatency = .5f;
                //client.Configuration.SimulatedRandomLatency = .01f;

                foreach (string host in hosts)
                    client.DiscoverKnownPeer(host, 14242);

                state = StartMenuState.Joining;
            }
            else if (exitButton.Triggered)
            {
                cleanup();
                returnControl("exit");
                return true;
            }

            return false;
        }
Exemplo n.º 4
0
        private void LoadExistingGame()
        {
            currentState = StartMenuState.ContinueMenu;

            SetupContinueMenu();
        }
Exemplo n.º 5
0
 void Update()
 {
     if (InputManager.Instance.KeyReleased("Cancel") && currentState == StartMenuState.ContinueMenu)
     {
         currentState = StartMenuState.InitialMenu;
         SetupInitialMenu();
     }
 }