Ejemplo n.º 1
0
    // Spawn the start room:
    void SpawnStartRoom(Floor floor)
    {
        startRoom = Instantiate(roomStartPrefab) as RoomStart;
        startRoom.transform.parent = floor.transform;

        // Add the available doors in the room to the floor's master list of doors:
        AddDoorsToList(startRoom, ref floor.doorways);

        startRoom.transform.position = Vector3.zero;
        startRoom.transform.rotation = Quaternion.identity;

        startRoom.GetComponentInChildren <MeshCombiner>().AdvancedMerge();
        startRoom.GetComponent <RoomStart>().meshCol = startRoom.transform.GetChild(0).GetComponent <MeshCollider>();

        floor.rooms.Add(startRoom);
        startRoom.floorNumber = floor.floorNumber;
    }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //

            AddPlayer    player     = new AddPlayer("rooooooms", null, "playerNaameab"); // port do komunikacji zwraca w resultMessage() jako string;
            RoomCreation room       = new RoomCreation("playeeerr", "rooooooms", 3);
            RoomStart    start      = new RoomStart("roomnaaamex", "token", "abs");
            PlayerMove   playerMove = new PlayerMove();

            //udpClient.SendRequest<RoomStart>(start, 38621);

            //########## PIERW TO
            //RoomManager rm = new RoomManager(38621);
            //rm.addRoom("abs", "roomnaaame", 3);

            //########## POTEM TO Z NAZWA POKOJU CO ADDROOM
            //PlayerManager pm = new PlayerManager(38621);
            //pm.addPlayer("roomnaaame", null, "playernameA");


            //####### POTEM TO I WSZYSTKO DZIAŁA
            UdpManager udpClient = new UdpManager();
            RoomStart  start1    = new RoomStart("roomnaaamex", "token", "abs");

            Console.WriteLine(udpClient.SendRequest <RoomStart>(start1, 38621).isRequestSuccess());

            //to jest odpowiedzialne za poruszanie graczem
            //wysylasz swoj ruch i konczysz polaczenie
            //udpClient.SendRequestPlayerMove(playerMove, 58278);
            //laczysz sie z serwerem i sluchasz wiadomosci
            while (true)
            {
                //udpClient.waitForMessages(58278);
                //jak jakas przyjdzie mozesz dac break i znow SendRequestPlayerMove z twoim ruchem
            }
            Console.Read();
        }
Ejemplo n.º 3
0
    void Update()
    {
        timer += Time.deltaTime;

        if (Input.GetKeyDown(KeyCode.Z))
        {
            roomStart = RoomStart.CHAT;
        }
        else if (Input.GetKeyDown(KeyCode.X))
        {
            roomStart = RoomStart.LEVEL;
        }
        else if (Input.GetKeyDown(KeyCode.C))
        {
            roomStart = RoomStart.JOURNAL;
        }

        switch (roomStart)
        {
        case RoomStart.ROOM:
            RoomNext();
            break;

        case RoomStart.CHAT:
            ChatNext();
            break;

        case RoomStart.JOURNAL:
            JournalNext();
            break;

        case RoomStart.LEVEL:
            LevelNext();
            break;
        }

        RaycastHit hit;
        Ray        ray = cameraMain.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out hit))
        {
            if (Input.GetMouseButtonDown(0))
            {
                if (hit.collider.gameObject.tag == ("Forum"))
                {
                    ForumPause();
                }
                else if (hit.collider.gameObject.tag == ("Journal"))
                {
                    JournalPause();
                }
                else if (hit.collider.gameObject.tag == ("Hacking"))
                {
                    HackingPause();
                }
                else if (hit.collider.gameObject.name == ("slideDoor"))
                {
                    ExitPause();
                }
                else if (hit.collider.gameObject.tag == ("Options"))
                {
                    OptionsPause();
                }
            }
        }
    }
Ejemplo n.º 4
0
        public bool roomStart(String roomName, String token, String adminNickname)
        {
            RoomStart start = new RoomStart(roomName, token, adminNickname);

            return(udp.SendRequest <RoomStart>(start, serverPort).isRequestSuccess());
        }