Skip to content
Snippets Groups Projects
Commit 982e7552 authored by dbuderus's avatar dbuderus
Browse files

wtf?

parent 4b3517b2
No related branches found
No related tags found
No related merge requests found
......@@ -419,6 +419,11 @@ public static class TaskParser
gameObject.SetActive(false);
gameObjects[i] = gameObject;
foreach (var renderer in gameObject.transform.GetComponentsInChildren<MeshRenderer>())
{
renderer.material = new Material(Shader.Find("Diffuse"));
}
if (texturePath != null && texturePath.Length != 0)
{
Debug.Log(texturePath);
......
......@@ -81,6 +81,7 @@ public class BluetoothAdapter : NetworkAdapter
{
DebugLog(e.Message);
}
NetworkHandler.Instance.UnegisterLogin(this);
return false;
}
#else
......
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
public class NetworkHandler : MonoBehaviour
{
public static NetworkHandler Instance { get; private set; }
public static NetworkAdapter NetworkAdapter { get => Instance.Adapters.Peek(); }
public static NetworkAdapter NetworkAdapter { get => Instance.GetAdapter(); }
private Queue<NetworkAdapter> Adapters { get; set; }
private Queue<NetworkAdapter> LoginQueue { get; set; }
void Start()
{
Instance = this;
Adapters = new Queue<NetworkAdapter>();
LoginQueue = new Queue<NetworkAdapter>();
}
//Every 0.02 seconds
......@@ -23,8 +26,35 @@ public class NetworkHandler : MonoBehaviour
}
}
private NetworkAdapter GetAdapter()
{
while(LoginQueue.Count > 0)
{
Thread.Sleep(10);
}
return Adapters.Peek();
}
public void RegisterLogin(NetworkAdapter adapter)
{
LoginQueue.Enqueue(adapter);
adapter.Connect();
}
public void UnegisterLogin(NetworkAdapter adapter)
{
while(LoginQueue.Peek() != adapter)
{
Thread.Sleep(10);
}
LoginQueue.Dequeue();
}
public void RegisterAdapter(NetworkAdapter adapter)
{
UnegisterLogin(adapter);
Adapters.Enqueue(adapter);
}
......
......@@ -4,6 +4,7 @@ using UnityEngine;
using UnityEngine.UI;
using System.IO;
using System;
using System.Threading;
public class FullTask : Task
{
......@@ -19,6 +20,11 @@ public class FullTask : Task
private DataSet TaskDataSet;
private readonly NetworkAdapter NetworkAdapter;
private readonly System.Threading.Tasks.TaskFactory TaskFactory = new System.Threading.Tasks.TaskFactory(CancellationToken.None,
System.Threading.Tasks.TaskCreationOptions.None,
System.Threading.Tasks.TaskContinuationOptions.None,
System.Threading.Tasks.TaskScheduler.Default);
public FullTask(int id, string name, string dataSetPath, string dataSetName, NetworkAdapter adapter) : base(name)
{
this.Tasks = new List<Task>();
......@@ -56,7 +62,7 @@ public class FullTask : Task
if(NetworkAdapter != null && !NetworkAdapter.Connected)
{
NetworkAdapter.Connect();
NetworkHandler.Instance.RegisterLogin(NetworkAdapter);
}
if (this.Tasks[Current].IsFinished())
......
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_IndirectSpecularColor: {r: 0.37311912, g: 0.3807398, b: 0.3587271, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -760,8 +760,6 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
......
File added
fileFormatVersion: 2
guid: 32fd8307ddbb8484e95d3471f61200d1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="UTF-8"?>
<QCARConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="qcar_config.xsd">
<Tracking>
<ImageTarget name="task_2_2" size="0.100000 0.100000" />
<ImageTarget name="task_2_1" size="0.100000 0.100000" />
</Tracking>
</QCARConfig>
fileFormatVersion: 2
guid: 6cf95ff900bb206498a2ae11b06cb140
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -39,7 +39,6 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment