Exemplo n.º 1
0
    /// <summary>
    /// 加载用户数据
    /// </summary>
    public void GetUserDataFromJson()
    {
        var data = JsonWrite.GetUserDataFromJson();

        Debug.Log(data);
        Debug.Log("加载用户数据成功");
    }
Exemplo n.º 2
0
    /// <summary>
    /// 加载配置文件
    /// </summary>
    public void LoadConfigurationFile()
    {
        var data = JsonWrite.LoadConfigurationFile(InputFieldName.text);

        Debug.Log(data);
        Debug.Log("加载配置文件成功");
    }
Exemplo n.º 3
0
        /// <summary>
        /// Sends a free-form, unsafe packet in JSON format.
        /// </summary>
        /// <param name="json">JSON packet string to be sent.</param>
        /// <remarks>Make sure the packet is WELL formed. Otherwise client will certainly get disconnected.</remarks>
        public void SendJson(string json)
        {
            if (IsReady && IsOpen)
            {
                WebSocket.Send(json);
            }

            var eventArgs = new JsonEventArgs(json);

            JsonWrite?.Invoke(this, eventArgs);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sends a predefined, tested and safe packet.
        /// </summary>
        /// <param name="packet">Packet to be sent.</param>
        public void SendPacket(Packet packet)
        {
            if (IsReady && IsOpen)
            {
                WebSocket.Send(packet);
            }

            var eventArgs = new JsonEventArgs(packet);

            JsonWrite?.Invoke(this, eventArgs);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 删除用户数据
 /// </summary>
 public void DeleteLocalUserData()
 {
     JsonWrite.DeleteLocalUserData();
     Debug.Log("删除用户数据成功");
 }
Exemplo n.º 6
0
 /// <summary>
 /// 保存用户数据
 /// </summary>
 public void SaveUserData()
 {
     JsonWrite.SaveUserData(InputFieldData.text);
     Debug.Log("保存用户数据成功");
 }
Exemplo n.º 7
0
 /// <summary>
 /// 生成配置文件
 /// </summary>
 public void CreatConfigurationFile()
 {
     JsonWrite.CreatConfigurationFile(InputFieldName.text, InputFieldData.text);
     Debug.Log("生成配置文件成功");
 }
 private void SaveFileHandler()
 {
     JsonWrite.ExportPattern(Shape.Points.ToList(), Shape.ToString(), RepeatValue, SpotDistributionTypes);
 }
 private void SaveFileHandler()
 {
     JsonWrite.ExportPattern(Shape.Points.ToList(), Shape.ToString(), RepeatValue, RandomizePattern);
 }