コード例 #1
0
ファイル: MessageHandler.cs プロジェクト: ohy99/SP4
    public void SendNumberToSpawn_C2S(int _roomId, int _spawnNumber, string _roomType)
    {
        NumberToSpawnMessage msg = new NumberToSpawnMessage();

        msg.roomId      = _roomId;
        msg.spawnNumber = _spawnNumber;
        msg.roomType    = _roomType;

        Debug.Log("SendNumberToSpawnDoor_C2S");

        myClient.Send(MyMsgType.NumberToSpawnMsgType_client, msg);
    }
コード例 #2
0
ファイル: MessageHandler.cs プロジェクト: ohy99/SP4
    public void SendNumberToSpawn_S2C(int _roomId, int _spawnNumber, string _roomType)
    {
        NumberToSpawnMessage msg = new NumberToSpawnMessage();

        msg.roomId      = _roomId;
        msg.spawnNumber = _spawnNumber;
        msg.roomType    = _roomType;

        Debug.Log("SendNumberToSpawn_S2C");

        if (NetworkServer.active)
        {
            NetworkServer.SendToAll(MyMsgType.NumberToSpawnMsgType_server, msg);
        }
    }
コード例 #3
0
ファイル: MessageHandler.cs プロジェクト: ohy99/SP4
    public void OnRecvNumberToSpawn_Client(NetworkMessage netMsg)
    {
        if (Global.Instance.player.GetComponent <NetworkIdentity>().isServer)
        {
            return;
        }

        NumberToSpawnMessage msg = netMsg.ReadMessage <NumberToSpawnMessage>();

        Debug.Log("ClientRecv_NumberToSpawn : room_" + msg.roomId);

        if (msg.roomType == "enemyRoom")
        {
            Debug.Log("RoomId: " + msg.roomId + " totalWave: " + msg.spawnNumber);
            if (Global.Instance.roomGen.GetRoomList()[msg.roomId] == null)
            {
                Debug.Log("Room not started yet");
            }

            Global.Instance.roomGen.GetRoomList()[msg.roomId].
            GetComponent <EnemyRoomScript>().GetSpawner().
            GetComponent <EnemySpawner>().SetTotalWave(msg.spawnNumber);

            //RoomGenerator.Instance.GetRoomList()[msg.roomId].GetComponent<EnemyRoomScript>().totalNumWave = msg.spawnNumber;
        }
        else if (msg.roomType == "speedRoom")
        {
            Global.Instance.roomGen.
            GetRoomList()[msg.roomId].
            GetComponent <SpeedRoomScript>().
            SetSpawnerScript();

            Global.Instance.roomGen.
            GetRoomList()[msg.roomId].
            GetComponent <SpeedRoomScript>().
            GetSpawnerScript().maxSpawns = msg.spawnNumber;
        }
    }
コード例 #4
0
ファイル: MessageHandler.cs プロジェクト: ohy99/SP4
    //recv spawn num
    public void OnRecvNumberToSpawn_Server(NetworkMessage netMsg)
    {
        NumberToSpawnMessage msg = netMsg.ReadMessage <NumberToSpawnMessage>();

        Debug.Log("Host/ServerRecv_NumberToSpawn : room_" + msg.roomId);
    }