Skip to content

Commit

Permalink
add interaction points provider
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat committed Oct 18, 2024
1 parent 00cfae0 commit 099d1aa
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &95087872037303502
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6129818498246833444}
m_Layer: 0
m_Name: StartPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6129818498246833444
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 95087872037303502}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.238, y: 0.715, z: 0.218}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8033135651520204425}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &178617126351056782
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5465962008692022609}
m_Layer: 0
m_Name: StartPoint2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5465962008692022609
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 178617126351056782}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.256, y: 0.713, z: 0.22}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8033135651520204425}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1918783493706165866
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -17,6 +79,7 @@ GameObject:
- component: {fileID: -2157900375506616301}
- component: {fileID: 7239473696267242548}
- component: {fileID: 4189468537532167386}
- component: {fileID: 1380082131058378985}
m_Layer: 0
m_Name: PacManGenerator
m_TagString: Untagged
Expand All @@ -38,6 +101,8 @@ Transform:
m_Children:
- {fileID: 608453462504062702}
- {fileID: 758939287750849531}
- {fileID: 6129818498246833444}
- {fileID: 5465962008692022609}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -59,6 +124,7 @@ MonoBehaviour:
_networkBehaviours:
- {fileID: 219113547575591534}
- {fileID: -2157900375506616301}
- {fileID: 4189468537532167386}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Expand Down Expand Up @@ -172,10 +238,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b621d3404247f2e4da4ab459ad43eec7, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 255
_componentIndexCache: 2
_addedNetworkObject: {fileID: -5414623717715724467}
_networkObjectCache: {fileID: 0}
_networkObjectCache: {fileID: -5414623717715724467}
_on: 0
_toggle: {fileID: 0}
--- !u!114 &1380082131058378985
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9b1134be21b33843967f48258787c1b, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactionPoints:
- {fileID: 6129818498246833444}
- {fileID: 5465962008692022609}
--- !u!1 &4271595947011161493
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ GameObject:
- component: {fileID: -7870356800615129184}
- component: {fileID: 4840393447774820463}
- component: {fileID: 8399519541836331320}
- component: {fileID: 5915189518970650810}
m_Layer: 0
m_Name: SMES
m_TagString: Untagged
Expand All @@ -36,6 +37,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 608453462504062702}
- {fileID: 7499286863265064138}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -164,6 +166,21 @@ MonoBehaviour:
_addedNetworkObject: {fileID: -5414623717715724467}
_networkObjectCache: {fileID: -5414623717715724467}
_on: 0
_toggle: {fileID: 0}
--- !u!114 &5915189518970650810
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9b1134be21b33843967f48258787c1b, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactionPoints:
- {fileID: 7499286863265064138}
--- !u!1 &4379219507269237858
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -264,3 +281,34 @@ SkinnedMeshRenderer:
m_Center: {x: -0.000000014901161, y: 0.48807514, z: 0.025044113}
m_Extent: {x: 0.41364294, y: 0.48807514, z: 0.43868694}
m_DirtyAABB: 0
--- !u!1 &8679078277714624616
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7499286863265064138}
m_Layer: 0
m_Name: StartPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7499286863265064138
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8679078277714624616}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.061, y: 0.655, z: 0.454}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8033135651520204425}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using FishNet.Object.Synchronizing;
using SS3D.Core.Behaviours;
using SS3D.Interactions;
using SS3D.Interactions.Extensions;
using SS3D.Interactions.Interfaces;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -30,19 +31,7 @@ public IInteraction[] CreateTargetInteractions(InteractionEvent interactionEvent
return interactions.ToArray();
}

public bool TryGetInteractionPoint(IInteractionSource source, out Vector3 point)
{
point = Vector3.zero;

if (_toggle != null)
{
point = _toggle.position;

return true;
}

return false;
}
public bool TryGetInteractionPoint(IInteractionSource source, out Vector3 point) => this.GetInteractionPoint(source, out point);

public bool GetState()
{
Expand Down

0 comments on commit 099d1aa

Please sign in to comment.