diff --git a/Assets/Artists/Configs/Cosmetics/26.asset b/Assets/Artists/Configs/Cosmetics/26/26.asset similarity index 62% rename from Assets/Artists/Configs/Cosmetics/26.asset rename to Assets/Artists/Configs/Cosmetics/26/26.asset index 0150ba2f8..d1da4d1ab 100644 --- a/Assets/Artists/Configs/Cosmetics/26.asset +++ b/Assets/Artists/Configs/Cosmetics/26/26.asset @@ -14,17 +14,18 @@ MonoBehaviour: m_EditorClassIdentifier: id: 3070 addressablePath: Cosmetic_26 - icon: {fileID: 0} + icon: {fileID: 21300000, guid: b075e06940f2a2e40b7e6046c4fd0be3, type: 3} type: rid: -2 contents: - - rid: 1055089212959490104 + - rid: 3736623591745912971 references: version: 2 RefIds: - rid: -2 type: {class: , ns: , asm: } - - rid: 1055089212959490104 - type: {class: CosmeticTextureContent, ns: BITFALL.Cosmetic, asm: BITFALL.Cosmetic.Runtime} + - rid: 3736623591745912971 + type: {class: CosmeticModelContent, ns: BITFALL.Cosmetic, asm: BITFALL.Cosmetic.Runtime} data: - texture: {fileID: 2800000, guid: fececaf19d25e1f409adb32147d3087a, type: 3} + model: {fileID: 4018032812772508551, guid: 4ae346c12d703d1478b150af4b7b110a, + type: 3} diff --git a/Assets/Artists/Configs/Cosmetics/26/Cosmetic_26_Icon.png b/Assets/Artists/Configs/Cosmetics/26/Cosmetic_26_Icon.png new file mode 100644 index 000000000..f18d50879 Binary files /dev/null and b/Assets/Artists/Configs/Cosmetics/26/Cosmetic_26_Icon.png differ diff --git a/Assets/Artists/Prefabs/Character/Skin_Character_26.prefab b/Assets/Artists/Configs/Cosmetics/26/Cosmetic_26_Prefab.prefab similarity index 100% rename from Assets/Artists/Prefabs/Character/Skin_Character_26.prefab rename to Assets/Artists/Configs/Cosmetics/26/Cosmetic_26_Prefab.prefab diff --git a/Assets/Artists/Configs/Cosmetics/6C.asset b/Assets/Artists/Configs/Cosmetics/6C.asset index 5028e158e..df8c430ea 100644 --- a/Assets/Artists/Configs/Cosmetics/6C.asset +++ b/Assets/Artists/Configs/Cosmetics/6C.asset @@ -14,7 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: id: 3071 addressablePath: Cosmetic_6C - icon: {fileID: 0} + icon: {fileID: 21300000, guid: 7b28db226034ae44b93dd84516f8e6ca, type: 3} type: rid: -2 contents: diff --git a/Assets/Artists/Configs/Cosmetics/Cosmetic_6C_Icon.png b/Assets/Artists/Configs/Cosmetics/Cosmetic_6C_Icon.png new file mode 100644 index 000000000..5af477cb7 Binary files /dev/null and b/Assets/Artists/Configs/Cosmetics/Cosmetic_6C_Icon.png differ diff --git a/Assets/Artists/Configs/Cosmetics/Cosmetic_Steve_Icon.png b/Assets/Artists/Configs/Cosmetics/Cosmetic_Steve_Icon.png new file mode 100644 index 000000000..c01818608 Binary files /dev/null and b/Assets/Artists/Configs/Cosmetics/Cosmetic_Steve_Icon.png differ diff --git a/Assets/Artists/Configs/Cosmetics/Steve.asset b/Assets/Artists/Configs/Cosmetics/Steve.asset index e27ad7253..0a1daad6a 100644 --- a/Assets/Artists/Configs/Cosmetics/Steve.asset +++ b/Assets/Artists/Configs/Cosmetics/Steve.asset @@ -14,7 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: id: 3070 addressablePath: Cosmetic_Steve - icon: {fileID: 0} + icon: {fileID: 21300000, guid: 9421e3a9c212c724b9a25c9a6e04c652, type: 3} type: rid: -2 contents: diff --git a/Assets/Artists/Prefabs/Player.prefab b/Assets/Artists/Prefabs/Player.prefab index 732c713cf..fba8df3c3 100644 --- a/Assets/Artists/Prefabs/Player.prefab +++ b/Assets/Artists/Prefabs/Player.prefab @@ -26,7 +26,7 @@ Transform: m_GameObject: {fileID: 500116121299416468} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.0000015497208, y: 1.240993, z: 0.25499707} + m_LocalPosition: {x: 0.000001776565, y: 1.240993, z: 0.25499713} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -167,7 +167,7 @@ Transform: m_GameObject: {fileID: 1114388079014775081} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.999996, z: 0} + m_LocalPosition: {x: -0.00000006556674, y: 0.999996, z: -0.000000059604645} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -665,8 +665,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2316171592450128199} serializedVersion: 2 - m_LocalRotation: {x: 0.70710665, y: 0.70710695, z: 0.00000033102063, w: -0.00000019861227} - m_LocalPosition: {x: 0.7999986, y: 1.099999, z: -0.00000011920929} + m_LocalRotation: {x: 0.70710665, y: 0.70710695, z: 0.00000033102063, w: -0.0000001986123} + m_LocalPosition: {x: 0.7999984, y: 1.099999, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -851,7 +851,7 @@ ParentConstraint: m_TranslationOffsets: - {x: 0, y: 0, z: 0} m_RotationOffsets: - - {x: -89.89165, y: 0, z: 179.99997} + - {x: -89.89165, y: 0, z: 179.99995} m_AffectTranslationX: 1 m_AffectTranslationY: 1 m_AffectTranslationZ: 1 @@ -1468,7 +1468,7 @@ Transform: m_GameObject: {fileID: 4384995658573422445} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.000000074505806, y: 1.1, z: 0.27000034} + m_LocalPosition: {x: 0, y: 1.1, z: 0.27000016} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1558,6 +1558,7 @@ GameObject: - component: {fileID: 1864257874290245771} - component: {fileID: 9057491770586552412} - component: {fileID: 3821349879728530083} + - component: {fileID: 7501788603299284274} m_Layer: 6 m_Name: Player m_TagString: Untagged @@ -2993,13 +2994,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a830f58f533f474e8b7683cff1134b9, type: 3} m_Name: m_EditorClassIdentifier: - steamService: - rid: 1055089212959490105 + cosmeticService: + rid: 3736623591745913040 references: version: 2 RefIds: - - rid: 1055089212959490105 - type: {class: SteamServiceSingleton, ns: BITKit.Steamwork, asm: BITKit.Extension.Steamwork} + - rid: 3736623591745913040 + type: {class: CosmeticServiceSingleton, ns: BITFALL.Cosmetic, asm: BITFALL.Cosmetic.Runtime} data: --- !u!114 &1131982008252475633 MonoBehaviour: @@ -3216,6 +3217,28 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 77e631bb6c04dda48a4905dd5e093df8, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &7501788603299284274 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4826102346843731729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e582a0447ab49324f944f5d4635d233d, type: 3} + m_Name: + m_EditorClassIdentifier: + currentRenderers: + - {fileID: 7305805713099462304} + - {fileID: 6175183981451570083} + - {fileID: 8577244862334749759} + - {fileID: 1036846622460757989} + - {fileID: 6102918721534868980} + - {fileID: 6097241474274289012} + - {fileID: 1705118708203355834} + armature: {fileID: 4209372041148271106} + meshRoot: {fileID: 3669033169141628990} --- !u!1 &4826102347057741775 GameObject: m_ObjectHideFlags: 0 @@ -3309,7 +3332,7 @@ Transform: m_GameObject: {fileID: 5029524798424683285} serializedVersion: 2 m_LocalRotation: {x: 1, y: -0.00000009362675, z: -0, w: 0} - m_LocalPosition: {x: 0.099999905, y: 0.6, z: 0.000000007450581} + m_LocalPosition: {x: 0.09999986, y: 0.6, z: -0.000000059604645} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -4305,7 +4328,7 @@ Transform: m_GameObject: {fileID: 7147149369621539321} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.00000011920929, y: 0.9000001, z: -0.00000020647656} + m_LocalPosition: {x: -0.00000007868051, y: 0.9000001, z: -0.00000011920929} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -5845,7 +5868,7 @@ PrefabInstance: - target: {fileID: 2699172070614207317, guid: 9fca9f6a9cb170842bc149a7236856d5, type: 3} propertyPath: m_RotationOffsets.Array.data[0].x - value: -89.97203 + value: -89.980225 objectReference: {fileID: 0} - target: {fileID: 2699172070614207317, guid: 9fca9f6a9cb170842bc149a7236856d5, type: 3} @@ -8441,6 +8464,12 @@ CapsuleCollider: type: 3} m_PrefabInstance: {fileID: 3648022406799836390} m_PrefabAsset: {fileID: 0} +--- !u!137 &1036846622460757989 stripped +SkinnedMeshRenderer: + m_CorrespondingSourceObject: {fileID: 4378624254320444163, guid: 5f9e9216c9925af4bafec02dca8c438e, + type: 3} + m_PrefabInstance: {fileID: 3648022406799836390} + m_PrefabAsset: {fileID: 0} --- !u!54 &1237133944160143214 stripped Rigidbody: m_CorrespondingSourceObject: {fileID: 2561228540091958152, guid: 5f9e9216c9925af4bafec02dca8c438e, @@ -8562,6 +8591,12 @@ Rigidbody: type: 3} m_PrefabInstance: {fileID: 3648022406799836390} m_PrefabAsset: {fileID: 0} +--- !u!4 &3669033169141628990 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 21224110552532184, guid: 5f9e9216c9925af4bafec02dca8c438e, + type: 3} + m_PrefabInstance: {fileID: 3648022406799836390} + m_PrefabAsset: {fileID: 0} --- !u!54 &3805063173658066897 stripped Rigidbody: m_CorrespondingSourceObject: {fileID: 463358143652920119, guid: 5f9e9216c9925af4bafec02dca8c438e, @@ -8640,18 +8675,36 @@ Rigidbody: type: 3} m_PrefabInstance: {fileID: 3648022406799836390} m_PrefabAsset: {fileID: 0} +--- !u!137 &6097241474274289012 stripped +SkinnedMeshRenderer: + m_CorrespondingSourceObject: {fileID: 7367222540271198610, guid: 5f9e9216c9925af4bafec02dca8c438e, + type: 3} + m_PrefabInstance: {fileID: 3648022406799836390} + m_PrefabAsset: {fileID: 0} --- !u!137 &6102918721534868980 stripped SkinnedMeshRenderer: m_CorrespondingSourceObject: {fileID: 7354814916988172562, guid: 5f9e9216c9925af4bafec02dca8c438e, type: 3} m_PrefabInstance: {fileID: 3648022406799836390} m_PrefabAsset: {fileID: 0} +--- !u!137 &6175183981451570083 stripped +SkinnedMeshRenderer: + m_CorrespondingSourceObject: {fileID: 7427218707016986437, guid: 5f9e9216c9925af4bafec02dca8c438e, + type: 3} + m_PrefabInstance: {fileID: 3648022406799836390} + m_PrefabAsset: {fileID: 0} --- !u!4 &7096961398375027653 stripped Transform: m_CorrespondingSourceObject: {fileID: 5826841836839622435, guid: 5f9e9216c9925af4bafec02dca8c438e, type: 3} m_PrefabInstance: {fileID: 3648022406799836390} m_PrefabAsset: {fileID: 0} +--- !u!137 &7305805713099462304 stripped +SkinnedMeshRenderer: + m_CorrespondingSourceObject: {fileID: 6323914363302859334, guid: 5f9e9216c9925af4bafec02dca8c438e, + type: 3} + m_PrefabInstance: {fileID: 3648022406799836390} + m_PrefabAsset: {fileID: 0} --- !u!4 &8095626919936485443 stripped Transform: m_CorrespondingSourceObject: {fileID: 4825906924822146213, guid: 5f9e9216c9925af4bafec02dca8c438e, @@ -9613,7 +9666,7 @@ PrefabInstance: - target: {fileID: 8708888658787439598, guid: acb664f54d0fe754187a8a585f97658a, type: 3} propertyPath: m_RotationOffsets.Array.data[0].x - value: -89.97203 + value: -89.980225 objectReference: {fileID: 0} - target: {fileID: 8708888658787439598, guid: acb664f54d0fe754187a8a585f97658a, type: 3} @@ -11787,7 +11840,7 @@ PrefabInstance: - target: {fileID: 510493149151740240, guid: 3d2cb9f79a32fde4ba7e7aa43affde80, type: 3} propertyPath: m_LocalPosition.x - value: -0.000000059604645 + value: -0.0000000029802436 objectReference: {fileID: 0} - target: {fileID: 510493149151740240, guid: 3d2cb9f79a32fde4ba7e7aa43affde80, type: 3} @@ -11797,7 +11850,7 @@ PrefabInstance: - target: {fileID: 510493149151740240, guid: 3d2cb9f79a32fde4ba7e7aa43affde80, type: 3} propertyPath: m_LocalPosition.z - value: 0.00000011920929 + value: 0 objectReference: {fileID: 0} - target: {fileID: 510493149151740240, guid: 3d2cb9f79a32fde4ba7e7aa43affde80, type: 3} @@ -12445,7 +12498,7 @@ PrefabInstance: - target: {fileID: 1658157669171736235, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalPosition.x - value: -0.000000059604645 + value: -0.000000004292019 objectReference: {fileID: 0} - target: {fileID: 1658157669171736235, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} @@ -12455,12 +12508,12 @@ PrefabInstance: - target: {fileID: 1658157669171736235, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalPosition.z - value: -0.049095035 + value: -0.049095094 objectReference: {fileID: 0} - target: {fileID: 3516031247899474845, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_RotationOffsets.Array.data[0].x - value: -89.97203 + value: -89.980225 objectReference: {fileID: 0} - target: {fileID: 3516031247899474845, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} @@ -12470,7 +12523,7 @@ PrefabInstance: - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalPosition.x - value: -0.000000059604645 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} @@ -12480,27 +12533,27 @@ PrefabInstance: - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalPosition.z - value: 0.00000011920929 - objectReference: {fileID: 0} - - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, - type: 3} - propertyPath: m_LocalRotation.w value: 0 objectReference: {fileID: 0} + - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.00000006621555 + objectReference: {fileID: 0} - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: -0.00000006619268 objectReference: {fileID: 0} - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalRotation.y - value: 0.7071068 + value: -0.7069847 objectReference: {fileID: 0} - target: {fileID: 4398408068529648195, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} propertyPath: m_LocalRotation.z - value: 0.7071068 + value: -0.7072289 objectReference: {fileID: 0} - target: {fileID: 5150045246718051008, guid: d1407a692f82a9e45bf6dfb03e65b2aa, type: 3} @@ -12974,7 +13027,7 @@ PrefabInstance: - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalPosition.x - value: -0.000000059604645 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} @@ -12984,27 +13037,27 @@ PrefabInstance: - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalPosition.z - value: 0.00000011920929 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalRotation.w - value: 0.000000066204116 + value: 0.00000006621555 objectReference: {fileID: 0} - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalRotation.x - value: -0.000000066204116 + value: -0.00000006619268 objectReference: {fileID: 0} - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalRotation.y - value: 0.7071068 + value: 0.7069847 objectReference: {fileID: 0} - target: {fileID: 4116833917040748021, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_LocalRotation.z - value: 0.7071068 + value: 0.7072289 objectReference: {fileID: 0} - target: {fileID: 6156840148688175370, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} @@ -13064,7 +13117,7 @@ PrefabInstance: - target: {fileID: 6985491524115399640, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} propertyPath: m_RotationOffsets.Array.data[0].x - value: -89.97203 + value: -89.980225 objectReference: {fileID: 0} - target: {fileID: 6985491524115399640, guid: 0d423fa73ece789458e513f5f701eaa6, type: 3} diff --git a/Assets/Artists/Prefabs/Services/Framework.prefab b/Assets/Artists/Prefabs/Services/Framework.prefab index df4e197f7..a5170101f 100644 --- a/Assets/Artists/Prefabs/Services/Framework.prefab +++ b/Assets/Artists/Prefabs/Services/Framework.prefab @@ -86,6 +86,7 @@ GameObject: - component: {fileID: 7871355712240718068} - component: {fileID: 3572850690277305562} - component: {fileID: 9020706379512857235} + - component: {fileID: 930148704001361127} m_Layer: 0 m_Name: Framework m_TagString: Untagged @@ -804,6 +805,22 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0fcacd6a30c7f3d4aae646f0717125ac, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &930148704001361127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 594564951014165300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7244e4f9036d839448d1b688ce4b5b19, type: 3} + m_Name: + m_EditorClassIdentifier: + initialCosmetics: + - {fileID: 11400000, guid: 43354319a89aa5e42afc30b631405f76, type: 2} + - {fileID: 11400000, guid: bdd962192ebaf0e4194a30caa3187db5, type: 2} + - {fileID: 11400000, guid: de7344e90b711ec45a4764294a1f6c80, type: 2} --- !u!1 &842760063283004380 GameObject: m_ObjectHideFlags: 0 @@ -1661,6 +1678,7 @@ GameObject: - component: {fileID: 8878668931328478029} - component: {fileID: 6846980077375805636} - component: {fileID: 6877416267079111868} + - component: {fileID: 799091227054309177} m_Layer: 0 m_Name: Menu m_TagString: Untagged @@ -1850,6 +1868,28 @@ MonoBehaviour: - rid: 7707057777320395011 type: {class: GameNet, ns: BITKit.Net, asm: BITKit} data: +--- !u!114 &799091227054309177 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3506318474073017514} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4a99dd3d155a2949b923495e42dbf6b, type: 3} + m_Name: + m_EditorClassIdentifier: + _cosmeticService: + rid: 3736623591745913007 + cosmeticsTemplate: {fileID: 9197481963319205126, guid: 10fc544374045db408be2c05caf9be17, + type: 3} + references: + version: 2 + RefIds: + - rid: 3736623591745913007 + type: {class: CosmeticServiceSingleton, ns: BITFALL.Cosmetic, asm: BITFALL.Cosmetic.Runtime} + data: --- !u!1 &3702482717942338853 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Artists/Scenes/Game/Prototype.unity b/Assets/Artists/Scenes/Game/Prototype.unity index 2fc97b855..e6093eda0 100644 --- a/Assets/Artists/Scenes/Game/Prototype.unity +++ b/Assets/Artists/Scenes/Game/Prototype.unity @@ -8340,7 +8340,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c8725edae6a1fd4408036dedaf0199f0, type: 3} m_Name: m_EditorClassIdentifier: - _projectionSettings: {fileID: 414302140} + _projectionSettings: {fileID: 1678015835} _dragAndDropGuide: {fileID: 0} --- !u!114 &115302397 MonoBehaviour: @@ -93968,7 +93968,7 @@ MonoBehaviour: _extensionPlane: _refOBBFace: 4 _heightPatternDirection: 0 - _modularSnapSession: {fileID: 594047965} + _modularSnapSession: {fileID: 759762237} _mirrorGizmo: {fileID: 1959357466} --- !u!1001 &153410394 PrefabInstance: @@ -99457,7 +99457,7 @@ MonoBehaviour: _spawnGuide: {fileID: 884730363} _extensionPlane: _refOBBFace: 4 - _modularSnapSession: {fileID: 406157289} + _modularSnapSession: {fileID: 1519423986} _mirrorGizmo: {fileID: 839743558} --- !u!1001 &220243287 PrefabInstance: @@ -111509,21 +111509,6 @@ MeshFilter: type: 3} m_PrefabInstance: {fileID: 400538603} m_PrefabAsset: {fileID: 0} ---- !u!114 &406157289 -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: 38a40404d9721ed4f984030fbce11d53, type: 3} - m_Name: - m_EditorClassIdentifier: - _snapMode: 0 - _snapHalfSpace: 0 - _projectionSettings: {fileID: 0} --- !u!1001 &406935682 PrefabInstance: m_ObjectHideFlags: 0 @@ -112449,26 +112434,6 @@ MeshFilter: type: 3} m_PrefabInstance: {fileID: 680140436} m_PrefabAsset: {fileID: 0} ---- !u!114 &414302140 -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: 49490255aaf1a2641a4c5771511bd253, type: 3} - m_Name: - m_EditorClassIdentifier: - _halfSpace: 1 - _alignAxis: 0 - _alignmentAxis: 1 - _invertAlignmentAxis: 0 - _projectAsUnit: 0 - _embedInSurface: 1 - _inFrontOffset: 0 - _behindOffset: 0 --- !u!1001 &414800686 PrefabInstance: m_ObjectHideFlags: 0 @@ -128587,21 +128552,6 @@ LODGroup: type: 3} m_PrefabInstance: {fileID: 593817163} m_PrefabAsset: {fileID: 0} ---- !u!114 &594047965 -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: 38a40404d9721ed4f984030fbce11d53, type: 3} - m_Name: - m_EditorClassIdentifier: - _snapMode: 0 - _snapHalfSpace: 0 - _projectionSettings: {fileID: 0} --- !u!1001 &596198748 PrefabInstance: m_ObjectHideFlags: 0 @@ -175401,6 +175351,21 @@ LODGroup: type: 3} m_PrefabInstance: {fileID: 759498680} m_PrefabAsset: {fileID: 0} +--- !u!114 &759762237 +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: 38a40404d9721ed4f984030fbce11d53, type: 3} + m_Name: + m_EditorClassIdentifier: + _snapMode: 0 + _snapHalfSpace: 0 + _projectionSettings: {fileID: 0} --- !u!1001 &759906531 PrefabInstance: m_ObjectHideFlags: 0 @@ -242641,6 +242606,21 @@ MeshFilter: type: 3} m_PrefabInstance: {fileID: 1519044242} m_PrefabAsset: {fileID: 0} +--- !u!114 &1519423986 +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: 38a40404d9721ed4f984030fbce11d53, type: 3} + m_Name: + m_EditorClassIdentifier: + _snapMode: 0 + _snapHalfSpace: 0 + _projectionSettings: {fileID: 0} --- !u!1001 &1520760032 PrefabInstance: m_ObjectHideFlags: 0 @@ -253478,6 +253458,26 @@ LODGroup: type: 3} m_PrefabInstance: {fileID: 1677629281} m_PrefabAsset: {fileID: 0} +--- !u!114 &1678015835 +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: 49490255aaf1a2641a4c5771511bd253, type: 3} + m_Name: + m_EditorClassIdentifier: + _halfSpace: 1 + _alignAxis: 0 + _alignmentAxis: 1 + _invertAlignmentAxis: 0 + _projectAsUnit: 0 + _embedInSurface: 1 + _inFrontOffset: 0 + _behindOffset: 0 --- !u!1 &1678358382 stripped GameObject: m_CorrespondingSourceObject: {fileID: 2657968701223619286, guid: 22c543a201d947146a7c654abeb26d98, diff --git a/Assets/Artists/Scripts/CosmeticInventory/AssetableCosmetic.cs b/Assets/Artists/Scripts/CosmeticInventory/AssetableCosmetic.cs index bf3d31726..fa09b4b3f 100644 --- a/Assets/Artists/Scripts/CosmeticInventory/AssetableCosmetic.cs +++ b/Assets/Artists/Scripts/CosmeticInventory/AssetableCosmetic.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using BITKit.Modification; using UnityEngine; // ReSharper disable ConvertToAutoProperty @@ -12,6 +13,12 @@ namespace BITFALL.Cosmetic [SerializeField] private Texture texture; public Texture Texture => texture; } + [Serializable] + public struct CosmeticModelContent:ICosmeticContent + { + [SerializeField] private GameObject model; + public GameObject Model => model; + } public class AssetableCosmetic : ScriptableObject,ICosmetic { [SerializeField] private ulong id; @@ -19,12 +26,15 @@ namespace BITFALL.Cosmetic [SerializeField] private Sprite icon; [SerializeReference, SubclassSelector] private ICosmeticType type; [SerializeReference, SubclassSelector] private ICosmeticContent[] contents; - + [SerializeReference, SubclassSelector] private IModifyElement[] require; + [SerializeReference, SubclassSelector] private IModifyElement[] incompatible; public Sprite Icon => icon; public string AddressablePath=> addressablePath; public ulong Id => id; public ICosmeticType Type=> type; public ICosmeticContent[] Contents=> contents; + public IModifyElement[] Require=> require; + public IModifyElement[] Incompatible=> incompatible; } } diff --git a/Assets/Artists/Scripts/CosmeticInventory/CosmeticService.cs b/Assets/Artists/Scripts/CosmeticInventory/CosmeticService.cs new file mode 100644 index 000000000..29e8690b4 --- /dev/null +++ b/Assets/Artists/Scripts/CosmeticInventory/CosmeticService.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using BITKit.Modification; +using UnityEngine; + +namespace BITFALL.Cosmetic +{ + [Serializable] + public struct CosmeticServiceSingleton:ICosmeticService + { + public ICosmetic[] Cosmetics=>CosmeticService.Singleton.Cosmetics; + public event Action OnCosmeticsChanged + { + add => CosmeticService.Singleton.OnCosmeticsChanged += value; + remove => CosmeticService.Singleton.OnCosmeticsChanged -= value; + } + + public IDictionary Modifies { get; set; } + public IDictionary Modified { get; set; } + public void Add(IModifyElement modify, object obj)=>CosmeticService.Singleton.Add(modify,obj); + + public void Remove(IModifyElement modify, out object obj)=>CosmeticService.Singleton.Remove(modify,out obj); + } + public class CosmeticService : MonoBehaviour,ICosmeticService + { + internal static ICosmeticService Singleton { get; private set; } + + [SerializeField] private AssetableCosmetic[] initialCosmetics; + public ICosmetic[] Cosmetics { get; set; } = Array.Empty(); + + public event Action OnCosmeticsChanged; + + private void Awake() + { + Singleton = this; + } + + private void Start() + { + Cosmetics = initialCosmetics.OfType().ToArray(); + OnCosmeticsChanged?.Invoke(); + } + private readonly IModifyManager _modifyManager = new ModifyManager(); + public IDictionary Modifies => _modifyManager.Modifies; + public IDictionary Modified => _modifyManager.Modified; + + public void Add(IModifyElement modify, object obj) + { + _modifyManager.Add(modify, obj); + OnCosmeticsChanged?.Invoke(); + } + public void Remove(IModifyElement modify, out object obj) + { + _modifyManager.Remove(modify, out obj); + OnCosmeticsChanged?.Invoke(); + } + } +} + diff --git a/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticModelBehaviour.cs b/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticModelBehaviour.cs new file mode 100644 index 000000000..9efa6350e --- /dev/null +++ b/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticModelBehaviour.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using BITFALL.Cosmetic; +using BITKit; +using BITKit.Entities; +using UnityEngine; + +namespace BITFALL.Entities.Cosmetic +{ + public class CosmeticModelBehaviour : EntityBehavior + { + [Inject(true)] private ICosmeticService _cosmeticService; + [SerializeField] private SkinnedMeshRenderer[] currentRenderers; + [SerializeField] private Transform armature; + [SerializeField] private Transform meshRoot; + public override void OnAwake() + { + if (_cosmeticService is null) return; + + _cosmeticService.OnCosmeticsChanged += OnCosmeticsChanged; + destroyCancellationToken.Register(() => _cosmeticService.OnCosmeticsChanged -= OnCosmeticsChanged); + } + + private void OnCosmeticsChanged() + { + foreach (var cosmetic in _cosmeticService.Cosmetics) + { + foreach (var content in cosmetic.Contents.OfType()) + { + foreach (var _renderer in currentRenderers) + { + Destroy(_renderer); + } + var instance = Instantiate(content.Model, armature); + currentRenderers = instance.GetComponentsInChildren(true); + TransferSkinnedMeshes(currentRenderers, meshRoot, armature); + } + } + } + + private static void TransferSkinnedMeshes(SkinnedMeshRenderer[] skinnedMeshRenderersList, Transform newParent, Transform newArmature) + { + foreach (var t in skinnedMeshRenderersList) + { + var cachedRootBoneName = t.rootBone.name; + var newBones = new Transform[t.bones.Length]; + for (var x = 0; x < t.bones.Length; x++) + foreach (var newBone in newArmature.GetComponentsInChildren(true)) + { + try + { + if (newBone.name == t.bones[x].name) + { + newBones[x] = newBone; + } + } + catch (Exception e) + { + BIT4Log.LogException(e); + } + } + + + var matchingRootBone = GetRootBoneByName(newArmature, cachedRootBoneName); + t.rootBone = matchingRootBone != null ? matchingRootBone : newArmature.transform; + t.bones = newBones; + Transform transform; + (transform = t.transform).SetParent(newParent); + transform.localPosition = Vector3.zero; + } + + } + private static Transform GetRootBoneByName(Component parentTransform, string name) + { + return parentTransform.GetComponentsInChildren().FirstOrDefault(transformChild => transformChild.name == name); + } + } +} + diff --git a/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticTextureBehaviour.cs b/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticTextureBehaviour.cs index fd0e46180..a4bdf288a 100644 --- a/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticTextureBehaviour.cs +++ b/Assets/Artists/Scripts/Entities/Cosmetic/CosmeticTextureBehaviour.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -18,7 +19,10 @@ namespace BITFALL.Entities.Cosmetic public override void OnAwake() { if (_cosmeticService is not null) + { _cosmeticService.OnCosmeticsChanged += OnCosmeticsChanged; + destroyCancellationToken.Register(() => _cosmeticService.OnCosmeticsChanged -= OnCosmeticsChanged); + } } private void OnCosmeticsChanged() diff --git a/Assets/Artists/Scripts/Entities/Cosmetic/EntityCosmeticService.cs b/Assets/Artists/Scripts/Entities/Cosmetic/EntityCosmeticService.cs index 0fab0a5db..454c07807 100644 --- a/Assets/Artists/Scripts/Entities/Cosmetic/EntityCosmeticService.cs +++ b/Assets/Artists/Scripts/Entities/Cosmetic/EntityCosmeticService.cs @@ -13,24 +13,13 @@ using Object = UnityEngine.Object; namespace BITFALL.Entities.Cosmetic { - [CustomType(typeof(ICosmeticService))] - public class EntityCosmeticService : EntityBehavior,ICosmeticService + public class EntityCosmeticService : EntityBehavior { - [SerializeReference, SubclassSelector] private ISteamService steamService; - - public ICosmetic[] Cosmetics { get; private set; } - public event Action OnCosmeticsChanged; - public override async void OnStart() + [SerializeReference, SubclassSelector] private ICosmeticService cosmeticService; + public override void Initialize(IEntity _entity) { - base.OnStart();var items =await steamService.GetInventoryItemDefsAsync(destroyCancellationToken); - List cosmetics=new List(); - foreach (var x in items.Select(x=>YooAssets.LoadAssetAsync(x.AddressablePath) )) - { - x.WaitForAsyncComplete(); - cosmetics.Add(x.AssetObject as ICosmetic); - } - Cosmetics = cosmetics.ToArray(); - OnCosmeticsChanged?.Invoke(); + base.Initialize(_entity); + _entity.As().AddService(cosmeticService); } } } diff --git a/Assets/Artists/Scripts/UX/UXCosmetics.cs b/Assets/Artists/Scripts/UX/UXCosmetics.cs index 12e86cce4..06dc3add6 100644 --- a/Assets/Artists/Scripts/UX/UXCosmetics.cs +++ b/Assets/Artists/Scripts/UX/UXCosmetics.cs @@ -1,9 +1,11 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using BITFALL.Cosmetic; using BITKit; using BITKit.IO; +using BITKit.Modification; using BITKit.UX; using Cysharp.Threading.Tasks; using UnityEngine; @@ -29,20 +31,43 @@ namespace BITFALL.UX Rebuild(); } - private async void Rebuild() + private void Rebuild() { _cosmeticsContainer.Clear(); + + var modified = _cosmeticService.Modified.Values.ToArray(); foreach (var cosmetic in _cosmeticService.Cosmetics) { var assetHandle = YooAssets.LoadAssetAsync(cosmetic.AddressablePath); - await assetHandle; + assetHandle.WaitForAsyncComplete(); if(destroyCancellationToken.IsCancellationRequested) return; var so = assetHandle.AssetObject.As(); var instance =new UXContainer(_cosmeticsContainer.Create(cosmeticsTemplate)) ; instance.icon.style.backgroundImage = new StyleBackground(so.Icon); instance.contextLabel.text = so.name; + + if(modified.Contains(cosmetic)) + { + instance.visualElement.AddToClassList("--toggled"); + } + + instance.button.clicked += () => + { + try + { + _cosmeticService.Add(so.Type, cosmetic); + } + catch (NotRequireModifyException e) + { + Alert.Print("需要前置",e.Message); + } + catch (IncompatibleModifyException e) + { + Alert.Print("不兼容的修改",e.Message); + } + }; } } } diff --git a/Assets/BITFALL/Cosmetic/Cosmetic_Types.cs b/Assets/BITFALL/Cosmetic/Cosmetic_Types.cs new file mode 100644 index 000000000..31349f0d6 --- /dev/null +++ b/Assets/BITFALL/Cosmetic/Cosmetic_Types.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using BITKit.Modification; + +namespace BITFALL.Cosmetic.Types +{ + [Serializable] + public struct PlayerAgent:ICosmeticType + { + public IModifyElement[] Require => Array.Empty(); + public IModifyElement[] Incompatible => Array.Empty(); + } + [Serializable] + public struct PlayerWeaponSkin:ICosmeticType + { + public IModifyElement[] Require => Array.Empty(); + public IModifyElement[] Incompatible => Array.Empty(); + } +} diff --git a/Assets/BITFALL/Cosmetic/ICosmetic.cs b/Assets/BITFALL/Cosmetic/ICosmetic.cs index 5c51c5566..f67f72048 100644 --- a/Assets/BITFALL/Cosmetic/ICosmetic.cs +++ b/Assets/BITFALL/Cosmetic/ICosmetic.cs @@ -2,17 +2,15 @@ using System; using System.Collections; using System.Collections.Generic; using BITKit; +using BITKit.Modification; namespace BITFALL.Cosmetic { - public interface ICosmeticType + public interface ICosmeticType:IModifyElement { - /// - /// 排除的饰品类型 - /// - ICosmeticType[] Excludes { get; } } public interface ICosmeticContent{} + public interface ICosmetic:IAddressable { ulong Id { get; } @@ -20,7 +18,7 @@ namespace BITFALL.Cosmetic ICosmeticContent[] Contents { get; } } - public interface ICosmeticService + public interface ICosmeticService:IModifyManager { ICosmetic[] Cosmetics { get; } event Action OnCosmeticsChanged; diff --git a/Assets/BITKit/Core/Modification/IModification.cs b/Assets/BITKit/Core/Modification/IModification.cs index 5ac477afe..28746504f 100644 --- a/Assets/BITKit/Core/Modification/IModification.cs +++ b/Assets/BITKit/Core/Modification/IModification.cs @@ -65,7 +65,7 @@ namespace BITKit.Modification } public class ModifyManager : IModifyManager { - public virtual IDictionary Modifies { get;private set; } =new Dictionary(); + public virtual IDictionary Modifies { get; } =new Dictionary(); public virtual IDictionary Modified => new Dictionary(Modifies.Where(x=>x.Value is not null)); public virtual void Add(IModifyElement modify, object obj)