Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(property_id);
        serializedObject.ApplyModifiedProperties();
        GUI.enabled = false;
        EditorGUILayout.PropertyField(property_type);
        GUI.enabled = true;
        base.OnInspectorGUI();

        GUILayout.Space(20);
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Save"))
        {
            GameUploader.UpdateGameData(
                target as NetworkedGames.GameInfoBase);
        }
        if (GUILayout.Button("Retrieve"))
        {
            GameUploader.GetGameData(property_id.intValue,
                                     RetrieveGameInfo);
        }
        if (GUILayout.Button("Delete From DB"))
        {
            GameUploader.DeleteGameData(property_id.intValue);
            serializedObject.Update();
            property_id.intValue = -1;
            serializedObject.ApplyModifiedProperties();
        }

        GUILayout.EndHorizontal();
    }
    private static void RemoveGames(string json)
    {
        IDPack games = JsonUtility.FromJson <IDPack>(json);

        foreach (var id in games.values)
        {
            GameUploader.DeleteGameData(id);
        }
    }