Skip to content
Snippets Groups Projects
Commit ae6acd9e authored by Juliane Scherlitzki's avatar Juliane Scherlitzki
Browse files

Conflict files cleaned up (Removed old merge conflicts in *.meta files,

Removed duplicate folder "webCommunication")
parent 77a3814f
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 308 deletions
fileFormatVersion: 2
<<<<<<<< HEAD:Assets/AddressableAssetsData/AssetGroupTemplates.meta
guid: 39fee18f570f3ee45b78c3197b844e19
========
guid: 648abcef6bda3ab44af8086f32d3cd1f
>>>>>>>> rwth-development:Assets/AddressableAssetsData.meta
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
<<<<<<<< HEAD:Assets/AddressableAssetsData/AssetGroups.meta
guid: 91bc657e689b20c4f9c6ad77f4e08891
========
guid: 5a1d45b39fdec3e489752d69e9555e4d
>>>>>>>> rwth-development:Assets/AddressableAssetsData/AssetGroups/Schemas.meta
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
<<<<<<<< HEAD:Assets/AddressableAssetsData/AssetGroups/Schemas.meta
guid: 5a1d45b39fdec3e489752d69e9555e4d
========
guid: 91bc657e689b20c4f9c6ad77f4e08891
>>>>>>>> rwth-development:Assets/AddressableAssetsData/AssetGroups.meta
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
<<<<<<< HEAD
guid: 73c78d7ef5ca1ee4aa349915abef0dff
=======
guid: bd59798902258df42abe022e4e72477a
>>>>>>> master
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
......
fileFormatVersion: 2
<<<<<<< HEAD
guid: addd4e632dbd52a42b56235d4c170508
=======
guid: 327729f63cac2b54a9ec8df221385230
>>>>>>> master
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
<<<<<<< HEAD
guid: e9cd3d4cc96e7214bab79973c01ec29e
=======
guid: bbef4b7122f3241478e40ce01361cb26
>>>>>>> master
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
<<<<<<< HEAD
guid: 8fd910c7cfcac3e48b02b01eb6896799
=======
guid: 668d24511b5c29845afa5f9839b7aefa
>>>>>>> master
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
......
fileFormatVersion: 2
guid: 91090d6cd37d5304db34f4e0a94f2c54
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
#if UNITY_EDITOR
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace TeachR.WebCommunication {
public class CoachInfo : EditorWindow
{
private struct MsgJson
{
public string Type;
public string Json;
}
// TODO: Allow setting this when not in play mode
private static readonly string[] IgnoreList =
{
"syncTeacher"
};
private static bool _persistentFoldout, _transientFoldout, _incomingFoldout, _outgoingFoldout;
private static readonly Dictionary<string, int> Calls = new();
private static readonly LimitQueue<MsgJson> Incoming = new(10);
private static readonly LimitQueue<MsgJson> Outgoing = new(10);
[MenuItem("Window/TeachR/Coach RTC Info")]
public static void ShowWindow()
{
ListenToMessages(IgnoreList);
GetWindow(typeof(CoachInfo));
}
private static void ListenToMessages(string[] ignoreMessages)
{
SocketServer.OnIncomingMessage += (type, content) =>
{
Calls[type] = Calls.TryGetValue(type, out int numCalls) ? numCalls + 1 : 1;
if (ignoreMessages.Contains(type)) return;
Incoming.Enqueue(new MsgJson { Type = type, Json = content });
};
SocketServer.OnOutgoingMessage += (type, content) =>
{
if (ignoreMessages.Contains(type)) return;
Outgoing.Enqueue(new MsgJson { Type = type, Json = JsonConvert.SerializeObject(content) });
};
}
private void OnGUI()
{
if (!Application.isPlaying) return;
_persistentFoldout = DrawEventFoldout("Persistent Events", CoachRtc.Persistent, _persistentFoldout);
EditorGUILayout.Space();
_transientFoldout = DrawEventFoldout("Transient Events", CoachRtc.Transient, _transientFoldout);
EditorGUILayout.Space();
_incomingFoldout = DrawMessageQueue("Incoming Messages", Incoming, _incomingFoldout);
EditorGUILayout.Space();
_outgoingFoldout = DrawMessageQueue("Outgoing Messages", Outgoing, _outgoingFoldout);
EditorGUILayout.Space();
}
private static bool DrawEventFoldout(string label, RtcEvents events, bool state)
{
state = EditorGUILayout.BeginFoldoutHeaderGroup(state, $"{label} ({events.Registered.Count()} events)");
if (state)
{
foreach (string p in events.Registered)
{
// TODO: Use grid layout?
int numCalls = Calls.TryGetValue(p, out int num) ? num : 0;
EditorGUILayout.BeginHorizontal();
GUILayout.Label(p);
GUILayout.Label($"{events.Count(p)} listeners");
GUILayout.Label($"{numCalls} calls");
EditorGUILayout.EndHorizontal();
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return state;
}
private static bool DrawMessageQueue(string label, LimitQueue<MsgJson> queue, bool state)
{
state = EditorGUILayout.BeginFoldoutHeaderGroup(state, $"{label}");
if (state)
{
foreach (MsgJson msg in queue.ToArray())
{
EditorGUILayout.BeginHorizontal();
GUILayout.Label(msg.Type);
if (GUILayout.Button("Copy Content"))
{
object json = JsonConvert.DeserializeObject(msg.Json);
string text = JsonConvert.SerializeObject(json, Formatting.Indented);
TextPopup.Init(text);
GUIUtility.systemCopyBuffer = text;
}
EditorGUILayout.EndHorizontal();
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return state;
}
}
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 181ba8533ad6bfc4ab37ec4535c75dc8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
namespace TeachR.WebCommunication
{
public class LimitQueue<T>
{
private readonly Queue<T> _queue = new();
private readonly int _limit;
public LimitQueue(int limit)
{
_limit = limit;
}
public void Enqueue(T item)
{
if (_queue.Count >= _limit) _queue.Dequeue();
_queue.Enqueue(item);
}
public T[] ToArray() => _queue.ToArray();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: a6e6968ef982d4d47a0717b5b3527a12
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class TextPopup : EditorWindow
{
private string _text;
[SerializeField] private VisualTreeAsset uiAsset;
public static void Init(string content)
{
TextPopup window = CreateInstance<TextPopup>();
window._text = content;
window.Show();
}
private void CreateGUI()
{
uiAsset.CloneTree(rootVisualElement);
Button button = rootVisualElement.Q<Button>();
button.clicked += () => GUIUtility.systemCopyBuffer = _text;
Label label = rootVisualElement.Q<Label>();
label.text = _text;
}
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: c9e72c6a03e064f4cbcaf41abeae8518
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- m_ViewDataDictionary: {instanceID: 0}
- uiAsset: {fileID: 9197481963319205126, guid: 7e71e9ad6a99fa54e910328d83199f2a,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b0f9c95a57db21840a4d213deba52933
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d90ac941cb4488943aa3be3d7cd59c49
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
[Serializable]
public class QuestionJson
{
public string[] students;
public int[] questions;
}
fileFormatVersion: 2
guid: a7a6800fd7dcf324e86759287dfea916
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
public class Behave
{
public string id;
public string behaviour;
public Behave(string id, string behaviour)
{
this.id = id; this.behaviour = behaviour;
}
}
fileFormatVersion: 2
guid: e8fd039bd978f9c408c6d318e00df5c6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment