Skip to content

Commit

Permalink
Add and remove individual hands (#1230)
Browse files Browse the repository at this point in the history
* allow old view inventory to avoid crashing

* Add type to slots and resize slots

* make divisor a prefab

* Add basis for new inventory

* Add new inventory to human and inventory view to canvas

* Add alternative inventory container

* Make alternative dynamic UI work

* remove handsview and put highlight in hands script

* require inventoryalt component

* fix completely container UI interactions

* fix everything

* separate inventory into inventory and containerviewer

this alleviates a bit the role of the inventory. Inventory should only handles what's on the player or hold by them. Opened Containers by the player should be displayed using another script, dedicated to that.

* add doc, add method to InventoryView

* adds doc

* rename Inventory to HUmanInventory

this prevents the conflit with Inventory namespace

* a bit of decoupling and renaming

* make hands set up after inventory to avoid timing issues

* fix weird hand highlight bug

* sync loadout

* prefab update with some bugs

* fix slots type and count hand slots

* kinda fix highlight hands colors

* remove old hand prefabs

* add bag slot and fix hand distance

* fix order of slots

* add clothing slots and containers

* add trucker hat and sunglasses

* add cloth displayers for glasses

* fix a bit some patch

* add hat display

* add some doc

* factorise some code

* fix value in container type to have non overlapping bits

* update human prefab

* Add some clothes items

* make pair slots individual, fix container type

* add display for other type of clothes

* small fix

* add inventory slot container

* remove useless using

* fix container on jumpsuit

* make slot remove when container removed

* add and remove slots and containers in inventory

* update hack

* fix exception on item display

* show item present in slot

* update human prefab

* sync clothing display

* remove warning about parent transform

* allows to remove container in UI of clients

* slightly reduce the mesh bug

* Add bunch of traits for clothing

* add backpack item

* modify a bit slots

* remove separator and improve methods to select slots

* adding id slot and inventory

* remove shoes

* rename stuff, document HumanInventory

* rename, document inventoryview

* rename, document containerviewer

* doc an name change in clothesDisplayer

* small rename

* fix build clothes displaying weirdly

* add support for bag and face mask

* add headset item and support

* remove inventory slot

* fix hand slots

* Revert "remove inventory slot"

This reverts commit 07d3b0e.

* fix glove left and right

* fix slot position in horizontal layout

* remove inventoryslot container

* only container with display as slot in the UI

* clicking on wrong containers no longer drop item

* add some doc and tags

* PDa is no longer considered clothing

* fixing hand containers from push and fixing PDA container

* making containerViewer private

* change to dynamic list of displayed clothes

* partly fix some handling positions

* fix pda spawning multiple times

* correctly set up viewer only for owner

* remove useless PDA and methods

* move accessor

* remove inventory container on disabled

* add spawning with clothes

* fixing forgotten change

* update assistant loadout

* add headset to items, fix loadout

* fix sec jumpsuit

* fix return too soon

* fix jumpsuit

* fix pocket jumpsuit

* add and remove containers methods

* removing and adding slots now works properly

When a gameobject container is disabled and was part of the inventory, the container slot linked to it disappear. Similar when adding a container.

* onenable add container

* fix slot size of items sprite

* fixing item missing exceptions

* fix grid

* put jumpsuit on item layer

* clean and doc

* first commit

* fix some interaction stuff

* fix pickup interaction

* fix hands

* add some fix and properly remove hand

* some doc

* more doc

* add assetdatabase for bodyparts

* add hands as items

* assetdatabase bodyparts adding follow up

* small fix to hands selection

* add hand command

* condition fix

* cleanup and permission check

* add doc

* fix handcommand

* remove useless method in hand command

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* rename delegate and event

* Update Assets/Scripts/SS3D/Systems/Inventory/Containers/Hand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/Inventory/Containers/InventoryView.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/Inventory/Containers/Hand.cs

Co-authored-by: Iamteapot <[email protected]>

* Update Assets/Scripts/SS3D/Systems/IngameConsoleSystem/Commands/AddHandCommand.cs

Co-authored-by: Iamteapot <[email protected]>

* update variables name

* fix missing ref

* fix all interactions

* add a comment to hand file

---------

Co-authored-by: Iamteapot <[email protected]>
  • Loading branch information
stilnat and iamteapot422 authored Aug 12, 2023
1 parent 5b605a3 commit 28e5a23
Show file tree
Hide file tree
Showing 45 changed files with 1,695 additions and 352 deletions.
1 change: 1 addition & 0 deletions Assets/Content/Addressables/AddressableAssetSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 8e95016540bf27c4eb11580ec096568a, type: 2}
- {fileID: 11400000, guid: 9bfbc9d4c2c1bb944942108648547da2, type: 2}
- {fileID: 11400000, guid: bacca0c47905ef441803065410c8978e, type: 2}
- {fileID: 11400000, guid: ee54898534212cd4a97b528a9d620c75, type: 2}
m_BuildSettings:
m_CompileScriptsInVirtualMode: 0
m_CleanupStreamingAssetsAfterBuilds: 1
Expand Down
33 changes: 33 additions & 0 deletions Assets/Content/Addressables/AssetGroups/BodyParts.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: BodyParts
m_EditorClassIdentifier:
m_GroupName: BodyParts
m_Data:
m_SerializedData: []
m_GUID: ff965427dd1889046a3e238d5cb96512
m_SerializeEntries:
- m_GUID: 35dfc7c3f708a5b48a206b4a44e7ab49
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanBodyParts/HumanHandLeft.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 7f5954f009d06b2439ca637b43920440
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanBodyParts/HumanHandRight.prefab
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
m_Schemas:
- {fileID: 11400000, guid: 4de7234b6744e474581238ba31893e14, type: 2}
- {fileID: 11400000, guid: 007c51ffa6d371a4aacdc075169132b2, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Addressables/AssetGroups/BodyParts.asset.meta

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

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ MonoBehaviour:
m_Data:
m_SerializedData: []
m_GUID: a8f988e8c8dd50c4ea7f7f7e5f300082
m_SerializeEntries: []
m_SerializeEntries:
- m_GUID: c19eccca279beee4186432a03257a7b9
m_Address: Assets/Content/WorldObjects/Items/BodyParts/HumanHandRight.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: df85b75fd341a244c8364ebb9c4fcfef
m_Address: Assets/Content/WorldObjects/Items/BodyParts/HumanHandLeft.prefab
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: BodyParts_BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: ee54898534212cd4a97b528a9d620c75, type: 2}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id: 56790a984472fbe4a809c1ab1b0e4c79
m_LoadPath:
m_Id: 8abc09617b79e8b4994b07cc672cbbe5
m_BundleMode: 0
m_AssetBundleProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
m_BundleNaming: 0
m_AssetLoadMode: 0

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: BodyParts_ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: ee54898534212cd4a97b528a9d620c75, type: 2}
m_StaticContent: 0

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

