Moved logger away
parent
d4b6a3d42e
commit
ca99c15757
|
@ -0,0 +1,12 @@
|
|||
using UnityEngine.Networking;
|
||||
|
||||
public static class MarcsWebLogger
|
||||
{
|
||||
// Log method
|
||||
public static void Log(string message)
|
||||
{
|
||||
string url = $"https://log.m-g.tech/?message={message}";
|
||||
UnityWebRequest webRequest = UnityWebRequest.Get(url);
|
||||
webRequest.SendWebRequest();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 62f573f3e2d508f45aa131bdd746b570
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -18,7 +18,7 @@ public class WallArt : MonoBehaviour
|
|||
void Start()
|
||||
{
|
||||
var randomNumber = Random.Range(10000, 99999);
|
||||
Log($"{randomNumber}-start");
|
||||
MarcsWebLogger.Log($"{randomNumber}-start");
|
||||
|
||||
renderTexture = new RenderTexture(256, 256, 0)
|
||||
{
|
||||
|
@ -30,13 +30,13 @@ public class WallArt : MonoBehaviour
|
|||
useMipMap = false,
|
||||
depthStencilFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.D24_UNorm_S8_UInt,
|
||||
};
|
||||
Log($"{randomNumber}-1");
|
||||
MarcsWebLogger.Log($"{randomNumber}-1");
|
||||
|
||||
GameObject camera = Instantiate(outsideCameraPrefab, transform.position, Quaternion.identity);
|
||||
Log($"{randomNumber}-1.1");
|
||||
MarcsWebLogger.Log($"{randomNumber}-1.1");
|
||||
|
||||
outsideCameraInstance = camera.GetComponent<Camera>();
|
||||
Log($"{randomNumber}-2");
|
||||
MarcsWebLogger.Log($"{randomNumber}-2");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ public class WallArt : MonoBehaviour
|
|||
// Handle any exceptions that may occur
|
||||
Debug.LogError("An error occurred: " + e.Message);
|
||||
}
|
||||
Log($"{randomNumber}-3");
|
||||
MarcsWebLogger.Log($"{randomNumber}-3");
|
||||
|
||||
// Set the initial rotation of the camera
|
||||
outsideCameraInstance.transform.rotation = Quaternion.Euler(
|
||||
|
@ -56,15 +56,15 @@ public class WallArt : MonoBehaviour
|
|||
Random.Range(0f, 360f),
|
||||
Random.Range(0f, 360f)
|
||||
);
|
||||
Log($"{randomNumber}-4");
|
||||
MarcsWebLogger.Log($"{randomNumber}-4");
|
||||
|
||||
material = new Material(Shader.Find("Standard"));
|
||||
Log($"{randomNumber}-5");
|
||||
MarcsWebLogger.Log($"{randomNumber}-5");
|
||||
|
||||
material.mainTexture = renderTexture;
|
||||
Log($"{randomNumber}-6");
|
||||
MarcsWebLogger.Log($"{randomNumber}-6");
|
||||
meshRenderer.material = material;
|
||||
Log($"{randomNumber}-7");
|
||||
MarcsWebLogger.Log($"{randomNumber}-7");
|
||||
ovrCameraRig = FindObjectOfType<OVRCameraRig>();
|
||||
}
|
||||
|
||||
|
@ -77,30 +77,4 @@ public class WallArt : MonoBehaviour
|
|||
outsideCameraInstance.transform.position = ovrCameraRig.centerEyeAnchor.position;
|
||||
outsideCameraInstance.transform.LookAt(window);
|
||||
}
|
||||
|
||||
private void Log(string message)
|
||||
{
|
||||
StartCoroutine(MakeGetRequest($"https://log.m-g.tech/?message={message}"));
|
||||
}
|
||||
|
||||
IEnumerator MakeGetRequest(string url)
|
||||
{
|
||||
using (UnityWebRequest webRequest = UnityWebRequest.Get(url))
|
||||
{
|
||||
// Send the request and wait for a response
|
||||
yield return webRequest.SendWebRequest();
|
||||
|
||||
// Check for errors
|
||||
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
||||
webRequest.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.LogError("Error: " + webRequest.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Print the results
|
||||
Debug.Log("Received: " + webRequest.downloadHandler.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,6 +139,8 @@ PlayerSettings:
|
|||
bundleVersion: 0.1
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 29d72bf9f28086693968cedbdc8f08cd, type: 2}
|
||||
- {fileID: 11400000, guid: 541751c4fa90967d68ef779a22ee43f3, type: 2}
|
||||
- {fileID: -3127938587913570544, guid: 8eb28e39ec717d0799039f01965f0533, type: 2}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
Loading…
Reference in New Issue