Exemple #1
0
    public void ModifyMap(SocketIOEvent e)
    {
        Debug.Log("[SocketIO]  received: " + e.name + " " + e.data);
        Dictionary <string, string> data = e.data.ToDictionary();
        Vector3 n_position = new Vector3(float.Parse(data["p_x"]), float.Parse(data["p_y"]), float.Parse(data["p_z"]));

        switch (data["type"])
        {
        case "BlockMap":
            modify.ReplaceBlock(n_position);
            break;

        default:
            if (data["type"].StartsWith("BlockSpecial_"))
            {
                int type = int.Parse(data["type"].Substring(data["type"].Length - 1, 1));               //future bug :D
                modify.ReplaceBlock(n_position, type);
            }
            break;
        }
    }