コード例 #1
0
        void DrawFileView()
        {
            GUILayout.BeginArea(ContentSection);

            EditorGUILayout.LabelField("Tags");
            EditorGUILayout.LabelField("saperated by comma", new GUIStyle(GUI.skin.label)
            {
                fontSize = 10
            });
            FileTags = EditorGUILayout.TextField(FileTags);

            if (GUILayout.Button("Update", GUILayout.Height(50)))
            {
                LootLockerSDKAdminManager.UpdateFile(activeFile.id.ToString(), new LootLockerUpdateFileRequest()
                {
                    tags = FileTags.Split(',')
                }, (updateResponse) =>
                {
                    if (updateResponse.success)
                    {
                        ButtomMessage = "Update Succeeded";
                        Debug.Log("Successful update file: " + updateResponse.text);
                    }
                    else
                    {
                        Debug.LogError("failed to update file: " + updateResponse.Error);
                    }
                });
            }

            if (GUILayout.Button("Delete", GUILayout.Height(50)))
            {
                LootLockerSDKAdminManager.DeleteFile(activeFile.id.ToString(), (response) =>
                {
                    if (response.success)
                    {
                        ButtomMessage = "Delete Succeeded";
                        PopulateFiles();
                        Debug.Log("Successful deleted file: " + response.text);
                    }
                    else
                    {
                        Debug.LogError("failed to delete file: " + response.Error);
                    }
                });
            }

            if (GUILayout.Button("Back", GUILayout.Height(20)))
            {
                PopulateFiles();
            }

            GUILayout.EndArea();
        }