Binary file modified Assets/Content/Addressables/Windows/addressables_content_state.bin
Binary file not shown.
20 changes: 20 additions & 0 deletions Assets/Content/Data/BodyParts.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c9b6c8ad6324c838c1743c2a2e2abc4, type: 3}
m_Name: BodyParts
m_EditorClassIdentifier:
EnumNamespaceName: SS3D.Data.Enums
EnumName: BodyPartsIds
AssetGroup: {fileID: 11400000, guid: ee54898534212cd4a97b528a9d620c75, type: 2}
Assets:
- {fileID: 5774385816057912484, guid: 35dfc7c3f708a5b48a206b4a44e7ab49, type: 3}
- {fileID: 5774385816057912484, guid: 7f5954f009d06b2439ca637b43920440, type: 3}
8 changes: 8 additions & 0 deletions Assets/Content/Data/BodyParts.asset.meta

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

2 changes: 2 additions & 0 deletions Assets/Content/Data/DefaultPrefabObjects.asset
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ MonoBehaviour:
- {fileID: 6636680625000353110, guid: cc5383d385556f443b2a7d3202f2b2c1, type: 3}
- {fileID: 3227132888119106738, guid: 7bbb74a7ffc8cae44baa886de43c586b, type: 3}
- {fileID: 1871071288925904272, guid: add4d1bc2d874d94782d6b8c912af5e2, type: 3}
- {fileID: 8532088199163376958, guid: df85b75fd341a244c8364ebb9c4fcfef, type: 3}
- {fileID: 8532088199163376958, guid: c19eccca279beee4186432a03257a7b9, type: 3}
- {fileID: 6115335805774105745, guid: bf177f8bab26bc84b87fd9a971004418, type: 3}
- {fileID: 6699414010407460003, guid: f1aeab0a35c29314a8a3f823de9815c1, type: 3}
- {fileID: 4692070367735979832, guid: 8725b7f8f45d28a4ba6063318904cc8a, type: 3}
Expand Down
79 changes: 55 additions & 24 deletions Assets/Content/WorldObjects/Entities/Humanoids/Human/Human.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -6995,7 +6995,9 @@ MonoBehaviour:
- {fileID: 7951212175384182717}
- {fileID: 8320963098858079385}
- {fileID: 4140518851396729342}
- {fileID: 4854640730944196939}
- {fileID: 7144090709710962679}
- {fileID: 4555203962178419925}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField:
- {fileID: 4138789318277530234}
Expand Down Expand Up @@ -7275,16 +7277,12 @@ MonoBehaviour:
_componentIndexCache: 9
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
HandContainers:
- {fileID: 4140518851396729342}
- {fileID: 7144090709710962679}
handRange: 5
SelectedColor: {r: 1, g: 0.9764151, b: 0.9764151, a: 0.8509804}
range:
Horizontal: 1.5
Vertical: 2
interactionOrigin: {fileID: 5927494552340417975}
pickupIcon: {fileID: 21300000, guid: d1f34343e08a14e48a856e409c355f32, type: 3}
PlayerHands:
- {fileID: 4854640730944196939}
- {fileID: 4555203962178419925}
_selectedColor: {r: 1, g: 1, b: 1, a: 0.8627451}
_defaultColor: {r: 1, g: 1, b: 1, a: 0.45490196}
_selectedHand: {fileID: 0}
--- !u!114 &7934531206375951864
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -7404,19 +7402,6 @@ MonoBehaviour:
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
_inventory: {fileID: 1089183168752255729}
ClothesRoot: {fileID: 1870850359086752095}
startingClothedBodyPart:
- {fileID: 7590913349156985469}
- {fileID: 8410791339138828931}
- {fileID: 4138789318277530234}
- {fileID: 6233962219268866637}
- {fileID: 8067289659534850981}
- {fileID: 6911900315559804093}
- {fileID: 8626656600768578774}
- {fileID: 4684017524585288931}
- {fileID: 2091115627957921416}
- {fileID: 7534105608452820685}
- {fileID: 1527032890679831709}
--- !u!114 &4559920193704007786
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -9998,6 +9983,7 @@ GameObject:
- component: {fileID: 1342008326084027676}
- component: {fileID: 4140518851396729342}
- component: {fileID: 8300769832796282301}
- component: {fileID: 4854640730944196939}
m_Layer: 0
m_Name: hold.l
m_TagString: Untagged
Expand Down Expand Up @@ -10073,6 +10059,28 @@ MonoBehaviour:
m_EditorClassIdentifier:
attachedContainer: {fileID: 4140518851396729342}
Mirrored: 1
--- !u!114 &4854640730944196939
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8915899267794646267}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e60c09e136263a44eb7996c9a5dc742a, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 38
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
Container: {fileID: 4140518851396729342}
_range:
Horizontal: 1.5
Vertical: 2
_pickupIcon: {fileID: 21300000, guid: d1f34343e08a14e48a856e409c355f32, type: 3}
_interactionOrigin: {fileID: 1342008326084027676}
HandsController: {fileID: 2150560678942863610}
--- !u!1 &8935913803077858714
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10294,6 +10302,7 @@ GameObject:
- component: {fileID: 6653541696833174003}
- component: {fileID: 7144090709710962679}
- component: {fileID: 8735509741792839302}
- component: {fileID: 4555203962178419925}
m_Layer: 0
m_Name: hold.r
m_TagString: Untagged
Expand Down Expand Up @@ -10328,7 +10337,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 25696236470760b41b375e9b6939444c, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 38
_componentIndexCache: 39
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
_automaticContainerSetUp: 0
Expand Down Expand Up @@ -10369,6 +10378,28 @@ MonoBehaviour:
m_EditorClassIdentifier:
attachedContainer: {fileID: 7144090709710962679}
Mirrored: 0
--- !u!114 &4555203962178419925
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9064888651365615274}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e60c09e136263a44eb7996c9a5dc742a, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 40
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
Container: {fileID: 7144090709710962679}
_range:
Horizontal: 1.5
Vertical: 2
_pickupIcon: {fileID: 21300000, guid: 2db953f2ae8f41d4e9842d9144a9e396, type: 2}
_interactionOrigin: {fileID: 6653541696833174003}
HandsController: {fileID: 2150560678942863610}
--- !u!1 &9131769810566877388
GameObject:
m_ObjectHideFlags: 0
Expand Down
Loading

0 comments on commit 28e5a23

Please sign in to comment.