Skip to content

Commit

Permalink
Merge pull request #3 from vprime/feature/environment
Browse files Browse the repository at this point in the history
Update settings for build release
  • Loading branch information
vprime authored Jun 19, 2024
2 parents 1da949a + 00552f3 commit 5d79984
Show file tree
Hide file tree
Showing 16 changed files with 1,163 additions and 115 deletions.
11 changes: 5 additions & 6 deletions Assets/Materials/AiSegment.mat
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Material:
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _METALLICSPECGLOSSMAP
- _RECEIVE_SHADOWS_OFF
m_InvalidKeywords: []
m_LightmapFlags: 1
Expand Down Expand Up @@ -56,7 +55,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 57cc3b032dbba94b8862c17e558986df, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
Expand Down Expand Up @@ -107,7 +106,7 @@ Material:
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 0
- _Smoothness: 0
- _Smoothness: 0.204
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
Expand All @@ -116,9 +115,9 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.6603774, g: 0, b: 0, a: 1}
- _Color: {r: 0.6603774, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 966.0377, g: 0, b: 0, a: 1}
- _BaseColor: {r: 0.5377358, g: 0.33588096, b: 0.30691525, a: 1}
- _Color: {r: 0.53773576, g: 0.33588094, b: 0.30691522, a: 1}
- _EmissionColor: {r: 2220.893, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &6365922644731627730
Expand Down
3 changes: 1 addition & 2 deletions Assets/Materials/HumanOSegment.mat
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Material:
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _METALLICSPECGLOSSMAP
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
Expand Down Expand Up @@ -55,7 +54,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 57cc3b032dbba94b8862c17e558986df, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
Expand Down
3 changes: 1 addition & 2 deletions Assets/Materials/HumanXSegment.mat
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Material:
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _METALLICSPECGLOSSMAP
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
Expand Down Expand Up @@ -55,7 +54,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 57cc3b032dbba94b8862c17e558986df, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
Expand Down
Binary file added Assets/Materials/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions Assets/Materials/icon.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions Assets/Scenes/Main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
raycastCamera: {fileID: 1488502027}
click: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
click: {fileID: 3001919216989983466, guid: 3fee424023bbdb78582bc11cfda5dffe, type: 3}
interactableLayers:
serializedVersion: 2
m_Bits: 64
Expand Down Expand Up @@ -402,27 +402,27 @@ MonoBehaviour:
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_ActionsAsset: {fileID: -944628639613478452, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_PointAction: {fileID: -1654692200621890270, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_MoveAction: {fileID: -8784545083839296357, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_SubmitAction: {fileID: 392368643174621059, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_CancelAction: {fileID: 7727032971491509709, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_LeftClickAction: {fileID: 3001919216989983466, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_MiddleClickAction: {fileID: -2185481485913320682, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_RightClickAction: {fileID: -4090225696740746782, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018,
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: 3fee424023bbdb78582bc11cfda5dffe,
type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
Expand Down
27 changes: 18 additions & 9 deletions Assets/Scripts/Environment/Systems/InteractionBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,45 @@ namespace Environment.Systems
public class InteractionBehavior : MonoBehaviour
{
[SerializeField] private Camera raycastCamera;
[SerializeField] private InputActionReference click;
[SerializeField] private LayerMask interactableLayers;


private void Start()
{
Debug.Log($"Interaction Behavior initialized");
if (!raycastCamera)
raycastCamera = Camera.main;
if (!raycastCamera)
throw new Exception("No raycast Camera assigned in the InteractionBehavior!");

if (!click)
throw new Exception("No InputActionRefrence assigned for InteractionBehavior!");

click.action.performed += HandlePress;
}

private void Update()
{
if (Pointer.current.press.wasReleasedThisFrame)
{
HandlePress();
}
}

private void HandlePress(InputAction.CallbackContext ctx)
void HandlePress()
{
var value = Vector2.zero;
if (Touchscreen.current is not null)
if (Pointer.current is not null)
{
value = Pointer.current.position.ReadValue();
}
else if (Touchscreen.current is not null)
{
value = Touchscreen.current.primaryTouch.position.ReadValue();
}
else if (Mouse.current is not null)
{
value = Mouse.current.position.ReadValue();
}

else
{
Debug.LogError("No pointer position source");
}
var ray = raycastCamera.ScreenPointToRay(value);
if (Physics.Raycast(ray, out var hit, float.PositiveInfinity, interactableLayers))
ProcessInteraction(hit);
Expand Down
Loading

0 comments on commit 5d79984

Please sign in to comment.