Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
btschneid committed May 22, 2024
2 parents 5798dcb + 9eb6954 commit 0a06468
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 98 deletions.
7 changes: 0 additions & 7 deletions Assets/CLAWS/2-Geosampling/GeosamplingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,13 @@ public static void EndGeosamplingMode()

public void SwitchCameraCull(int num)
{
int mainCullingMask = mainMapCamera.cullingMask;
int miniCullingMask = miniMapCamera.cullingMask;
// 23: Station, 24: Nav, 25: Geo, 26: Comp
if (num == -1)
{
for (int i = 23; i < 27; i++)
{
mainCullingMask |= (1 << i);
miniCullingMask |= (1 << i);
mainMapCamera.cullingMask = mainCullingMask;
miniMapCamera.cullingMask = miniCullingMask;
}
}
Expand All @@ -133,16 +130,12 @@ public void SwitchCameraCull(int num)
{
if (num == i)
{
mainCullingMask |= (1 << i);
miniCullingMask |= (1 << i);
mainMapCamera.cullingMask = mainCullingMask;
miniMapCamera.cullingMask = miniCullingMask;
}
else
{
mainCullingMask &= ~(1 << i);
miniCullingMask &= ~(1 << i);
mainMapCamera.cullingMask = mainCullingMask;
miniMapCamera.cullingMask = miniCullingMask;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,6 @@ Transform:
- {fileID: 4484987304500899829}
- {fileID: 7743847238713187522}
- {fileID: 3115075087382618437}
- {fileID: 5826758929379739136}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1567260017021656407
Expand Down Expand Up @@ -1475,7 +1474,7 @@ MonoBehaviour:
ColorScreen: {fileID: 4646266488529956752}
ShapeScreen: {fileID: 1876235420285575114}
VoiceNotesScreen: {fileID: 682435210399780100}
StarredIcon: {fileID: 7523123053784822035, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
StarredIcon: {fileID: 4087527398570109315}
GeoSampleIDLabel: {fileID: 0}
TakeXRF: {fileID: 8260094875698192377}
WaitingXRF: {fileID: 8488801473396843169}
Expand Down Expand Up @@ -7692,11 +7691,20 @@ PrefabInstance:
propertyPath: m_Name
value: Star
objectReference: {fileID: 0}
- target: {fileID: 7523123053784822035, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
--- !u!1 &4087527398570109315 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7523123053784822035, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
m_PrefabInstance: {fileID: 5827182988103243920}
m_PrefabAsset: {fileID: 0}
--- !u!4 &7743847238713187522 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
Expand Down Expand Up @@ -8562,68 +8570,6 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 2392647766582955634, guid: a8f517f7be1d69f4ead74499adf2fdff, type: 3}
m_PrefabInstance: {fileID: 7682152821748685920}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7743150499900654162
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 5325368646117534039}
m_Modifications:
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalPosition.x
value: 0.0249
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalPosition.y
value: 0.1023
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7523123053784822035, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
propertyPath: m_Name
value: Star
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
--- !u!4 &5826758929379739136 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4299244418737914962, guid: 727c9f5d9c55b4968bba1ee6dd0522a0, type: 3}
m_PrefabInstance: {fileID: 7743150499900654162}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7867761930801839617
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
58 changes: 35 additions & 23 deletions Assets/CLAWS/2-Geosampling/Screenshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.IO;
using System.Linq;
using System;

using Unity.VisualScripting;


#if !UNITY_WEBGL
using UnityEngine.Windows.WebCam;

Expand Down Expand Up @@ -37,28 +39,38 @@ public void TakePhoto()
Renderer r = confirmationQuad.GetComponent<Renderer>();
r.material = defaultConfirmMaterial;

// create photocapture object
PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject)
{
photoCaptureObject = captureObject;
CameraParameters cameraParameters = new CameraParameters
{
hologramOpacity = 0.0f,
cameraResolutionWidth = cameraResolution.width,
cameraResolutionHeight = cameraResolution.height,
pixelFormat = CapturePixelFormat.BGRA32
};

// activate camera
photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate (PhotoCapture.PhotoCaptureResult result)
{
// Take a picture
photoCaptureObject.TakePhotoAsync(PhotoToMemory);

// Play the 'picture clicked' sound effect
EventBus.Publish<PlayAudio>(new PlayAudio("Take_Picture"));
});
});
GameObject.Find("UIA").GetComponent<imageCapture>().StopCamera();

IEnumerator ASDHASUDHUSA()
{
yield return new WaitForSeconds(0.5f);

// create photocapture object
PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject)
{
photoCaptureObject = captureObject;
CameraParameters cameraParameters = new CameraParameters
{
hologramOpacity = 0.0f,
cameraResolutionWidth = cameraResolution.width,
cameraResolutionHeight = cameraResolution.height,
pixelFormat = CapturePixelFormat.BGRA32
};

// activate camera
photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate (PhotoCapture.PhotoCaptureResult result)
{
// Take a picture
photoCaptureObject.TakePhotoAsync(PhotoToMemory);

// Play the 'picture clicked' sound effect
EventBus.Publish<PlayAudio>(new PlayAudio("Take_Picture"));
});
});

GameObject.Find("UIA").GetComponent<imageCapture>().StartPhotoCapture();
}

}

void PhotoToMemory(PhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame)
Expand Down
11 changes: 8 additions & 3 deletions Assets/SingleGeosampleScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void Load(Geosample Sample_f)
SetSampleName("Sample " + Sample.geosample_id);
SetDescription(Sample.description);
SetStar();
StarredIcon.SetActive(Sample_f.starred);
SetZoneId();
SetColor(Sample_f.color);
SetShape(Sample_f.shape);
Expand Down Expand Up @@ -202,8 +203,9 @@ public void waitingForXRF(XRFScanEvent e)
EventBus.Publish<PlayAudio>(new PlayAudio("XRF_Scan"));
WaitingXRF.SetActive(false);
XRFReadings.SetActive(true);



Sample.eva_data.data = e.data;
GeosamplingManager.SendData();
}

public void OnShapeButtonPressed()
Expand Down Expand Up @@ -367,7 +369,10 @@ public void SetZone(string letter)
var zone = GeosamplingZone.FindZone(letter[0]);
if (zone != null)
{
zone.ZoneGeosamplesIds.Add(Sample.geosample_id);
if (!zone.ZoneGeosamplesIds.Contains(Sample.geosample_id))
{
zone.ZoneGeosamplesIds.Add(Sample.geosample_id);
}
}

SetZoneId();
Expand Down
10 changes: 9 additions & 1 deletion Assets/imageCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public void Start()
{
Debug.Log("Started camera");
}

queued_actions.Clear();
}

void Update()
Expand Down Expand Up @@ -311,6 +313,12 @@ public void SnapPhoto(string type)
}
}

public void PatrickSnapPhoto()
{

}


[ContextMenu("func snapphoto uia")]
public void UIATest()
{
Expand All @@ -323,7 +331,7 @@ public void GeosampleTest()
SnapPhoto("geosample");
}

void StartPhotoCapture()
public void StartPhotoCapture()
{
PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
}
Expand Down

0 comments on commit 0a06468

Please sign in to comment.