Skip to content

Commit

Permalink
Lock system applied to erobson
Browse files Browse the repository at this point in the history
  • Loading branch information
jafarigit committed Nov 2, 2023
1 parent cdb5121 commit 8fa77af
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 9, y: -0.5}
m_SizeDelta: {x: -28, y: -3}
m_AnchoredPosition: {x: 10.465, y: -0.5}
m_SizeDelta: {x: -25.07, y: -3}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1330738130616795814
CanvasRenderer:
Expand Down Expand Up @@ -219,7 +219,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Lock USB
m_text: Fixed Wire
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
Expand Down Expand Up @@ -328,7 +328,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0.584, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0.017, y: 0.568}
m_AnchoredPosition: {x: 0.017028809, y: 0.56799316}
m_SizeDelta: {x: 128.8, y: 23}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &2403877789791160219
Expand Down Expand Up @@ -374,7 +374,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 1
m_PresetInfoIsWorld: 0
--- !u!114 &9192925388231545650
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
10 changes: 5 additions & 5 deletions Assets/MirageXR/Player/Prefabs/eROBSON/Prefabs/o13_fan.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -4176,11 +4176,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 3241339898654901657}
m_Modifications:
- target: {fileID: 939130537186676778, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_text
value: Lock Fan
objectReference: {fileID: 0}
- target: {fileID: 3865881091572475488, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_Name
Expand Down Expand Up @@ -4306,6 +4301,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4913336682971170408, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_PresetInfoIsWorld
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0, type: 3}
--- !u!114 &3132171640284597043 stripped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3240,11 +3240,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 6709195737717188338}
m_Modifications:
- target: {fileID: 939130537186676778, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_text
value: Lock Motor
objectReference: {fileID: 0}
- target: {fileID: 3865881091572475488, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_Name
Expand Down Expand Up @@ -3355,6 +3350,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4913336682971170408, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_PresetInfoIsWorld
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0, type: 3}
--- !u!114 &510308537807044332 stripped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1588,11 +1588,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 6304546043178406363}
m_Modifications:
- target: {fileID: 939130537186676778, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_text
value: Lock Led
objectReference: {fileID: 0}
- target: {fileID: 2403877789791160219, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_AdditionalShaderChannelsFlag
Expand Down Expand Up @@ -1708,6 +1703,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4913336682971170408, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_PresetInfoIsWorld
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0, type: 3}
--- !u!114 &4489099278312180387 stripped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4913336682971170408, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0,
type: 3}
propertyPath: m_PresetInfoIsWorld
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 64e8ceae6ea4ea64abe9a78dbd2ed1d0, type: 3}
--- !u!114 &3935547537696449726 stripped
Expand Down
18 changes: 6 additions & 12 deletions Assets/MirageXR/Player/Prefabs/eROBSON/Scripts/FixedPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void OnLockToggled(bool locked)

private void OnMovingStart(ManipulationEventData data)
{
_moving = true;
_moving = _eROBSONItems && !_eROBSONItems.BitIsLocked;
}

private void OnMovingStop(ManipulationEventData data)
Expand All @@ -89,12 +89,6 @@ private void Update()
return;
}


if (_eROBSONItems.BitIsLocked)
{
return;
}

//if the main bit is moving do not store movable part position
if (!_eROBSONItems.IsMoving && !_moving)
{
Expand All @@ -104,18 +98,18 @@ private void Update()

private void LateUpdate()
{
if (_objectManipulator && !_objectManipulator.enabled)
if (_eROBSONItems && _eROBSONItems.BitIsLocked && !IsLock)
{
return;
lockToggle.isOn = true;
}

if (!_circuitDataLoaded || _moving)

if (_objectManipulator && !_objectManipulator.enabled)
{
return;
}


if (_eROBSONItems && _eROBSONItems.BitIsLocked)
if (!_circuitDataLoaded || _moving)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public string poiID

public BitID ID => id;

private BitsBehaviourController MyBehaviourController;


public bool BitIsLocked => _myObj is { positionLock: true };

Expand Down Expand Up @@ -109,7 +109,6 @@ private void Start()
_connectedBits = new List<eROBSONItems>();
indicatorLight = GetComponentInChildren<IndicatorLight>();
ports = GetComponentsInChildren<Port>();
MyBehaviourController = GetComponent<BitsBehaviourController>();
gameObject.GetComponentInParent<ObjectManipulator>().OnManipulationStarted.AddListener(OnMovingItem);
gameObject.GetComponentInParent<ObjectManipulator>().OnManipulationEnded.AddListener(OnItemStoppedMoving);

Expand Down Expand Up @@ -153,6 +152,10 @@ public void DisableManipulation()
/// </summary>
public void EnableManipulation()
{
if (BitIsLocked)
{
return;
}
var objectManipulator = GetComponentInParent<ObjectManipulator>();
objectManipulator.TwoHandedManipulationType = Microsoft.MixedReality.Toolkit.Utilities.TransformFlags.Move;
objectManipulator.enabled = true;
Expand Down
23 changes: 7 additions & 16 deletions ProjectSettings/PackageManagerSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreviewPackages: 0
m_EnablePreReleasePackages: 0
m_EnablePackageDependencies: 1
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
m_SeeAllPackageVersions: 0
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
Expand Down Expand Up @@ -46,21 +47,11 @@ MonoBehaviour:
- jillejr
m_IsDefault: 0
m_Capabilities: 0
m_UserSelectedRegistryName: com.i5.toolkit.core
m_UserSelectedRegistryName: Packages from jillejr
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_ErrorMessage:
m_Original:
m_Id: scoped:com.i5.toolkit.core
m_Name: com.i5.toolkit.core
m_Url: https://package.openupm.com
m_Scopes:
- com.i5.toolkit.core
m_IsDefault: 0
m_Capabilities: 0
m_Modified: 0
m_Name: com.i5.toolkit.core
m_Url: https://package.openupm.com
m_Scopes:
- com.i5.toolkit.core
m_SelectedScopeIndex: 0
m_ErrorMessage:
m_UserModificationsInstanceId: -832
m_OriginalInstanceId: -834
m_LoadAssets: 0

0 comments on commit 8fa77af

Please sign in to comment.