Skip to content

Commit

Permalink
Merge branch 'develop' into Animations
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat committed Nov 3, 2024
2 parents ce01097 + 62c9a9e commit 65b452c
Show file tree
Hide file tree
Showing 16 changed files with 224 additions and 106 deletions.
6 changes: 1 addition & 5 deletions Assets/Content/Addressables/AssetGroups/Scenes.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ MonoBehaviour:
m_Data:
m_SerializedData: []
m_GUID: e18ea8489b90bd7488de5c242bac11c6
m_SerializeEntries:
- m_GUID: d03a300180bde5646b09bfa4c392679f
m_Address: Assets/Content/Scenes/Launcher.unity
m_ReadOnly: 0
m_SerializedLabels: []
m_SerializeEntries: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
29 changes: 0 additions & 29 deletions Assets/Content/Data/Databases/Scenes.asset

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Content/Data/Databases/Scenes.asset.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ GameObject:
- component: {fileID: 3298710121668139635}
- component: {fileID: 3258417366846669140}
- component: {fileID: 7727612398117917681}
- component: {fileID: -4835600395219085227}
- component: {fileID: 6047447789156998695}
- component: {fileID: 2063239018469568408}
m_Layer: 0
m_Name: Locker
m_TagString: Untagged
Expand Down Expand Up @@ -281,6 +284,7 @@ MonoBehaviour:
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours:
- {fileID: 3298710121668139635}
- {fileID: 2063239018469568408}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Expand All @@ -292,7 +296,7 @@ MonoBehaviour:
_initializeOrder: 0
_defaultDespawnType: 0
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 168
<PrefabId>k__BackingField: 200
<SpawnableCollectionId>k__BackingField: 0
_scenePathHash: 0
<SceneId>k__BackingField: 0
Expand Down Expand Up @@ -335,3 +339,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
key: {fileID: 11400000, guid: ee4264e6206f48b40bd5a390dc1ffe2e, type: 2}
--- !u!114 &2063239018469568408
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5533951594911835035}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 135ecf6db6e77e945ac1a661c0831cd5, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 1
_addedNetworkObject: {fileID: 3258417366846669140}
_networkObjectCache: {fileID: 3258417366846669140}
IsLocked: 0
IsOpen: 0
_lockable: 0
permissionToUnlock: {fileID: 0}
_door: {fileID: 4547560682629165049}
_doorChangePunch: {x: -0.1, y: -0.05, z: 0}
LockLight: {fileID: 0}
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,12 @@ MonoBehaviour:
_componentIndexCache: 0
_addedNetworkObject: {fileID: 3258417366846669140}
_networkObjectCache: {fileID: 3258417366846669140}
Locked: 0
IsLocked: 0
IsOpen: 0
_lockable: 1
permissionToUnlock: {fileID: 11400000, guid: 921240e0c27686d4eaf2ff761944c5eb, type: 2}
_door: {fileID: 4547560682629165049}
_doorChangePunch: {x: -0.1, y: -0.05, z: 0}
LockLight: {fileID: 4199049305641312543}
--- !u!114 &3298710121668139635
MonoBehaviour:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ GameObject:
- component: {fileID: 3298710121668139635}
- component: {fileID: 3258417366846669140}
- component: {fileID: 7727612398117917681}
- component: {fileID: -802098285113866164}
- component: {fileID: 5133152519004721145}
m_Layer: 0
m_Name: SecurityLocker
m_TagString: Untagged
Expand Down Expand Up @@ -236,8 +238,12 @@ MonoBehaviour:
_componentIndexCache: 0
_addedNetworkObject: {fileID: 3258417366846669140}
_networkObjectCache: {fileID: 3258417366846669140}
Locked: 0
IsLocked: 0
IsOpen: 0
_lockable: 1
permissionToUnlock: {fileID: 11400000, guid: 6f6e80ff9f87f7e4d810b2e9dcb013df, type: 2}
_door: {fileID: 4547560682629165049}
_doorChangePunch: {x: -0.1, y: -0.05, z: 0}
LockLight: {fileID: 4459199731998976186}
--- !u!114 &3298710121668139635
MonoBehaviour:
Expand Down
9 changes: 4 additions & 5 deletions Assets/Scripts/SS3D/Data/Generated/Scenes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
;
namespace SS3D.Data.Generated
{
// This class is autogenerated. Do not modify manually.
public static class Scenes
{
public static DatabaseAsset Boot = new DatabaseAsset("Boot", "Scenes");
public static DatabaseAsset Game = new DatabaseAsset("Game", "Scenes");
public static DatabaseAsset Launcher = new DatabaseAsset("Launcher", "Scenes");
public static DatabaseAsset Intro = new DatabaseAsset("Intro", "Scenes");
public const string Boot = "Boot";
public const string Intro = "Intro";
public const string Game = "Game";
public const string Launcher = "Launcher";
}
}

1 change: 1 addition & 0 deletions Assets/Scripts/SS3D/Interactions/Interaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace SS3D.Interactions
/// </summary>
public abstract class Interaction : IInteraction
{
public string Name;
public Sprite Icon;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/SS3D/SceneManagement/SceneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private void LoadMainScene()
isUsingCommandLineArgs = Environment.GetCommandLineArgs().Length > 1;
}

DatabaseAsset sceneToLoad = isUsingCommandLineArgs ? Scenes.Intro : Scenes.Launcher;
string sceneToLoad = isUsingCommandLineArgs ? Scenes.Intro : Scenes.Launcher;

Log.Information(this, $"Loading main scene as {sceneToLoad.Name}", Logs.Important);
Log.Information(this, $"Loading main scene as {sceneToLoad}", Logs.Important);

if (applicationSettings.ForceLauncher)
{
Expand Down
53 changes: 30 additions & 23 deletions Assets/Scripts/SS3D/Systems/Furniture/LockLockerInteraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ namespace SS3D.Systems.Inventory.Interactions
{
public sealed class LockLockerInteraction : Interaction
{
private IDPermission permissionToUnlock;

public event EventHandler<bool> OnOpenStateChanged;
Locker locker;
private readonly IDPermission _permissionToUnlock;
private readonly Locker _locker;

public LockLockerInteraction(Locker locker, IDPermission permission)
{
this.locker = locker;
this.permissionToUnlock = permission;
_locker = locker;
_permissionToUnlock = permission;
}

public override string GetName(InteractionEvent interactionEvent)
Expand All @@ -39,33 +37,42 @@ public override bool CanInteract(InteractionEvent interactionEvent)
{
return false;
}

if (!_locker.Lockable)
{
return false;
}

return !locker.Locked;
return !_locker.IsLocked && !_locker.IsOpen;
}

public override bool Start(InteractionEvent interactionEvent, InteractionReference reference)
{
IInteractionSource source = interactionEvent.Source;
if (source is IGameObjectProvider sourceGameObjectProvider)

if (source is not IGameObjectProvider sourceGameObjectProvider)
{
Hands hands = sourceGameObjectProvider.GameObject.GetComponentInParent<Hands>();

if (hands != null)
{
if (hands.Inventory.HasPermission(permissionToUnlock))
{
Log.Information(this, "Locker has been locked!");
locker.Locked = true;
} else
{
Log.Information(this, "No permission to lock Locker!");
return false;
}
}
return false;
}

Hands hands = sourceGameObjectProvider.GameObject.GetComponentInParent<Hands>();
if (hands == null)
{
return true;
}
return false;

if (hands.Inventory.HasPermission(_permissionToUnlock))
{
Log.Information(this, "Locker has been locked!");
_locker.IsLocked = true;
}
else
{
Log.Information(this, "No permission to lock Locker!");
return false;
}

return true;
}
}
}
Loading

0 comments on commit 65b452c

Please sign in to comment.