This commit is contained in:
CortexCore
2023-09-01 14:33:54 +08:00
parent 4fadd3a530
commit 8ef5c7ec0a
451 changed files with 1048940 additions and 2028 deletions

View File

@@ -28,22 +28,22 @@ MonoBehaviour:
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 4cf1920e287c0234f9fa77937708ffe2
m_Address: Weapon_Glock
m_Address: Assets/Weapon_Glock
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 5557f2edf7d8c4b43934c79878628d22
m_Address: Weapon_M4A1
m_Address: Assets/Weapon_M4A1
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 5ed1296c4cee5b542ae25542f7f39078
m_Address: Asset_AmmoBox
m_Address: Assets/Asset_AmmoBox
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: be94e0afa329e8540acffa49aea3087b
m_Address: Clip_NATO
m_Address: Assets/Clip_NATO
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
@@ -64,12 +64,22 @@ MonoBehaviour:
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 0aa8ba632b2bb3b4c992bae5b4a63d6c
m_Address: Items/Dev_Backpack
m_Address: Assets/Dev_Backpack
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 2f9bfcf37bf33a244ab1bb48a37f304a
m_Address: Items/Dev_BulletVest
m_Address: Assets/Dev_BulletVest
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 8a2e296f2c4fc694cbc3aaa9ab680cf2
m_Address: Assets/Apple
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: e4cc5e8ee168e3a4d90c60f342327839
m_Address: Assets/Artists/Arts/Icons/akar-icons_file.png
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

View File

@@ -771,25 +771,25 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Jump
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: IsGrounded
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Aiming
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@@ -806,7 +806,7 @@ AnimatorController:
- serializedVersion: 5
m_Name: Additive 0
m_StateMachine: {fileID: -5623997194552822566}
m_Mask: {fileID: 0}
m_Mask: {fileID: 31900000, guid: 0bc0f34d7e29eca428dd743f0d97288b, type: 2}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 1
@@ -907,7 +907,7 @@ AnimatorStateTransition:
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: "\u5F39\u836F\u76D2"
description: "\u9002\u7528\u4E8E\u6240\u6709\u7C7B\u578B\u7684\u6B66\u5668"
adressablePath: Asset_AmmoBox
addressablePath: Assets/Asset_AmmoBox
prefab: {fileID: 60270663480789379, guid: 08bf595b66a0f9347973cbccd7039436, type: 3}
squareIcon: {fileID: 2800000, guid: cd23c6e3d5938814e920000f85cc585e, type: 3}
rectangleIcon: {fileID: 2800000, guid: cd23c6e3d5938814e920000f85cc585e, type: 3}
@@ -26,12 +26,12 @@ MonoBehaviour:
version: 2
RefIds:
- rid: 749940167810482191
type: {class: Cellable, ns: BITFALL, asm: BITFall.Item}
type: {class: Cellable, ns: BITFALL, asm: BITFALL.Item}
data:
size:
x: 1
y: 1
- rid: 749940167810482192
type: {class: ItemWeight, ns: BITFALL, asm: BITFall.Item}
type: {class: ItemWeight, ns: BITFALL, asm: BITFALL.Item}
data:
Weight: 1

View File

@@ -0,0 +1,30 @@
%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: 1124c18d28c78f74cae355c518715ba3, type: 3}
m_Name: Apple
m_EditorClassIdentifier:
displayName: Apple
description: "\u5403\u7684,\u597D\u5403,\u76EE\u524D\u4E5F\u53EA\u6709\u8FD9\u4E2A\u5AB8"
addressablePath: Assets/Apple
prefab: {fileID: 8313153688960597523, guid: 373d78c28a8f6024cada3a296368b6c5, type: 3}
squareIcon: {fileID: 0}
rectangleIcon: {fileID: 0}
quality: 0
factoryProperties:
- rid: 6077775448293769231
references:
version: 2
RefIds:
- rid: 6077775448293769231
type: {class: ItemWeight, ns: BITFALL, asm: BITFALL.Item}
data:
Weight: 0.1

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: "NATO\u5F39\u5323"
description: "\u9002\u7528\u4E8E5.56mm\u7684\u5F39\u5323"
adressablePath: Clip_NATO
addressablePath: Assets/Clip_NATO
prefab: {fileID: 1408981566080299103, guid: c7d364eea8941e847b69eba0d43e22b6, type: 3}
squareIcon: {fileID: 2800000, guid: 43869a28a34f2ae43968725fae929f0d, type: 3}
rectangleIcon: {fileID: 0}
@@ -26,12 +26,12 @@ MonoBehaviour:
version: 2
RefIds:
- rid: 749940214065790976
type: {class: Cellable, ns: BITFALL, asm: BITFall.Item}
type: {class: Cellable, ns: BITFALL, asm: BITFALL.Item}
data:
size:
x: 1
y: 1
- rid: 749940214065790977
type: {class: ItemWeight, ns: BITFALL, asm: BITFall.Item}
type: {class: ItemWeight, ns: BITFALL, asm: BITFALL.Item}
data:
Weight: 0.64

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: "\u7231\u4E3D\u4E1D\u80CC\u5305"
description: "\u5F00\u53D1\u8005\u80CC\u5305\uFF0C\u8F7B\u91CD\u91CF\u5927\u5BB9\u91CF"
adressablePath: Items/Dev_Backpack
addressablePath: Assets/Dev_Backpack
prefab: {fileID: 2425374287570047597, guid: d35acde394701754dbb50a0f9421c492, type: 3}
squareIcon: {fileID: 2800000, guid: 097ab2237fb3e7140953d3294e1d5bec, type: 3}
rectangleIcon: {fileID: 0}

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: "\u9632\u5F39\u80CC\u5FC3"
description: "\u5F00\u53D1\u8005\u80CC\u5FC3\uFF0C\u53EF\u4EE5\u6302\u8F7D3\u4E2A\u63D2\u677F"
adressablePath: Items/Dev_BulletVest
addressablePath: Assets/Dev_BulletVest
prefab: {fileID: 5249032132350600647, guid: 405a2254073206e42bbe8aad0088a501, type: 3}
squareIcon: {fileID: 2800000, guid: 2dd35219362035945bb96be16ab9e60a, type: 3}
rectangleIcon: {fileID: 0}

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: Glock
description: "\u51FA\u5382\u4E3A\u534A\u81EA\u52A89mm\u624B\u67AA"
adressablePath: Weapon_Glock
addressablePath: Assets/Weapon_Glock
prefab: {fileID: 4632571640011753998, guid: bc90096cf6047474a8195137fb77e890, type: 3}
squareIcon: {fileID: 2800000, guid: ae3a3be8020e4e8448944df901ed45b3, type: 3}
rectangleIcon: {fileID: 2800000, guid: 7910edbea6bc88e49ac8a733f8f40238, type: 3}
@@ -22,6 +22,7 @@ MonoBehaviour:
factoryProperties:
- rid: 749940167810482195
- rid: 749940167810482196
- rid: 6077775441645010964
fireMode:
rid: 6077775426839904532
references:
@@ -43,3 +44,6 @@ MonoBehaviour:
fireRate: 3
brustRound: 3
burstFireInterval: 0.2
- rid: 6077775441645010964
type: {class: EquipmentAsWeapon, ns: BITFALL, asm: BITFALL.Entities.Equipment}
data:

View File

@@ -14,7 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayName: M4A1
description: "\u51FA\u5382\u4E3A5.56mm\u5168\u81EA\u52A8\u6B65\u67AA"
adressablePath: Weapon_M4A1
addressablePath: Assets/Weapon_M4A1
prefab: {fileID: 8489160005981420722, guid: 91b80a7cf885c984ea8d0d306d167dea, type: 3}
squareIcon: {fileID: 2800000, guid: 454ee622559369049b64a96fa6456fd2, type: 3}
rectangleIcon: {fileID: 2800000, guid: 8c4b3d8772ae2a54eaba9d401a095089, type: 3}
@@ -22,6 +22,8 @@ MonoBehaviour:
factoryProperties:
- rid: 749940214065790993
- rid: 749940214065790995
- rid: 6077775441645010963
- rid: 6077775445912715356
fireMode:
rid: 6077775426839904531
references:
@@ -41,3 +43,10 @@ MonoBehaviour:
type: {class: AutoFireMode, ns: BITFALL.Guns, asm: BITFALL.Equip}
data:
fireRate: 10
- rid: 6077775441645010963
type: {class: EquipmentAsWeapon, ns: BITFALL, asm: BITFALL.Entities.Equipment}
data:
- rid: 6077775445912715356
type: {class: VectorRecoil, ns: BITFALL.Guns, asm: BITFALL.Equip}
data:
recoil: {x: -1, y: 0.5, z: 0.5}

View File

@@ -0,0 +1,531 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!181963792 &2655988077585873504
Preset:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TextureImporter
m_TargetType:
m_NativeTypeID: 1006
m_ManagedTypePPtr: {fileID: 0}
m_ManagedTypeFallback:
m_Properties:
- target: {fileID: 0}
propertyPath: m_ExternalObjects.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_EnableMipMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_sRGBTexture
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_LinearTexture
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FadeOut
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_BorderMipMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapsPreserveCoverage
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaTestReferenceValue
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapFadeDistanceStart
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapFadeDistanceEnd
value: 3
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ConvertToNormalMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ExternalNormalMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_HeightScale
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_NormalMapFilter
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipGreenChannel
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IsReadable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_StreamingMipmaps
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_StreamingMipmapsPriority
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_VTOnly
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IgnoreMipmapLimit
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_GrayScaleToAlpha
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_GenerateCubemap
value: 6
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CubemapConvolution
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SeamlessCubemap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureFormat
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MaxTextureSize
value: 2048
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_FilterMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_Aniso
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_MipBias
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapU
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapV
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapW
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_NPOTScale
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Lightmap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteExtrude
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteMeshType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Alignment
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePixelsToUnits
value: 100
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteGenerateFallbackPhysicsShape
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaUsage
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaIsTransparency
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteTessellationDetail
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureType
value: 8
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureShape
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SingleChannelComponent
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipbookRows
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipbookColumns
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MaxTextureSizeSet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CompressionQualitySet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureFormatSet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IgnorePngGamma
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ApplyGammaDecoding
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Swizzle
value: 50462976
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CookieLightType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget
value: DefaultTexturePlatform
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget
value: Standalone
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_BuildTarget
value: Android
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_BuildTarget
value: Server
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Sprites.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Outline.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Bones.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_SpriteID
value: 5e97eb03825dee720800000000000000
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_InternalID
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Vertices.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Indices.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Edges.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Weights.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_SecondaryTextures.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_NameFileIdTable.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipmapLimitGroupName
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PSDRemoveMatte
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_UserData
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AssetBundleName
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AssetBundleVariant
value:
objectReference: {fileID: 0}
m_ExcludedProperties: []

View File

@@ -0,0 +1,531 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!181963792 &2655988077585873504
Preset:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SpriteImport
m_TargetType:
m_NativeTypeID: 1006
m_ManagedTypePPtr: {fileID: 0}
m_ManagedTypeFallback:
m_Properties:
- target: {fileID: 0}
propertyPath: m_ExternalObjects.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_EnableMipMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_sRGBTexture
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_LinearTexture
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FadeOut
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_BorderMipMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapsPreserveCoverage
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaTestReferenceValue
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapFadeDistanceStart
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipMapFadeDistanceEnd
value: 3
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ConvertToNormalMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ExternalNormalMap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_HeightScale
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_NormalMapFilter
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipGreenChannel
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IsReadable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_StreamingMipmaps
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_StreamingMipmapsPriority
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_VTOnly
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IgnoreMipmapLimit
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_GrayScaleToAlpha
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_GenerateCubemap
value: 6
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CubemapConvolution
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SeamlessCubemap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureFormat
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MaxTextureSize
value: 2048
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_FilterMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_Aniso
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_MipBias
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapU
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapV
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureSettings.m_WrapW
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_NPOTScale
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Lightmap
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteExtrude
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteMeshType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Alignment
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpritePixelsToUnits
value: 100
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteBorder.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteGenerateFallbackPhysicsShape
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaUsage
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AlphaIsTransparency
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteTessellationDetail
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureType
value: 8
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureShape
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SingleChannelComponent
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipbookRows
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_FlipbookColumns
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MaxTextureSizeSet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CompressionQualitySet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TextureFormatSet
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_IgnorePngGamma
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ApplyGammaDecoding
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Swizzle
value: 50462976
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_CookieLightType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget
value: DefaultTexturePlatform
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[0].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget
value: Standalone
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[1].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_BuildTarget
value: Android
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[2].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_BuildTarget
value: Server
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_MaxTextureSize
value: 64
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_ResizeAlgorithm
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_TextureFormat
value: -1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_TextureCompression
value: 1
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_CompressionQuality
value: 50
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_CrunchedCompression
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_AllowsAlphaSplitting
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_Overridden
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_IgnorePlatformSupport
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_AndroidETC2FallbackOverride
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PlatformSettings.Array.data[3].m_ForceMaximumCompressionQuality_BC6H_BC7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Sprites.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Outline.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Bones.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_SpriteID
value: 5e97eb03825dee720800000000000000
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_InternalID
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Vertices.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Indices.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Edges.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_Weights.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_SecondaryTextures.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SpriteSheet.m_NameFileIdTable.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_MipmapLimitGroupName
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_PSDRemoveMatte
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_UserData
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AssetBundleName
value:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_AssetBundleVariant
value:
objectReference: {fileID: 0}
m_ExcludedProperties: []

View File

@@ -0,0 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!319 &31900000
AvatarMask:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EquipAdditiveMask
m_Mask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
m_Elements:
- m_Path:
m_Weight: 1
- m_Path: FPS_ArmaTure
m_Weight: 0
- m_Path: FPS_ArmaTure/FPS_Camera
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Left_Shoulder
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Left_Shoulder/FPS_Left_UpperArm
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Left_Shoulder/FPS_Left_UpperArm/FPS_Left_LowerArm
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Left_Shoulder/FPS_Left_UpperArm/FPS_Left_LowerArm/FPS_Left_Hand
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Left_Shoulder/FPS_Left_UpperArm/FPS_Left_LowerArm/FPS_Left_Hand/FPS_Left_Root
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Right_Shoulder
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Right_Shoulder/FPS_Right_UpperArm
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Right_Shoulder/FPS_Right_UpperArm/FPS_Right_LowerArm
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Right_Shoulder/FPS_Right_UpperArm/FPS_Right_LowerArm/FPS_Right_Hand
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Right_Shoulder/FPS_Right_UpperArm/FPS_Right_LowerArm/FPS_Right_Hand/FPS_Right_Root
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Weapon_Magazine
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Weapon_Magazine_Sec
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Weapon_Root
m_Weight: 1
- m_Path: FPS_ArmaTure/FPS_Weapon_Root/FPS_AimPoint
m_Weight: 0
- m_Path: FPS_ArmaTure/FPS_Weapon_Root/FPS_Weapon_Bolt
m_Weight: 0
- m_Path: M4_8
m_Weight: 0
- m_Path: M4_8/M4_Optic_01
m_Weight: 0
- m_Path: M4_8/M4_Optic_02
m_Weight: 0
- m_Path: M4_8/M4_Optic_03
m_Weight: 0
- m_Path: M4_8/M4_Optic_04
m_Weight: 0
- m_Path: M4_8/M4_Optic_05
m_Weight: 0
- m_Path: M4_8/M4_Optic_06
m_Weight: 0
- m_Path: M4_8/M4_Optic_07
m_Weight: 0
- m_Path: M4_8/M4_Optic_08
m_Weight: 0
- m_Path: Mesh_Arm
m_Weight: 0
- m_Path: Mesh_Arm_Slim
m_Weight: 0

View File

@@ -45,3 +45,9 @@ AnimatorOverrideController:
- m_OriginalClip: {fileID: 7400000, guid: 00d8a0f68533b9b4192a7c6d473d591f, type: 2}
m_OverrideClip: {fileID: -3784128091923313851, guid: 1ce161a4d1dd40c4fa95801c98f74a9a,
type: 3}
- m_OriginalClip: {fileID: 7400000, guid: 2a2012ea7f7e0e042ac7ede06063b02b, type: 2}
m_OverrideClip: {fileID: 4080960951410847890, guid: 1ce161a4d1dd40c4fa95801c98f74a9a,
type: 3}
- m_OriginalClip: {fileID: 7400000, guid: 77284660b64f8b747a959381bd306474, type: 2}
m_OverrideClip: {fileID: 4080960951410847890, guid: 1ce161a4d1dd40c4fa95801c98f74a9a,
type: 3}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,197 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7228637743355734416
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1536248110091890728}
- component: {fileID: 2486184499613721321}
- component: {fileID: 6587314398399098282}
m_Layer: 10
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1536248110091890728
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228637743355734416}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.16, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5208964436538694514}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2486184499613721321
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228637743355734416}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 9191ebffef8c77c4690899c5c64eec2c, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 1847463989, guid: a03c2610221b14940b818fb271b448fa, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 1
m_Size: {x: 0.32, y: 0.32}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!65 &6587314398399098282
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228637743355734416}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.32, y: 0.32, z: 0.2}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &8313153689434553364
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2084569607, guid: d8b5a76c92d6b3a4592b14e21ad018c0, type: 3}
propertyPath: asset
value:
objectReference: {fileID: 11400000, guid: 8a2e296f2c4fc694cbc3aaa9ab680cf2,
type: 2}
- target: {fileID: 4258070653194797568, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_Icon
value:
objectReference: {fileID: -5442936267250999957, guid: 0000000000000000d000000000000000,
type: 0}
- target: {fileID: 4258070653194797568, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_Name
value: Apple
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalPosition.x
value: 1.201
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.328
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4258070653194797575, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4258070652695701350, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
insertIndex: -1
addedObject: {fileID: 1536248110091890728}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d8b5a76c92d6b3a4592b14e21ad018c0, type: 3}
--- !u!4 &5208964436538694514 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4258070652695701350, guid: d8b5a76c92d6b3a4592b14e21ad018c0,
type: 3}
m_PrefabInstance: {fileID: 8313153689434553364}
m_PrefabAsset: {fileID: 0}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -279,6 +279,64 @@ MonoBehaviour:
detectLayer:
serializedVersion: 2
m_Bits: 512
--- !u!1 &842760063283004380
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5292556015733965988}
- component: {fileID: 2959116518108072906}
m_Layer: 0
m_Name: playerAvatar-image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5292556015733965988
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 842760063283004380}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1868127212333961775}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2959116518108072906
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 842760063283004380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0864e489ffa52240821dff61c1e5f5c, type: 3}
m_Name:
m_EditorClassIdentifier:
document: {fileID: 5757643392578433631}
bindName:
bindNameProvider:
rid: 6077775449957859527
lerpPosition:
allow: 0
value: 0
references:
version: 2
RefIds:
- rid: 6077775449957859527
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 842760063283004380}
--- !u!1 &1883062383340693149
GameObject:
m_ObjectHideFlags: 0
@@ -559,6 +617,122 @@ MonoBehaviour:
- rid: 6077775219685064706
type: {class: MonoKcpClientSingleton, ns: BITKit.Net.Kcp, asm: BITKit.NetProvider.Kcp}
data:
--- !u!1 &3710001671762204080
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6601483182092177668}
- component: {fileID: 5156887789142102549}
m_Layer: 0
m_Name: SurvivalBuilder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6601483182092177668
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3710001671762204080}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1868127212333961775}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5156887789142102549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3710001671762204080}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ed1d829d047e89341a40e33c5651e792, type: 3}
m_Name:
m_EditorClassIdentifier:
visualElementProvider:
rid: 6077775449957859858
visualTreeAsset: {fileID: 9197481963319205126, guid: b75c1744172f96e4cb694204bfd48b98,
type: 3}
clearOnStart: 1
references:
version: 2
RefIds:
- rid: 6077775449957859858
type: {class: GetVisualElementFromUIDocument, ns: , asm: BITKit.UX}
data:
document: {fileID: 5757643392578433631}
path: survival-container
--- !u!1 &3757054412361474464
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8053823424171020504}
- component: {fileID: 3634826882621984808}
m_Layer: 0
m_Name: playerName-label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8053823424171020504
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3757054412361474464}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1868127212333961775}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3634826882621984808
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3757054412361474464}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0261cd9eafc784c9d4cc6a24ea6886, type: 3}
m_Name:
m_EditorClassIdentifier:
document: {fileID: 5757643392578433631}
bindName:
bindNameProvider:
rid: 6077775449957859386
format:
rid: -2
references:
version: 2
RefIds:
- rid: -2
type: {class: , ns: , asm: }
- rid: 6077775449957859386
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 3757054412361474464}
--- !u!1 &3982569034385566475
GameObject:
m_ObjectHideFlags: 0
@@ -650,6 +824,64 @@ MonoBehaviour:
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 4004880636636882820}
--- !u!1 &4166297020893267887
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1174047807460664031}
- component: {fileID: 7197977614289111421}
m_Layer: 0
m_Name: crosshair-image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1174047807460664031
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4166297020893267887}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1868127212333961775}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7197977614289111421
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4166297020893267887}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0864e489ffa52240821dff61c1e5f5c, type: 3}
m_Name:
m_EditorClassIdentifier:
document: {fileID: 5757643392578433631}
bindName:
bindNameProvider:
rid: 6077775445912715318
lerpPosition:
allow: 0
value: 0
references:
version: 2
RefIds:
- rid: 6077775445912715318
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 4166297020893267887}
--- !u!1 &4194669936323273822
GameObject:
m_ObjectHideFlags: 0
@@ -664,6 +896,7 @@ GameObject:
- component: {fileID: 807107954657273499}
- component: {fileID: 1471813233237706529}
- component: {fileID: 2655126492240795381}
- component: {fileID: 8688891611846657049}
m_Layer: 0
m_Name: HUD
m_TagString: Untagged
@@ -689,6 +922,11 @@ Transform:
- {fileID: 215147666360424541}
- {fileID: 2543285851305646214}
- {fileID: 2194744020554206530}
- {fileID: 1174047807460664031}
- {fileID: 8053823424171020504}
- {fileID: 5292556015733965988}
- {fileID: 8643080168626239556}
- {fileID: 6601483182092177668}
m_Father: {fileID: 5885585653203836409}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5757643392578433631
@@ -731,6 +969,12 @@ MonoBehaviour:
rid: 6077775219685064717
playerService:
rid: 6077775405181829458
steamService:
rid: 6077775449957859446
crosshairImage: {fileID: 7197977614289111421}
playerNameLabel: {fileID: 3634826882621984808}
playerAvatarImage: {fileID: 2959116518108072906}
healthBar: {fileID: 5395886693158660034}
inventoryAction: {fileID: 4731022410478041803, guid: e0e9267cab824e8489fc27d83f1d07b7,
type: 3}
returnAction: {fileID: 7656137919724235468, guid: e0e9267cab824e8489fc27d83f1d07b7,
@@ -751,6 +995,9 @@ MonoBehaviour:
- rid: 6077775405181829458
type: {class: UnityPlayerServiceService, ns: BITKit.Entities.Player, asm: BITKit.Entities.Player}
data:
- rid: 6077775449957859446
type: {class: SteamServiceSingleton, ns: BITKit.Steamwork, asm: BITKit.Extension.Steamwork}
data:
--- !u!114 &807107954657273499
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -837,6 +1084,56 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
dialogueBuilder: {fileID: 7594065398024844307}
--- !u!114 &8688891611846657049
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4194669936323273822}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b0fdae2669e6db438a8f53e0bd359c4, type: 3}
m_Name:
m_EditorClassIdentifier:
playerService:
rid: 6077775449957859681
survivalEventIcons:
reorderableList:
canAdd: 1
canRemove: 1
draggable: 1
expandable: 1
multipleSelection: 1
isExpanded: 1
label:
m_Text: Keys
m_Image: {fileID: 0}
m_Tooltip:
headerHeight: 18
footerHeight: 13
slideEasing: 0.15
verticalSpacing: 2
showDefaultBackground: 1
elementDisplayType: 0
elementNameProperty:
elementNameOverride:
elementIcon: {fileID: 0}
reqReferences: {fileID: 0}
isExpanded: 1
_keyValues:
- PlayerFeelHungryEvent
_keys:
- PlayerFeelHungryEvent
_values:
- {fileID: 21300000, guid: a928ab2792f614544a3190c83422940d, type: 3}
survivalEventBuilder: {fileID: 5156887789142102549}
references:
version: 2
RefIds:
- rid: 6077775449957859681
type: {class: UnityPlayerServiceService, ns: BITKit.Entities.Player, asm: BITKit.Entities.Player}
data:
--- !u!1 &4420906603671594769
GameObject:
m_ObjectHideFlags: 0
@@ -1474,6 +1771,64 @@ MonoBehaviour:
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 6448343566641602063}
--- !u!1 &6711143963358785264
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8643080168626239556}
- component: {fileID: 5395886693158660034}
m_Layer: 0
m_Name: health-bar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8643080168626239556
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6711143963358785264}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1868127212333961775}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5395886693158660034
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6711143963358785264}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: de67752b421e2a842b0407b2c6c524a9, type: 3}
m_Name:
m_EditorClassIdentifier:
document: {fileID: 5757643392578433631}
bindName:
bindNameProvider:
rid: 6077775449957859632
fillElementName: health-fill
labelName:
onValueChanged: {fileID: 0}
references:
version: 2
RefIds:
- rid: 6077775449957859632
type: {class: GetNameFromGameobject, ns: BITKit, asm: BITKit}
data:
gameobject: {fileID: 6711143963358785264}
--- !u!1 &6889660229198782737
GameObject:
m_ObjectHideFlags: 0

View File

@@ -1357,7 +1357,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh456478
m_Name: pb_Mesh96614
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
@@ -1574,6 +1574,16 @@ PlayableDirector:
value: {fileID: 458258643}
- key: {fileID: -465851578319353773, guid: 5ee6924dcf60bd04e9f1813b09d95934, type: 2}
value: {fileID: 652830789}
- key: {fileID: -6926066952972113523, guid: c6b694ff97ce344178e5579e393c3b55, type: 2}
value: {fileID: 0}
- key: {fileID: 990281625074865129, guid: c6b694ff97ce344178e5579e393c3b55, type: 2}
value: {fileID: 0}
- key: {fileID: 4864578706283051154, guid: c6b694ff97ce344178e5579e393c3b55, type: 2}
value: {fileID: 0}
- key: {fileID: -8004734514555262890, guid: c6b694ff97ce344178e5579e393c3b55, type: 2}
value: {fileID: 0}
- key: {fileID: -6925956535159640983, guid: c6b694ff97ce344178e5579e393c3b55, type: 2}
value: {fileID: 0}
m_ExposedReferences:
m_References:
- c5db20a59cc453f4394d9d2c4d8c3b70: {fileID: 1191232660}
@@ -5662,7 +5672,7 @@ Light:
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Color: {r: 1, g: 0.84249014, b: 0.6194968, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
@@ -6322,7 +6332,7 @@ ConfigurableJoint:
m_Anchor: {x: 0, y: 0, z: 0}
m_Axis: {x: 0, y: 0, z: 1}
m_AutoConfigureConnectedAnchor: 1
m_ConnectedAnchor: {x: 0, y: 0, z: 0}
m_ConnectedAnchor: {x: 0.5, y: 1, z: 0.00000010430813}
serializedVersion: 3
m_SecondaryAxis: {x: 0, y: -1, z: 0}
m_XMotion: 0
@@ -6990,7 +7000,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh456638
m_Name: pb_Mesh96782
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
@@ -7743,6 +7753,132 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1514697182}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1582158920
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1925474056}
m_Modifications:
- target: {fileID: 1000013552779140, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_Name
value: FAE_Birch_C
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalPosition.x
value: -0.24
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalPosition.z
value: -3.11
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e70352c946d2d3249b00e9e0a8b5a18f, type: 3}
--- !u!4 &1582158921 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4000011386335912, guid: e70352c946d2d3249b00e9e0a8b5a18f,
type: 3}
m_PrefabInstance: {fileID: 1582158920}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1609632047
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1925474056}
m_Modifications:
- target: {fileID: 1000010151976528, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_Name
value: FAE_Birch_A
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalPosition.x
value: 8
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalPosition.z
value: 20.57
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ca0f87d8635ce0940b7441781fb4354d, type: 3}
--- !u!4 &1609632048 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4000012308464578, guid: ca0f87d8635ce0940b7441781fb4354d,
type: 3}
m_PrefabInstance: {fileID: 1609632047}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1627698884
PrefabInstance:
m_ObjectHideFlags: 0
@@ -7984,7 +8120,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh456424
m_Name: pb_Mesh96560
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
@@ -8568,7 +8704,7 @@ GameObject:
- component: {fileID: 1719111405}
- component: {fileID: 1719111404}
- component: {fileID: 1719111403}
- component: {fileID: 1719111402}
- component: {fileID: 1719111408}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
@@ -8576,28 +8712,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1719111402
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1719111401}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 2126617787}
--- !u!33 &1719111403
MeshFilter:
m_ObjectHideFlags: 10
@@ -8761,6 +8875,27 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1719111408
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1719111401}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 128, y: 1, z: 128}
m_Center: {x: 0, y: -0.5, z: 0}
--- !u!1001 &1720213259
PrefabInstance:
m_ObjectHideFlags: 0
@@ -8980,7 +9115,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh456310
m_Name: pb_Mesh96446
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
@@ -9985,6 +10120,39 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1905884386}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1925474055
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1925474056}
m_Layer: 0
m_Name: Trees
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1925474056
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1925474055}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1609632048}
- {fileID: 1582158921}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1931676783
GameObject:
m_ObjectHideFlags: 0
@@ -10762,7 +10930,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh456598
m_Name: pb_Mesh96742
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
@@ -11010,6 +11178,74 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 2126687261}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1914222447235403095
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalPosition.x
value: 1.201
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.328
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230547, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5208964437046230548, guid: 373d78c28a8f6024cada3a296368b6c5,
type: 3}
propertyPath: m_Name
value: Apple
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 373d78c28a8f6024cada3a296368b6c5, type: 3}
--- !u!1001 &2425374285907649514
PrefabInstance:
m_ObjectHideFlags: 0
@@ -11483,6 +11719,41 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.1918617
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.0018899199
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.8510052
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.015195422
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9145987
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.11334949
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.37962088
objectReference: {fileID: 0}
- target: {fileID: 85721843617816292, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.08092654
objectReference: {fileID: 0}
- target: {fileID: 113874361343648219, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
@@ -11583,6 +11854,41 @@ PrefabInstance:
propertyPath: m_TranslationOffset.z
value: 0.012756309
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.1527913
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.26840544
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.041788533
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.17242832
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.98013526
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.08648837
objectReference: {fileID: 0}
- target: {fileID: 460083464761868110, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.046078023
objectReference: {fileID: 0}
- target: {fileID: 469913181637463014, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalScale.x
@@ -11788,6 +12094,41 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.0000000044671276
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.09939362
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.5617244
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.008431543
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.05269634
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.9937906
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.09142351
objectReference: {fileID: 0}
- target: {fileID: 956056861685729981, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.035286482
objectReference: {fileID: 0}
- target: {fileID: 1076462947551464588, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
@@ -12003,6 +12344,76 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.09939383
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.54760975
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.008431662
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.27092564
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.9571946
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.09777302
objectReference: {fileID: 0}
- target: {fileID: 1712324522885090642, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.028603401
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.2605614
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.9479
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.032636464
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.10138736
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.93987143
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.2482225
objectReference: {fileID: 0}
- target: {fileID: 1839138478267618740, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.21153715
objectReference: {fileID: 0}
- target: {fileID: 1900724397543821185, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalScale.x
@@ -12293,6 +12704,76 @@ PrefabInstance:
propertyPath: m_LocalRotation.x
value: -0.000000091062326
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.08022162
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.8550662
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.35822827
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.8118847
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.35492504
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.18293753
objectReference: {fileID: 0}
- target: {fileID: 2803847597504609806, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.425917
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.14346394
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.95973057
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.19996995
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.48117894
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.74403995
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.082495645
objectReference: {fileID: 0}
- target: {fileID: 2917424819654314717, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.4561425
objectReference: {fileID: 0}
- target: {fileID: 3572666081026620015, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalScale.x
@@ -12503,6 +12984,31 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.016139772
objectReference: {fileID: 0}
- target: {fileID: 4009095720910715365, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.554667
objectReference: {fileID: 0}
- target: {fileID: 4009095720910715365, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9899334
objectReference: {fileID: 0}
- target: {fileID: 4009095720910715365, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.13038565
objectReference: {fileID: 0}
- target: {fileID: 4009095720910715365, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.037245184
objectReference: {fileID: 0}
- target: {fileID: 4009095720910715365, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.040550858
objectReference: {fileID: 0}
- target: {fileID: 4209372041148271106, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
@@ -12708,6 +13214,41 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.075196505
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.2378029
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.045909792
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9911512
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.12554103
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.04181223
objectReference: {fileID: 0}
- target: {fileID: 4440202003842208640, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.010508939
objectReference: {fileID: 0}
- target: {fileID: 4511771577866463022, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
@@ -12928,6 +13469,16 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5718097820043900847, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_RotationOffsets.Array.data[0].x
value: -89.89347
objectReference: {fileID: 0}
- target: {fileID: 5718097820043900847, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_TranslationOffsets.Array.data[0].y
value: 0.00015735626
objectReference: {fileID: 0}
- target: {fileID: 5788104773034667456, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
@@ -13633,6 +14184,41 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.15089647
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.2973858
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.16570646
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.038680177
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.9940453
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.10182511
objectReference: {fileID: 0}
- target: {fileID: 7734584599835782988, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.003066969
objectReference: {fileID: 0}
- target: {fileID: 7758957989235148313, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
@@ -14083,6 +14669,41 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: -0.21153733
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.34530127
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.7766577
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.026483178
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.73628116
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.59289753
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.025940448
objectReference: {fileID: 0}
- target: {fileID: 9175542953188611721, guid: e5d265393747af741b4f5d719598831a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.32509947
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -14874,6 +15495,7 @@ SceneRoots:
- {fileID: 1051082603}
- {fileID: 1088320173}
- {fileID: 1072987174}
- {fileID: 1925474056}
- {fileID: 1671777019}
- {fileID: 1719111407}
- {fileID: 106239822}
@@ -14896,6 +15518,7 @@ SceneRoots:
- {fileID: 2425374285907649514}
- {fileID: 8632843647696640073}
- {fileID: 7157496438664238644}
- {fileID: 1914222447235403095}
- {fileID: 835177942}
- {fileID: 1636127570}
- {fileID: 1677499543}

View File

@@ -5,14 +5,15 @@ using Unity.Mathematics;
using BITKit;
using System.IO;
using System;
// ReSharper disable UnassignedField.Global
namespace BITFALL
{
[Serializable]
public record ItemWeight : IProperty
{
public float Weight=1;
public static implicit operator float(ItemWeight self)
public double Weight=1;
public static implicit operator double(ItemWeight self)
{
return self.Weight;
}
@@ -31,49 +32,49 @@ namespace BITFALL
{
#region
[Header(Constant.Header.Settings)]
[SerializeField] string displayName;
[SerializeField] string description;
[SerializeField] string adressablePath;
[SerializeField] WorldableItem prefab;
[SerializeField] Texture2D squareIcon;
[SerializeField] Texture2D rectangleIcon;
[SerializeField] ItemQuality quality;
[SerializeField] private string displayName;
[SerializeField] private string description;
[SerializeField] private string addressablePath;
[SerializeField] private WorldableItem prefab;
[SerializeField] private Texture2D squareIcon;
[SerializeField] private Texture2D rectangleIcon;
[SerializeField] private ItemQuality quality;
[Header(Constant.Header.Property)]
[SerializeReference, SubclassSelector] public IProperty[] factoryProperties;
Property property => new(factoryProperties);
private Property property => new(factoryProperties);
#endregion
#region
public int Id => -1;
public ItemQuality Quality => quality;
public string Name => displayName;
public string Description => description;
public string AdressablePath => adressablePath;
public string AddressablePath => addressablePath;
public bool Contains<T>() => property.Contains<T>();
public T GetOrAddProperty<T>(Func<T> addFactory) =>throw new NotImplementedException("资产不支持动态更改");
public T GetOrCreateProperty<T>() => throw new NotImplementedException("资产不支持动态更改");
public object[] GetProperties() => property.GetProperties();
public bool TryGetProperty<T>(out T value) => property.TryGetProperty(out value);
public bool TryRemoveProperty<T>() => throw new NotImplementedException("资产不支持动态更改");
public bool TrySetProperty<T>(T value) => throw new NotImplementedException();
public bool TrySetProperty<T>(T value) => throw new NotImplementedException("资产不支持动态更改");
public void Read(BinaryReader r)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public void Write(BinaryWriter w)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool CopyItemsFrom(IBasicItem item)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool ClearProperties()
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool CopyPropertiesFrom(IPropertable propertable)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
#endregion
#region

View File

@@ -10,7 +10,7 @@ namespace BITKit
{
public static AssetableItem GetAssetable(this IBasicItem self)
{
return Addressables.LoadAssetAsync<AssetableItem>(self.AdressablePath).WaitForCompletion();
return Addressables.LoadAssetAsync<AssetableItem>(self.AddressablePath).WaitForCompletion();
}
}
}

View File

@@ -21,7 +21,7 @@ namespace BITFALL
public string Name => asset.name;
public string Description => asset.Description;
public ItemQuality Quality => asset.Quality;
public string AdressablePath => asset.AdressablePath;
public string AddressablePath => asset.AddressablePath;
private readonly Property property = new();
public bool Contains<T>() => property.Contains<T>();
@@ -50,7 +50,7 @@ namespace BITFALL
{
if(item is SerializableItem serializableItem)
{
asset = Addressables.LoadAssetAsync<AssetableItem>(item.AdressablePath).WaitForCompletion();
asset = Addressables.LoadAssetAsync<AssetableItem>(item.AddressablePath).WaitForCompletion();
}
return true;
}

View File

@@ -1,5 +1,5 @@
{
"name": "BITFALL.Entities.Core.EquipSelector",
"name": "BITFALL.Entities.EquipSelector",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
using BITKit.Entities;
using UnityEngine.InputSystem;
using static UnityEditor.Progress;
using System.Diagnostics;
using System.Linq;
namespace BITFALL
{
/// <summary>
/// 玩家装备选择器接口
/// </summary>
public interface IPlayerEquipSelector
{
event Action<IBasicItem> OnEquip;
event Action<IBasicItem> OnDeEquip;
event Action<IDictionary<int, IBasicItem>> OnUpdateEquip;
bool TryDeEquip(IBasicItem item);
}
}

View File

@@ -1,196 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
using BITKit.Entities;
using UnityEngine.InputSystem;
using static UnityEditor.Progress;
using System.Diagnostics;
using System.Linq;
namespace BITFALL
{
public interface IEquipSelectorCallback
{
void OnEquip(IBasicItem item);
void OnDeEquip(IBasicItem item);
void OnUpdateEquip(IDictionary<int,IBasicItem> maps);
}
public class PlayerEquipSelector : EntityComponent,IExcutor<IBasicItem>,IEntityInventoryCallback
{
[Header(Constant.Header.Input)]
public InputActionReference primaryAction;
public InputActionReference secondaryAction;
public InputActionReference tertiaryAction;
public InputActionReference quaternaryAction;
public InputActionReference holsterAction;
public InputActionGroup inputActionGroup;
[Header(Constant.Header.Components)]
public EntityEquipment equipment;
[Header(Constant.Header.InternalVariables)]
private readonly Dictionary<int, IBasicItem> equips=new();
private IBasicItemContainer inventory;
public override void OnAwake()
{
var health = entity.Get<IHealth>();
health.OnSetAlive += OnSetAlive;
}
public override void OnStart()
{
base.OnStart();
inputActionGroup.RegisterCallback(primaryAction, OnPrimary);
inputActionGroup.RegisterCallback(secondaryAction, OnSecondary);
inputActionGroup.RegisterCallback(tertiaryAction, OnMelee);
inputActionGroup.RegisterCallback(holsterAction, OnHolster);
entity.RegisterCallback<IExcutor<IBasicItem>>(this);
inventory = entity.Get<IBasicItemContainer>();
}
public void OnPrimary(InputAction.CallbackContext context)
{
if (!context.started) return;
TryEquip(1);
}
public void OnSecondary(InputAction.CallbackContext context)
{
if (!context.started) return;
TryEquip(2);
}
public void OnMelee(InputAction.CallbackContext context)
{
if (TryEquip(3))
{
}
else
{
TryEquip(-1);
}
}
public void OnTertiary(InputAction.CallbackContext context)
{
TryEquip(4);
}
void OnHolster(InputAction.CallbackContext context)
{
TryEquip(-1);
}
public void OnPlayerInitialized()
{
inputActionGroup.allowInput.SetElements(this, true);
}
public void OnPlayerDispose()
{
inputActionGroup.allowInput.SetElements(this, false);
}
private void OnSetAlive(bool alive)
{
inputActionGroup.allowInput.SetElements(nameof(IHealthCallback), alive);
if (alive) return;
foreach (var x in equips.ToArray())
{
inventory.Add(x.Value);
}
equips.Clear();
TryEquip(-1);
}
public bool TryExecute(IBasicItem value)
{
var asset = value.GetAssetable();
if (IsSupportItem(value) is false) return false;
var i = 1;
var length = 4;
if (value.TryGetProperty<EquipmentAsEquip>(out _))
{
i = 1;
length = 2;
}
else if (value.TryGetProperty<EquipmentAsMelee>(out _))
{
i = 3;
length = 3;
}else if (value.TryGetProperty<EquipmentAsHeal>(out _))
{
i = 4;
length = 4;
}
for (; i <=length; i++)
{
if (equips.ContainsKey(i) is true) continue;
equips.Add(i, value);
if (equips.ContainsKey(0) is true) return true;
Equip(value);
UpdateEquiped();
return true;
}
return false;
}
private bool TryEquip(int index)
{
if (equips.TryGetValue(index, out var equip))
{
Equip(equip);
return true;
}
else if (index is -1)
{
equips.TryRemove(0);
Equip(null);
return true;
}
else
{
return false;
}
}
private void Equip(IBasicItem item)
{
var index = equipment.equips.list.FindIndex(x => x?.AddressablePath == item?.AdressablePath);
if (equips.TryGetValue(0, out var equipd))
{
entity.GetCallbacks<IEquipSelectorCallback>().ForEach(x => x.OnDeEquip(equipd));
}
if (index is -1)
{
equips.TryRemove(0);
equipment.equips.Entry(index);
}
else
{
entity.GetCallbacks<IEquipSelectorCallback>().ForEach(x => x.OnEquip(item));
equips.Insert(0,item);
equipment.equips.Entry(index);
}
UpdateEquiped();
}
public void OnAdd(IBasicItem item)
{
}
public void OnRemove(IBasicItem item)
{
if (IsSupportItem(item) is false)
{
UpdateEquiped();
}
}
private bool IsSupportItem(IBasicItem item)
{
return equipment.equips.list.FindIndex(x => x.AddressablePath == item.AdressablePath) is not -1;
}
void UpdateEquiped()
{
foreach (var x in entity.GetCallbacks<IEquipSelectorCallback>())
{
x.OnUpdateEquip(new Dictionary<int, IBasicItem>(equips));
}
}
}
}

View File

@@ -41,74 +41,60 @@ namespace BITFALL
public event Action<IBasicItem> OnSet;
public event Action<IBasicItem> OnDrop;
public event Action<IBasicItemContainer> OnRebuild;
private CancellationToken _cancellationToken;
private IHealth _health;
public override void OnAwake()
{
_cancellationToken = entity.Get<CancellationToken>();
var health = entity.Get<IHealth>();
health.OnSetAlive += OnSetAlive;
_health = entity.Get<IHealth>();
_health.OnSetAlive += OnSetAlive;
}
private async void OnSetAlive(bool alive)
private void OnSetAlive(bool alive)
{
try
{
await UniTask.NextFrame(_cancellationToken);
await UniTask.NextFrame(_cancellationToken);
await UniTask.NextFrame(_cancellationToken);
foreach (var x in dictionary.Keys.ToArray())
if (alive) return;
foreach (var x in dictionary.Values.ToArray())
{
OnRemove?.Invoke(x);
Drop(x);
}
}
catch (OperationCanceledException)
{
}
dictionary.Clear();
}
public virtual bool Add(IBasicItem item)
{
var pars = new object[] { item };
if (AddFactory != null)
foreach (var x in AddFactory.GetInvocationList())
if (_health.IsAlive is false)
{
if (x.Method.Invoke(x.Target, pars) is false)
Drop(item);
return true;
}
if (AddFactory?.GetInvocationList().Cast<Func<IBasicItem, bool>>().Any(x => x.Invoke(item)) is false)
{
return false;
}
}
if (dictionary.TryAdd(item.Id, item))
if (!dictionary.TryAdd(item.Id, item)) return false;
{
OnAdd?.Invoke(item);
foreach (var x in entity.GetCallbacks<IEntityInventoryCallback>())
{
x.OnAdd(item);
}
return true;
}
else
{
return false;
}
}
public virtual IBasicItem[] GetItems() => dictionary.Values.ToArray();
public virtual bool Remove(IBasicItem item)
{
return Remove(item.Id);
}
public virtual bool Remove(int id)
{
if (dictionary.TryGetValue(id, out var item))
{
var pars = new object[] { item };
if (!dictionary.TryGetValue(id, out var item)) return false;
if (RemoveFactory is not null)
foreach (var x in RemoveFactory.GetInvocationList())
{
if (x.Method.Invoke(x.Target, pars) is false)
if (RemoveFactory.GetInvocationList().Cast<Func<IBasicItem,bool>>().Any(x => x.Invoke(item) is false))
{
return false;
}
}
dictionary.Remove(id);
foreach (var x in entity.GetCallbacks<IEntityInventoryCallback>())
{
@@ -117,11 +103,6 @@ namespace BITFALL
OnRemove?.Invoke(item);
return true;
}
else
{
return false;
}
}
public virtual bool Remove(Func<IBasicItem, bool> removeFactory)
{
@@ -141,17 +122,23 @@ namespace BITFALL
return dictionary.Values.TryGetAny(func, out item);
}
public bool Drop(int Id)
public bool Drop(int _Id)
{
if (!dictionary.TryGetValue(Id, out var item)) return false;
if (!dictionary.TryGetValue(_Id, out var item)) return false;
if (!Remove(item)) return false;
var pars = new object[] { item };
if (DropFactory is not null)
if (DropFactory.GetInvocationList().Any(x => x.Method.Invoke(x.Target, pars) is false))
if (DropFactory != null && DropFactory.GetInvocationList().Cast<Func<IBasicItem, bool>>()
.Any(x => x.Invoke(item) is false))
{
return false;
}
var prefab = Addressables.LoadAssetAsync<AssetableItem>(item.AdressablePath).WaitForCompletion();
Drop(item);
return true;
}
private void Drop(IBasicItem item)
{
OnDrop?.Invoke(item);
var prefab = Addressables.LoadAssetAsync<AssetableItem>(item.AddressablePath).WaitForCompletion();
var _transform = transform;
var position = _transform.position;
var rotation = _transform.rotation;
@@ -162,7 +149,6 @@ namespace BITFALL
}
var instance = Instantiate(prefab.GetPrefab(), position, rotation);
instance.CopyItemsFrom(item);
return true;
}
}
}

View File

@@ -1,24 +1,23 @@
using System;
using UnityEngine;
using BITKit;
using BITKit.Entities;
namespace BITFALL
{
public interface IWeightedCallback
public interface IPlayerInventoryWeightable
{
public void OnWeighted(float current, float max);
event Action<double,double> OnWeighted;
}
public class InventoryWeightable : EntityComponent,IPlayerEquipCallback
[CustomType(typeof(IPlayerInventoryWeightable))]
public class InventoryWeightable : EntityComponent,IPlayerInventoryWeightable
{
[Header(Constant.Header.Data)]
public float currentWeight;
public double currentWeight;
[Header(Constant.Header.Settings)]
public float maxWeight =8;
public double maxWeight =8;
[Header(Constant.Header.InternalVariables)]
IBasicItemContainer container;
private IBasicItemContainer container;
public override void OnStart()
{
base.OnStart();
@@ -27,37 +26,25 @@ namespace BITFALL
container.OnAdd += OnAdd;
container.OnRemove += OnRemove;
entity.RegisterCallback<IPlayerEquipCallback>(this);
var playerEquipContainer = entity.Get<IPlayerEquipContainer>();
playerEquipContainer.OnEquip += OnEquip;
playerEquipContainer.OnDeEquip += DeEquip;
}
private bool AddFactory(IBasicItem item)
{
var asset = item.GetAssetable();
if (asset.TryGetProperty<ItemWeight>(out var itemWeight))
{
if (currentWeight + itemWeight <= maxWeight)
{
}
else if (currentWeight + itemWeight > maxWeight)
{
return false;
}
}
return true;
if (!asset.TryGetProperty<ItemWeight>(out var itemWeight)) return true;
return currentWeight + itemWeight <= maxWeight;
}
private void OnAdd(IBasicItem item)
{
var asset = item.GetAssetable();
if (asset.TryGetProperty<ItemWeight>(out var itemWeight))
{
if (!asset.TryGetProperty<ItemWeight>(out var itemWeight)) return;
currentWeight += itemWeight;
InvokeCallback();
}
}
private void OnRemove(IBasicItem item)
{
var asset = item.GetAssetable();
@@ -67,29 +54,23 @@ namespace BITFALL
}
public void DeEquip(IEquipmentSlot slot, IBasicItem item)
{
if (item.GetAssetable().TryGetProperty<AddInventoryMaxWeight>(out var addWeight))
private void DeEquip(IEquipmentSlot slot, IBasicItem item)
{
if (!item.GetAssetable().TryGetProperty<AddInventoryMaxWeight>(out var addWeight)) return;
maxWeight -= addWeight.AddWeight;
InvokeCallback();
}
}
public void OnEquip(IEquipmentSlot slot, IBasicItem item)
{
if (item.GetAssetable().TryGetProperty<AddInventoryMaxWeight>(out var addWeight))
private void OnEquip(IEquipmentSlot slot, IBasicItem item)
{
if (!item.GetAssetable().TryGetProperty<AddInventoryMaxWeight>(out var addWeight)) return;
maxWeight += addWeight.AddWeight;
InvokeCallback();
}
}
void InvokeCallback()
private void InvokeCallback()
{
foreach (var x in entity.GetCallbacks<IWeightedCallback>())
{
x.OnWeighted(currentWeight, maxWeight);
}
}
OnWeighted?.Invoke(currentWeight, maxWeight);
}
public event Action<double,double> OnWeighted;
}
}

View File

@@ -10,21 +10,18 @@ using Google.Apis.Sheets.v4.Data;
namespace BITFALL
{
public interface IPlayerEquipCallback
{
void OnEquip(IEquipmentSlot slot,IBasicItem item);
void DeEquip(IEquipmentSlot slot, IBasicItem item);
}
public interface IPlayerEquipContainer {
Action<IEquipmentSlot, IBasicItem> OnEquip { get; set; }
Action<IEquipmentSlot, IBasicItem> OnDeEquip { get; set; }
bool TryDeEquip<T>(T slot=default) where T : IEquipmentSlot;
}
/// <summary>
/// 玩家装备容器
/// 支持,护甲,头盔和背包等
/// </summary>
public class PlayerEquipContainer : EntityComponent, IExcutor<IBasicItem>, IPlayerEquipContainer,IServiceRegister
[CustomType(typeof(IPlayerEquipContainer))]
public class PlayerEquipContainer : EntityComponent, TaskSubscriber<IBasicItem>, IPlayerEquipContainer
{
public override Type BaseType => typeof(IPlayerEquipContainer);
private readonly Dictionary<IEquipmentSlot, IBasicItem> dictionary = new();
private IBasicItemContainer inventory;
public override void OnAwake()
@@ -35,19 +32,25 @@ namespace BITFALL
private void OnSetAlive(bool obj)
{
if (obj is false) return;
foreach (var x in dictionary.Keys.ToArray())
if (obj) return;
foreach (var x in dictionary.ToArray())
{
TryDeEquip(x);
OnDeEquip?.Invoke(x.Key, x.Value);
inventory.Add(x.Value);
}
dictionary.Clear();
}
public override void OnStart()
{
base.OnStart();
entity.RegisterCallback<IExcutor<IBasicItem>>(this);
entity.RegisterCallback<TaskSubscriber<IBasicItem>>(this);
inventory = entity.Get<IBasicItemContainer>();
}
public Action<IEquipmentSlot, IBasicItem> OnEquip { get; set; }
public Action<IEquipmentSlot, IBasicItem> OnDeEquip { get; set; }
public bool TryDeEquip<T>(T slot) where T : IEquipmentSlot
{
if (!dictionary.TryGetValue(slot, out var equipable)) return false;
@@ -60,21 +63,16 @@ namespace BITFALL
private bool Equip(IEquipmentSlot slot, IBasicItem item)
{
dictionary.Add(slot, item);
foreach (var x in entity.GetCallbacks<IPlayerEquipCallback>())
{
x.OnEquip(slot, item);
}
OnEquip?.Invoke(slot, item);
return true;
}
private bool DeEquip(IEquipmentSlot slot, IBasicItem item)
{
dictionary.Remove(slot);
foreach (var x in entity.GetCallbacks<IPlayerEquipCallback>())
{
x.DeEquip(slot, item);
}
OnDeEquip?.Invoke(slot, item);
return true;
}
public int Priority => 0;
public bool TryExecute(IBasicItem value)
{

View File

@@ -10,13 +10,13 @@ using System.Linq;
namespace BITFALL
{
public class PlayerInventory : EntityInventory,ISelectableCallback,IRequestor<IBasicItem>
public class PlayerInventory : EntityInventory,ISelectableCallback,TaskPublisher<IBasicItem>
{
public override void Initialize(IEntity entity)
{
base.Initialize(entity);
entity.Set<IBasicItemContainer>(this);
entity.Set<IRequestor<IBasicItem>>(this);
entity.Set<TaskPublisher<IBasicItem>>(this);
}
public override void OnStart()
{
@@ -24,7 +24,7 @@ namespace BITFALL
entity.RegisterCallback<ISelectableCallback>(this);
}
/// <summary>咋整啊这个</summary>
public void OnActive(ISelectable selectable)
void ISelectableCallback.OnActive(ISelectable selectable)
{
var trans = selectable.GetTransform();
@@ -41,16 +41,16 @@ namespace BITFALL
}
}
public void OnHover(ISelectable selectable)
void ISelectableCallback.OnHover(ISelectable selectable)
{
}
public void OnInactive(ISelectable selectable)
void ISelectableCallback.OnInactive(ISelectable selectable)
{
}
public bool Excute(IBasicItem value)
public bool Execute(IBasicItem value)
{
foreach (var excutor in entity.GetCallbacks<IExcutor<IBasicItem>>())
foreach (var excutor in entity.GetCallbacks<TaskSubscriber<IBasicItem>>())
{
if(excutor.TryExecute(value))
{
@@ -61,24 +61,24 @@ namespace BITFALL
return false;
}
}
// #if UNITY_EDITOR
// [UnityEditor.CustomEditor(typeof(PlayerInventory))]
// public class EntityPlayerInventoryInsepctor : BITInspector<PlayerInventory>
// {
// public override VisualElement CreateInspectorGUI()
// {
// FillDefaultInspector();
// CreateSubTitle(Constant.Header.Debug);
// var serializeLabel = root.Create<Label>();
//
// StringBuilder stringBuilder = new StringBuilder();
// foreach (var x in agent.GetItems())
// {
// stringBuilder.AppendLine($"{x.Id}@{x.Name}");
// }
// serializeLabel.text=stringBuilder.ToString();
// return root;
// }
// }
// #endif
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(PlayerInventory))]
public class EntityPlayerInventoryInsepctor : BITInspector<PlayerInventory>
{
public override VisualElement CreateInspectorGUI()
{
FillDefaultInspector();
CreateSubTitle(Constant.Header.Debug);
var serializeLabel = root.Create<Label>();
StringBuilder stringBuilder = new StringBuilder();
foreach (var x in agent.GetItems())
{
stringBuilder.AppendLine($"{x.Id}@{x.Name}");
}
serializeLabel.text=stringBuilder.ToString();
return root;
}
}
#endif
}

View File

@@ -6,15 +6,23 @@ using AYellowpaper.SerializedCollections;
namespace BITFALL
{
public class EntityPropsDisplay : EntityComponent,IEquipSelectorCallback,IPlayerEquipCallback
public class EntityPropsDisplay : EntityComponent
{
[SerializeField] private SerializedDictionary<string, GameObject> equipments = new();
[SerializeField] private SerializedDictionary<string, GameObject> unEquipDictionary = new();
[SerializeField] private SerializedDictionary<string, GameObject> equipDictionary = new();
public override void OnStart()
{
entity.RegisterCallback<IPlayerEquipCallback>(this);
entity.RegisterCallback<IEquipSelectorCallback>(this);
var playerEquipContainer = entity.Get<IPlayerEquipContainer>();
var equipSelector = entity.Get<IPlayerEquipSelector>();
playerEquipContainer.OnEquip += OnEquip;
playerEquipContainer.OnDeEquip += OnDeEquip;
equipSelector.OnEquip += OnEquip;
equipSelector.OnDeEquip += OnDeEquip;
equipSelector.OnUpdateEquip += OnUpdateEquip;
foreach (var x in equipments)
{
x.Value.SetActive(false);
@@ -28,39 +36,40 @@ namespace BITFALL
x.Value.SetActive(false);
}
}
public void DeEquip(IEquipmentSlot slot, IBasicItem item)
private void OnDeEquip(IEquipmentSlot slot, IBasicItem item)
{
var asset = item.GetAssetable();
if (equipments.TryGetValue(asset.AdressablePath, out GameObject prop))
if (equipments.TryGetValue(asset.AddressablePath, out GameObject prop))
{
prop.SetActive(false);
}
}
public void OnEquip(IEquipmentSlot slot, IBasicItem item)
private void OnEquip(IEquipmentSlot slot, IBasicItem item)
{
var asset = item.GetAssetable();
if(equipments.TryGetValue(asset.AdressablePath, out GameObject prop)) {
if(equipments.TryGetValue(asset.AddressablePath, out GameObject prop)) {
prop.SetActive(true);
}
}
public void OnEquip(IBasicItem item)
private void OnEquip(IBasicItem item)
{
if (equipDictionary.TryGetValue(item.AdressablePath, out var model))
if(item is null) return;
if (equipDictionary.TryGetValue(item.AddressablePath, out var model))
{
model.SetActive(true);
}
}
public void OnDeEquip(IBasicItem item)
private void OnDeEquip(IBasicItem item)
{
foreach (var x in equipDictionary)
{
x.Value.gameObject.SetActive(false);
}
}
public void OnUpdateEquip(IDictionary<int, IBasicItem> maps)
private void OnUpdateEquip(IDictionary<int, IBasicItem> maps)
{
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -13,6 +14,23 @@ namespace BITFALL.Guns
float FireRate { get; }
}
/// <summary>
/// 后坐力接口定义
/// </summary>
public interface IRecoil:IProperty
{
/// <summary>
/// 后坐力的方向
/// </summary>
Vector3 Recoil { get; }
}
[Serializable]
[CustomType(typeof(IRecoil))]
public struct VectorRecoil:IRecoil
{
[SerializeField] private Vector3 recoil;
public Vector3 Recoil => recoil;
}
/// <summary>
/// 射击模式的基类
/// </summary>
public record FireMode : IFireMode {

View File

@@ -1,11 +1,13 @@
using System.Linq;
using BITFALL.Guns.States;
using BITFALL.Player.Movement;
using UnityEngine;
using BITKit;
using BITKit.Entities;
using BITKit.Entities.Melee;
using UnityEngine.InputSystem;
using BITKit.StateMachine;
using Unity.Mathematics;
using UnityEngine.InputSystem.Interactions;
#if UNITY_EDITOR
using UnityEditor;
@@ -66,6 +68,8 @@ namespace BITFALL.Guns
//简单设置
[Header(Constant.Header.Settings)]
[SerializeField] private Vector3 bulletInitialOffset;
[SerializeField] private int initialAimFov = 60;
[SerializeField] private SpringEulerAngle recoilSpring=new();
// 输入系统
[Header(Constant.Header.Input)]
@@ -80,12 +84,13 @@ namespace BITFALL.Guns
[SerializeReference, SubclassSelector] private IMeleeService meleeService;
// 引用组件
[Header(Constant.Header.Components)]
public Renderer[] rendererComponents;
public VFXPlayer vfxPlayer;
[SerializeField] private Renderer[] rendererComponents;
[SerializeField] private VFXPlayer vfxPlayer;
[SerializeField] private LocationAdditive locationAdditive;
// 引用预制体
[Header(Constant.Header.Prefabs)]
public AssetableGun assetable;
[SerializeField] internal AssetableGun assetable;
[Header(Constant.Header.Reference)]
// 内部变量burst
@@ -95,12 +100,12 @@ namespace BITFALL.Guns
internal readonly IntervalUpdate fireInterval = new(0.32f);
internal readonly IntervalUpdate burstFireInterval = new(0.1f);
internal int burstFireCount;
private SpringEulerAngle positionSpring=new();
private SpringEulerAngle recoilSpring=new();
private IEntityMovement _movement;
private IPlayerMovement _playerMovement;
private static readonly int IsGrounded = Animator.StringToHash("IsGrounded");
#region
public override string AddressablePath => assetable.AdressablePath;
public override string AddressablePath => assetable.AddressablePath;
#endregion
public override void OnAwake()
@@ -110,7 +115,20 @@ namespace BITFALL.Guns
actionGroup.RegisterCallback(aimAction, OnAim);
actionGroup.RegisterCallback(reloadAction, OnReload);
actionGroup.RegisterCallback(meleeAction, OnMelee);
entity.Get<IEntityMovement>().OnStateChanged += OnMovementStateChanged;
_movement = entity.Get<IEntityMovement>();
_playerMovement = entity.Get<IPlayerMovement>();
_movement.OnStateChanged += OnMovementStateChanged;
_movement.OnCommand += OnMovementCommand;
}
private void OnMovementCommand(object obj)
{
switch (obj)
{
case OnPlayerJumpCommand:
animator.Play("Jump");
break;
}
}
private void OnMelee(InputAction.CallbackContext obj)
@@ -155,6 +173,8 @@ namespace BITFALL.Guns
public override void Entry()
{
base.Entry();
var animName = animator.animator.GetCurrentAnimatorStateInfo(0).shortNameHash;
animator.animator.Play(animName,-1,0);
animator.animator.enabled = true;
actionGroup.allowInput.AddElement(this);
foreach (var x in rendererComponents)
@@ -205,6 +225,11 @@ namespace BITFALL.Guns
}
break;
}
animator.animator.SetBool(IsGrounded,_movement.IsGrounded);
recoilSpring.Update(deltaTime,default);
locationAdditive.AddEuler(recoilSpring.value);
}
public override void AnimationEvent(string eventName)
@@ -267,8 +292,18 @@ namespace BITFALL.Guns
}
break;
}
// .value = new Vector3(Random.Range(-gunSpec.recoil.x, 0), gunSpec.recoil.y.Random(), 0);
// sprintPos.value -= new Vector3(gunSpec.recoil.z.Random(), 0, gunSpec.recoil.z);
if (assetable.TryGetProperty<IRecoil>(out var _recoil))
{
var _newRecoil = new Vector3
{
x = _recoil.Recoil.x,
y = _recoil.Recoil.y.Random(),
z = _recoil.Recoil.z.Random()
};
recoilSpring.value = _newRecoil;
_playerMovement.AddViewEuler(new float2(_newRecoil.x,_newRecoil.y));
}
}
private void OnFire(InputAction.CallbackContext context)
{

View File

@@ -1,3 +1,4 @@
using System.Data.Odbc;
using BITFALL.Player.Movement;
using BITKit;
using BITKit.Entities;
@@ -44,6 +45,8 @@ namespace BITFALL.Guns.States
{
root.TransitionState<Run>();
}
root.expectAiming.shouldBe = root.aimAction.action.IsPressed();
}
public void OnHover(ISelectable selectable)
{
@@ -190,12 +193,11 @@ namespace BITFALL.Guns.States
public override void OnMovementStateChanged(IEntityMovementState old, IEntityMovementState newState)
{
if (Enabled is false) return;
if(newState is IPlayerRunState or IPlayerSprintState)
{
if (newState is not (IPlayerRunState or IPlayerSprintState)) return;
root.expectAiming.Reset();
root.TransitionState<Movement>();
}
}
}
[System.Serializable]
public class Equip : GunState
{
@@ -281,7 +283,14 @@ namespace BITFALL.Guns.States
public override void OnStateEntry(IState old)
{
root.animator.Play(BITGun._Melee);
_entityMovement.ExecuteCommand(new PlayerDisableRunCommand(this));
}
public override void OnStateExit(IState old, IState newState)
{
_entityMovement.ExecuteCommand(new PlayerEnableRunCommand(this));
}
public override void OnStateUpdate(float deltaTime)
{
_entityMovement.ExecuteCommand<PlayerCancelRunCommand>();

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit;
using BITKit.Entities;
using UnityEngine;
using UnityEngine.InputSystem;
namespace BITFALL.Player.Movement
{
public class EquipSway : EntityComponent
{
[SerializeField] private float rotDelta;
[SerializeField] private float rotValue;
[SerializeField] private float posDelta;
[SerializeField] private float posValue;
[SerializeField] private LocationAdditive locationAdditive;
private Quaternion currentRotation;
private Vector3 currentPosition;
private IEntityMovement _movement;
public override void OnAwake()
{
_movement = entity.Get<IEntityMovement>();
}
public override void OnLateUpdate(float deltaTime)
{
var velocity = _movement.LocomotionBasedVelocity;
var angularVelocity = _movement.AngularVelocity;
currentPosition = Vector3.Lerp(currentPosition,velocity * posValue,posDelta * deltaTime);
currentRotation = Quaternion.Lerp(currentRotation,Quaternion.Euler(angularVelocity * rotValue),rotDelta * deltaTime);
locationAdditive.AddEuler(currentRotation.eulerAngles);
locationAdditive.AddPosition(currentPosition);
}
}
}

View File

@@ -1,39 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
namespace BITFALL
{
public interface ISwap
{
void Add();
void Remove();
}
[System.Serializable]
public class BITSwap : ISwap
{
public void Add()
{
throw new System.NotImplementedException();
}
public void Remove()
{
throw new System.NotImplementedException();
}
}
[System.Serializable]
public class FltotoItemContainer : ISwap
{
public void Add()
{
throw new System.NotImplementedException();
}
public void Remove()
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -44,7 +44,7 @@ namespace BITFALL.Melee
foreach (var x in colliders.Where(x=>x.GetComponent<IDamagable>() is not null))
{
var damageable = x.GetComponent<IDamagable>();
if (damaged.Contains(damageable.Entity))
if (damaged.Contains(damageable.Entity) || damageable.Entity.Id == command.PlayerId)
{
continue;
}

View File

@@ -14,7 +14,8 @@
"GUID:1235ca61e7f433b408ed5a68767e7123",
"GUID:bea3628e8b592ae47ade218cb9ec98db",
"GUID:f822dbf6fdfd4a5469cccaa2e4eed3b6",
"GUID:a3de65b07192e7d49bad7b4032d681de"
"GUID:a3de65b07192e7d49bad7b4032d681de",
"GUID:d8b63aba1907145bea998dd612889d6b"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -1,10 +1,12 @@
using System;
using BITFALL.Entities.Player.Movement.States;
using BITFALL.Player.Movement;
using BITKit;
using BITKit.Entities;
using BITKit.Entities.Physics;
using BITKit.Entities.Player;
using Lightbug.CharacterControllerPro.Core;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Interactions;
@@ -12,11 +14,13 @@ using UnityEngine.UIElements;
namespace BITFALL.Entities.Player.Movement
{
public class PlayerCharacterController : StateBasedPlayerComponent<IEntityMovementState>,IEntityMovement,IServiceRegister
[CustomType(typeof(IEntityMovement))]
[CustomType(typeof(IPlayerMovement))]
public class PlayerCharacterController : StateBasedPlayerComponent<IEntityMovementState>,IEntityMovement,IServiceRegister,IPlayerMovement
{
public override Type BaseType => typeof(IEntityMovement);
[SerializeField] private CharacterActor actor;
[SerializeField] private Vector3 initialCameraPosition = new Vector3(0,0.11f,0.27f);
[SerializeField] private Vector3 initialCameraPosition = new(0,0.11f,0.27f);
[SerializeField] private float initialSpeed;
[SerializeReference,SubclassSelector] private IClosePoint climbClosePoint;
@@ -25,9 +29,12 @@ namespace BITFALL.Entities.Player.Movement
private IProvider adsProvider;
[SerializeField] private Transform cameraTransform;
public Vector3 ViewCenter { get; set; }
public Quaternion ViewRotation { get; set; }
public Vector3 LocomotionBasedVelocity { get;private set; }
public Vector3 Velocity => actor.Velocity;
public Vector3 GroundVelocity=>actor.GroundVelocity;
public Vector3 AngularVelocity { get;private set; }
public bool IsGrounded => actor.IsGrounded;
public Vector3 MovementInput { get; private set; }
@@ -38,8 +45,8 @@ namespace BITFALL.Entities.Player.Movement
public ExpectState<bool> ExpectSprint;
public ExpectState<Vector3> expectClimb;
public Vector3 CurrentCameraPosition;
private readonly ValidHandle allowMovement = new();
private readonly ValidHandle allowRun = new();
private IEntityPhysics physics;
private IHealth _health;
private bool isDead;
@@ -63,6 +70,7 @@ namespace BITFALL.Entities.Player.Movement
private void OnSetAlive(bool obj)
{
allowMovement.SetElements(this,obj);
allowRun.SetElements(this,obj);
if (obj)
{
if (!isDead) return;
@@ -91,13 +99,26 @@ namespace BITFALL.Entities.Player.Movement
ExpectSprint.Reset();
}
public void ExecuteCommand<T>(T command)
public void ExecuteCommand<T>(T command=default)
{
foreach (var x in StateDictionary.Values)
{
x.ExecuteCommand<T>(command);
}
switch (command)
{
case PlayerEnableRunCommand enableRunCommand:
allowRun.RemoveDisableElements(enableRunCommand.Lock);
ExpectRun.Reset();
ExpectSprint.Reset();
break;
case PlayerDisableRunCommand disableRunCommand:
allowRun.AddDisableElements(disableRunCommand.Lock);
break;
}
OnCommand?.Invoke(command);
}
public event Action<object> OnCommand;
public void View(InputAction.CallbackContext context)
{
@@ -111,6 +132,12 @@ namespace BITFALL.Entities.Player.Movement
lookInput.y += raw.x;
lookInput.x = Mathf.Clamp(lookInput.x, -80, 80);
LookInput = lookInput;
AngularVelocity = new Vector3
(
raw.y,
-raw.x
);
}
public void Jump(InputAction.CallbackContext context)
{
@@ -127,6 +154,7 @@ namespace BITFALL.Entities.Player.Movement
}
public void Run(InputAction.CallbackContext context)
{
if (allowRun.Allow is false) return;
switch (context)
{
case { interaction: PressInteraction, started: true }:
@@ -191,6 +219,18 @@ namespace BITFALL.Entities.Player.Movement
cameraTransform.rotation = rotation;
CurrentState?.AfterUpdateMovement(deltaTime);
cameraTransform.localPosition = Vector3.Lerp(cameraTransform.localPosition,CurrentCameraPosition,5 * deltaTime);
ViewCenter = cameraTransform.position;
ViewRotation = rotation;
}
public void AddViewEuler(float2 euler)
{
LookInput = new Vector3
{
x = LookInput.x + euler.x,
y = LookInput.y + euler.y
};
}
}

View File

@@ -38,10 +38,13 @@ namespace BITFALL.Entities.Player.Movement.States
// Smooth movement Velocity
currentVelocity = Vector3.Lerp(currentVelocity, targetMovementVelocity, 1f - Mathf.Exp(-16 * deltaTime));
if (!characterController.ExpectJump.shouldBe) return;
if (characterController.ExpectJump.shouldBe)
{
actor.ForceNotGrounded();
currentVelocity += Vector3.up * initialJumpForce;
characterController.ExpectJump.Reset();
characterController.ExecuteCommand<OnPlayerJumpCommand>();
}
}
else
{

View File

@@ -0,0 +1,21 @@
{
"name": "BITFALL.Player.Survival.Runtime",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:d525ad6bd40672747bde77962f1c401e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:26fc13cbbc427414f9af2143d581330a",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using BITKit;
using BITKit.Entities;
using UnityEngine;
namespace BITFALL.Player.Survival
{
[CustomType(typeof(IPlayerSurvival))]
public class PlayerSurvival : EntityComponent, IPlayerSurvival
{
[SerializeReference, SubclassSelector] private IPlayerSurvivalState[] survivalStates;
private readonly IntervalUpdate interval = new(1);
private bool initialized;
private CancellationToken _cancellationToken;
public override void OnAwake()
{
_cancellationToken = entity.Get<CancellationToken>();
foreach (var x in survivalStates)
{
x.OnStateInitialize();
}
}
public override async void OnStart()
{
foreach (var x in survivalStates)
{
await x.OnStateInitializeAsync(_cancellationToken);
}
foreach (var x in survivalStates)
{
x.OnStateInitialized();
}
initialized = true;
}
public override void OnFixedUpdate(float deltaTime)
{
if (interval.AllowUpdate is false || initialized is false) return;
foreach (var x in survivalStates)
{
x.ProcessState();
if(x.TryGetNewEvent(out var newEvent))
OnSurvivalEventOpened?.Invoke(newEvent);
if(x.TryGetClosedEvent(out var closedEvent))
OnSurvivalEventClosed?.Invoke(closedEvent);
}
}
public event Action<IPlayerSurvivalState> OnSurvivalStateChanged;
public event Action<IPlayerSurvivalEvent> OnSurvivalEventOpened;
public event Action<IPlayerSurvivalEvent> OnSurvivalEventClosed;
}
}

View File

@@ -29,7 +29,6 @@ namespace BITFALL.Scenes
currentRotation=transform1.rotation;
rigidbodyComponent.UseGravity = false;
rigidbodyComponent.Mass = mass;
rigidbodyComponent.IsKinematic = true;
}
private void FixedUpdate()
{

View File

@@ -21,7 +21,9 @@
"GUID:42a9827d94e00374aa52e51f0a1b035c",
"GUID:84d565da37ad40546a118cfb3c3509f3",
"GUID:2289059ddf1745b4d80a0f184af99d6b",
"GUID:9354affc93e0f3e4a904785e7d4c0f59"
"GUID:9354affc93e0f3e4a904785e7d4c0f59",
"GUID:1bb4187526a9431478feccaef064696a",
"GUID:26fc13cbbc427414f9af2143d581330a"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -13,15 +13,18 @@ using UnityEngine.UIElements;
namespace BITFALL
{
public class UXEquipSelector : MonoBehaviour,IEquipSelectorCallback
public class UXEquipSelector : MonoBehaviour
{
[SerializeReference,SubclassSelector] private IPlayerService playerService;
[SerializeField]
private SerializableDictionaryBase<int, UXImage> dictionary = new();
[SerializeField] private UXImage currentUXEquip;
private readonly ConcurrentDictionary<int,IBasicItem> cache=new();
private IPlayerEquipSelector _equipSelector;
public void OnEquip(IBasicItem item)
{
if(item is null) return;
var assets = item.GetAssetable();
currentUXEquip.SetTexture(assets.RectangleIcon);
}
@@ -32,10 +35,9 @@ namespace BITFALL
public void OnUpdateEquip(IDictionary<int, IBasicItem> maps)
{
cache.Clear();
foreach (var x in dictionary)
foreach (var (key, image) in dictionary)
{
var image = x.Value;
if (maps.TryGetValue(x.Key, out var item))
if (maps.TryGetValue(key, out var item))
{
var asset = item.GetAssetable();
image.SetTexture(asset.RectangleIcon);
@@ -44,14 +46,24 @@ namespace BITFALL
{
image.SetTexture(null);
}
cache.TryAdd(x.Key, item);
cache.TryAdd(key, item);
}
}
private void Start()
{
playerService.OnPlayerInitialized += OnStartLocalPlayer;
OnDeEquip(null);
foreach (var x in dictionary)
{
x.Value.visualElement.RegisterCallback<MouseDownEvent>(evt =>
{
if (evt.button is not 1) return;
if (cache.TryGetValue(x.Key, out var item))
{
_equipSelector.TryDeEquip(item);
}
});
}
}
private void OnDestroy()
{
@@ -59,7 +71,10 @@ namespace BITFALL
}
private void OnStartLocalPlayer(IEntity entity)
{
entity.RegisterCallback<IEquipSelectorCallback>(this);
_equipSelector = entity.Get<IPlayerEquipSelector>();
_equipSelector.OnEquip += OnEquip;
_equipSelector.OnDeEquip += OnDeEquip;
_equipSelector.OnUpdateEquip += OnUpdateEquip;
}
}
}

View File

@@ -8,25 +8,31 @@ using BITKit;
using BITKit.UX;
using BITKit.Entities;
using BITKit.Entities.Player;
using BITKit.Steamwork;
namespace BITFALL.UX
{
public class UXHud : UIToolKitPanel, ISelectableCallback
{
[Header(Constant.Header.Providers)]
[SerializeReference, SubclassSelector]
private INetClient netClient;
[SerializeReference, SubclassSelector]
private INetProvider netProvider;
[SerializeField, SerializeReference, SubclassSelector]
private IPlayerService playerService;
[SerializeReference, SubclassSelector] private INetClient netClient;
[SerializeReference, SubclassSelector] private INetProvider netProvider;
[SerializeReference, SubclassSelector] private IPlayerService playerService;
[SerializeReference, SubclassSelector] private ISteamService steamService;
[Header(Constant.Header.Components)]
[SerializeField] private UXImage crosshairImage;
[SerializeField] private UXLabel playerNameLabel;
[SerializeField] private UXImage playerAvatarImage;
[SerializeField] private UXBar healthBar;
[Header(Constant.Header.Input)]
public InputActionReference inventoryAction;
public InputActionReference returnAction;
public InputActionGroup inputActionGroup = new();
public UXLabel nameLabel;
private IHealth _health;
protected IEntityMovement _entityMovement;
protected override void Awake()
{
base.Awake();
@@ -36,6 +42,8 @@ namespace BITFALL.UX
netClient.OnConnected += OnConnected;
playerService.OnPlayerInitialized += OnPlayerInitializedLocalPlayer;
}
private void OnDestroy()
@@ -65,11 +73,18 @@ namespace BITFALL.UX
{
UXService.Entry<UXHud>();
}
private void OnPlayerInitializedLocalPlayer(IEntity entity)
private async void OnPlayerInitializedLocalPlayer(IEntity entity)
{
entity.RegisterCallback<ISelectableCallback>(this);
_health = entity.Get<IHealth>();
_entityMovement = entity.Get<IEntityMovement>();
_health.OnSetAlive += OnSetAlive;
_health.OnSetHealthPoint += OnSetHP;
if (!steamService.IsInitialized) return;
playerNameLabel.Set(steamService.Name);
var avatar = await steamService.GetAvatarAsync(cancellationToken);
playerAvatarImage.SetTexture(avatar);
}
private void OnInventory(InputAction.CallbackContext context)
{
@@ -78,6 +93,13 @@ namespace BITFALL.UX
if(context.JustPressed())
UXService.Entry<UXInventory>();
}
private void LateUpdate()
{
if (playerService.LocalPlayer is null) return;
crosshairImage.SetPosition(_entityMovement.ViewCenter + _entityMovement.ViewRotation * Vector3.forward);
}
private static void OnReturn(InputAction.CallbackContext context)
{
if (context.JustPressed())
@@ -91,5 +113,10 @@ namespace BITFALL.UX
Entry();
}
}
private void OnSetHP(int hp)
{
healthBar.Set(hp);
}
}
}

View File

@@ -10,7 +10,7 @@ using UnityEngine.AddressableAssets;
namespace BITFALL.UX
{
public class UXInventory : UIToolKitPanel,IWeightedCallback,IPlayerEquipCallback
public class UXInventory : UIToolKitPanel
{
[Header(Constant.Header.Input)]
public InputActionReference inventoryAction;
@@ -76,10 +76,14 @@ namespace BITFALL.UX
}
private void OnPlayerInitializedLocalPlayer(IEntity entity)
{
entity.RegisterCallback<IWeightedCallback>(this);
entity.RegisterCallback<IPlayerEquipCallback>(this);
inventory = entity.Get<IBasicItemContainer>();
var weighted = entity.Get<IPlayerInventoryWeightable>();
weighted.OnWeighted += OnWeighted;
equipContainer = entity.Get<IPlayerEquipContainer>();
equipContainer.OnEquip += OnEquip;
equipContainer.OnDeEquip += DeEquip;
inventory = entity.Get<IBasicItemContainer>();
inventory.OnAdd += OnAdd;
inventory.OnRemove += OnRemove;
@@ -98,13 +102,14 @@ namespace BITFALL.UX
UXService.Entry<UXHud>();
}
public void OnWeighted(float current, float max)
public void OnWeighted(double current, double max)
{
weightBar.SetDirect( current is 0 ? 0 :(current / max).Fix(),$"{current}/{max}");
var value = current is 0 ? 0 : (current / max);
weightBar.SetDirect((float) value,$"{current}/{max}");
}
private void OnAdd(IBasicItem item)
{
var asset = Addressables.LoadAssetAsync<AssetableItem>(item.AdressablePath).WaitForCompletion();
var asset = Addressables.LoadAssetAsync<AssetableItem>(item.AddressablePath).WaitForCompletion();
var uxContainer = builder.BuildAsContainer();
uxContainer.icon.style.backgroundImage = asset.SquareIcon;
uxContainer.contextLabel.text = asset.Name;
@@ -141,28 +146,23 @@ namespace BITFALL.UX
}
private void UseItem(IBasicItem item)
{
_entity.Get<IRequestor<IBasicItem>>().Excute(item);
_entity.Get<TaskPublisher<IBasicItem>>().Execute(item);
}
private void DropItem(IBasicItem item)
{
inventory.Drop(item.Id);
}
void IPlayerEquipCallback.OnEquip(IEquipmentSlot slot, IBasicItem item)
private void OnEquip(IEquipmentSlot slot, IBasicItem item)
{
var asset = item.GetAssetable();
if (equipContainers.TryGetValue(slot.GetType().Name, out var container))
{
if (!equipContainers.TryGetValue(slot.GetType().Name, out var container)) return;
container.icon.style.backgroundImage = asset.SquareIcon;
BIT4Log.Log<UXInventory>($"已装备:{item.Name}@{slot.GetType().Name}");
}
}
void IPlayerEquipCallback.DeEquip(IEquipmentSlot slot, IBasicItem item)
{
if(equipContainers.TryGetValue(slot.GetType().Name,out var container))
private void DeEquip(IEquipmentSlot slot, IBasicItem item)
{
if (!equipContainers.TryGetValue(slot.GetType().Name, out var container)) return;
container.icon.style.backgroundImage = null;
}
}
}
}

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using BITFALL.Player.Survival;
using BITKit.Entities;
using BITKit.Entities.Player;
using BITKit.UX;
using RotaryHeart.Lib.SerializableDictionary;
using UnityEngine;
using UnityEngine.TextCore.Text;
using UnityEngine.UIElements;
namespace BITFALL.UX
{
public class UXSurvival : MonoBehaviour
{
[SerializeReference,SubclassSelector] private IPlayerService playerService;
[SerializeField] private SerializableDictionaryBase<string,Sprite> survivalEventIcons;
[SerializeField] private UXBuilder survivalEventBuilder;
private readonly ConcurrentDictionary<string,UXContainer> spawnedSurvivalEvents = new();
private IPlayerSurvival _playerSurvival;
private void Awake()
{
playerService.OnPlayerInitialized += OnPlayerInitialized;
}
private void OnDestroy()
{
playerService.OnPlayerInitialized -= OnPlayerInitialized;
}
private void OnPlayerInitialized(Entity obj)
{
_playerSurvival = obj.Get<IPlayerSurvival>();
_playerSurvival.OnSurvivalEventOpened += OnSurvivalEventOpened;
_playerSurvival.OnSurvivalEventClosed += OnSurvivalEventClosed;
}
private void OnSurvivalEventClosed(IPlayerSurvivalEvent obj)
{
if (spawnedSurvivalEvents.TryRemove(obj.GetType().Name, out var container))
{
container.visualElement.RemoveFromHierarchy();
}
}
private void OnSurvivalEventOpened(IPlayerSurvivalEvent obj)
{
spawnedSurvivalEvents.GetOrAdd(obj.GetType().Name, (x)=>Create(obj));
}
private UXContainer Create(IPlayerSurvivalEvent playerSurvivalEvent)
{
var container = survivalEventBuilder.BuildAsContainer();
var key = playerSurvivalEvent.GetType().Name;
if (survivalEventIcons.TryGetValue(key, out var sprite))
{
container.icon.style.backgroundImage = new StyleBackground(sprite);
}
container.contextLabel.text = playerSurvivalEvent.Title;
return container;
}
}
}

View File

@@ -1,6 +1,7 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<ui:Template name="BITQuestElement" src="project://database/Assets/BITKit/Unity/UX/BITQuestElement.uxml?fileID=9197481963319205126&amp;guid=e76b752484c652b44afef2ac0afd5dd6&amp;type=3#BITQuestElement" />
<ui:Template name="DialogueLabel" src="project://database/Assets/Artists/UX/DialogueLabel.uxml?fileID=9197481963319205126&amp;guid=3ff4d7289dadb214fbfb566f1312a6e0&amp;type=3#DialogueLabel" />
<ui:Template name="Survival-Template" src="project://database/Assets/Artists/UX/Survival-Template.uxml?fileID=9197481963319205126&amp;guid=b75c1744172f96e4cb694204bfd48b98&amp;type=3#Survival-Template" />
<Style src="project://database/Assets/BITKit/Unity/UX/BITQuest.uss?fileID=7433441132597879392&amp;guid=5c2d746d52de8e340b788034994ee23e&amp;type=3#BITQuest" />
<Style src="project://database/Assets/BITKit/Unity/UX/Common/Common.uss?fileID=7433441132597879392&amp;guid=a3a69d3518fd02b489e721f3c5b0b539&amp;type=3#Common" />
<ui:VisualElement name="Profiler" class="pa-16" style="position: absolute; flex-direction: row;">
@@ -12,7 +13,7 @@
<ui:VisualElement name="point-render" style="position: absolute; width: 32px; height: 32px; background-image: url(&apos;project://database/Assets/BITKit/Unity/Art/Icons/EditorIcons/winbtn_mac_close_a@2x.png?fileID=2800000&amp;guid=15fcf531feceef8438c9e35edbc55be3&amp;type=3#winbtn_mac_close_a@2x&apos;); top: 0; left: 0;" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="quest-container" style="top: 64px; right: 64px; position: absolute;">
<ui:VisualElement name="quest-container" style="top: 64px; right: 64px; position: absolute; display: none;">
<ui:Instance template="BITQuestElement" name="BITQuestElement" class="completed" />
<ui:Instance template="BITQuestElement" name="BITQuestElement" />
</ui:VisualElement>
@@ -22,6 +23,9 @@
<ui:VisualElement name="CrossHair" class="root">
<ui:VisualElement name="crosshair-image" style="margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto; background-color: rgba(255, 255, 255, 0.5); width: 8px; height: 8px; border-top-left-radius: 110px; border-bottom-left-radius: 110px; border-top-right-radius: 110px; border-bottom-right-radius: 110px;" />
</ui:VisualElement>
<ui:VisualElement name="CrossHair" class="root">
<ui:VisualElement name="crosshair-image--fixed" class="flex-center" style="width: 64px; height: 64px; background-image: url(&apos;project://database/Assets/Artists/Arts/Icons/Crosshair_No_Dot.png?fileID=2800000&amp;guid=507fe62dcf74ad84d966ea70a924771e&amp;type=3#Crosshair_No_Dot&apos;);" />
</ui:VisualElement>
<ui:VisualElement name="equips-container" style="position: absolute; right: 64px; bottom: 64px;">
<ui:VisualElement name="currentEquip-image" style="background-image: url(&apos;project://database/Assets/Artists/Arts/Icons/Items/ICON_M4A1_Full.png?fileID=2800000&amp;guid=8c4b3d8772ae2a54eaba9d401a095089&amp;type=3#ICON_M4A1_Full&apos;); -unity-background-scale-mode: scale-to-fit; width: 256px; height: 128px;" />
</ui:VisualElement>
@@ -31,4 +35,20 @@
<ui:Label tabindex="-1" text="终极1号,我们收到了撤离请求" parse-escape-sequences="true" display-tooltip-when-elided="true" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="player-container" style="width: 404px; height: 194px; position: absolute; left: 80px; top: 844px; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; background-color: rgba(0, 0, 0, 0.66);">
<ui:VisualElement name="VisualElement" style="height: 24px;" />
<ui:VisualElement style="flex-direction: row;">
<ui:VisualElement name="playerAvatar-image" style="width: 128px; height: 128px; background-image: url(&apos;project://database/Assets/Artists/Arts/Icons/Logo.jpg?fileID=2800000&amp;guid=3ded0edcf28c6794f95fb07d3c684769&amp;type=3#Logo&apos;);" />
<ui:VisualElement style="margin-left: 16px; justify-content: space-between;">
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="playerName-label" style="font-size: 24px; width: 258px; color: rgb(255, 255, 255);" />
<ui:VisualElement name="armoy-bar" style="background-image: url(&apos;project://database/Assets/Artists/Arts/Images/Armor%20bar.png?fileID=2800000&amp;guid=2ef6adf8c47c0f84a8833e0b855b34ef&amp;type=3#Armor bar&apos;); height: 6px;" />
<ui:VisualElement name="health-bar" style="background-image: url(&apos;project://database/Assets/Artists/Arts/Images/health%20Bar.png?fileID=21300000&amp;guid=c0c202fbfdd31ce4683d35d62a242374&amp;type=3#health Bar&apos;); height: 32px; justify-content: space-around; overflow: hidden;">
<ui:VisualElement name="health-fill" style="width: 81%; flex-grow: 1; background-color: rgb(255, 255, 255);" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="survival-container" style="top: 8px;">
<ui:Instance template="Survival-Template" name="Survival-Template" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>

View File

@@ -4,7 +4,7 @@
<Style src="project://database/Assets/Artists/UX/Inventory.uss?fileID=7433441132597879392&amp;guid=48b2564db1f95a443b921af9745fd92a&amp;type=3#Inventory" />
<Style src="project://database/Assets/BITKit/Unity/UX/Common/Common.uss?fileID=7433441132597879392&amp;guid=a3a69d3518fd02b489e721f3c5b0b539&amp;type=3#Common" />
<ui:VisualElement name="Background" picking-mode="Ignore" style="position: absolute; left: 0; top: -2px; right: 0; bottom: 2px; background-color: rgba(0, 0, 0, 0.78); justify-content: center;" />
<BITKit.UX.TabBar tabs="背包,制作,地图,任务,技能树" name="inventory-tab" style="position: absolute; left: 96px; top: 72px; flex-direction: row;" />
<BITKit.UX.TabBar tabs="背包,制作,地图,任务,技能树" name="inventory-tab" allowFocus="false" style="position: absolute; left: 96px; top: 72px; flex-direction: row;" />
<ui:VisualElement name="Preview" picking-mode="Ignore" style="position: absolute; left: 0; top: 0; bottom: 0; right: 0; display: none;">
<ui:VisualElement name="SnapHelper" class="SnapHelper" style="position: absolute; left: 64px; top: 64px; width: 64px; height: 64px;" />
<ui:VisualElement style="flex-wrap: wrap; height: 867px; flex-direction: column; width: 1774px;" />

View File

@@ -5,7 +5,7 @@
<ui:VisualElement name="menu-image" class="root" style="background-image: url(&apos;project://database/Assets/Artists/Arts/Backgrounds/BITFALL_Menu_Welcome2.png?fileID=2800000&amp;guid=ea7b2123deb66034d9ad36f9060d087e&amp;type=3#BITFALL_Menu_Welcome2&apos;);" />
<ui:VisualElement name="blur-image" class="root" style="background-color: rgba(0, 0, 0, 0.5);" />
<ui:VisualElement name="navigation" class="tab" style="position: absolute; left: 0; top: 0; right: 0; height: 100px; background-color: rgba(0, 0, 0, 0.5); align-items: stretch; justify-content: center; flex-direction: row;">
<BITKit.UX.TabBar tabs="进入战区,饰品库存,情报中心" name="menu-tab" style="flex-direction: row;" />
<BITKit.UX.TabBar tabs="进入战区,饰品库存,情报中心" name="menu-tab" allowFocus="false" style="flex-direction: row;" />
<ui:Button text="退出" display-tooltip-when-elided="true" name="exit-button" class="navigation" style="flex-grow: 1; position: absolute; top: 0; right: 0; bottom: 0;" />
</ui:VisualElement>
<BITKit.UX.TabContainer picking-mode="Ignore" CurrentTab="0" CustomTabPath="menu-tab" style="position: absolute; left: 64px; top: 128px; right: 64px; bottom: 64px;">

View File

@@ -0,0 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
<ui:VisualElement name="survival-template" style="flex-direction: row;">
<ui:VisualElement name="icon-image" style="width: 32px; height: 32px; background-color: rgb(255, 255, 255);" />
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="context-label" />
</ui:VisualElement>
</ui:UXML>

View File

@@ -0,0 +1,3 @@
{
"name": "BITFALL.Player.Equip"
}

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IEquipService : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -1,7 +1,9 @@
{
"name": "BITFALL.Player.Movement",
"rootNamespace": "",
"references": [],
"references": [
"GUID:d8b63aba1907145bea998dd612889d6b"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,

View File

@@ -0,0 +1,12 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
namespace BITFALL.Player.Movement
{
public interface IPlayerMovement
{
void AddViewEuler(float2 euler);
}
}

View File

@@ -1,5 +1,23 @@
namespace BITFALL.Player.Movement
{
public struct PlayerCancelRunCommand{}
public struct PlayerDisableRunCommand
{
public readonly object Lock;
public PlayerDisableRunCommand(object @lock)
{
Lock = @lock;
}
}
public struct PlayerEnableRunCommand
{
public readonly object Lock;
public PlayerEnableRunCommand(object @lock)
{
Lock = @lock;
}
}
public struct OnPlayerJumpCommand{}
public struct OnPlayerLandCommand{}
}

View File

@@ -0,0 +1,20 @@
{
"name": "BITFALL.Player.Survival",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:d525ad6bd40672747bde77962f1c401e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using BITKit;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace BITFALL.Player.Survival
{
/// <summary>
/// 玩家生存接口
/// </summary>
public interface IPlayerSurvival
{
/// <summary>
/// 当玩家生存元素更新时
/// </summary>
event Action<IPlayerSurvivalState> OnSurvivalStateChanged;
/// <summary>
/// 当玩家进入状态时
/// </summary>
event Action<IPlayerSurvivalEvent> OnSurvivalEventOpened;
/// <summary>
/// 当玩家退出状态时
/// </summary>
event Action<IPlayerSurvivalEvent> OnSurvivalEventClosed;
}
/// <summary>
/// 玩家生存元素,例如生命值、饥饿值、水分值等
/// </summary>
public interface IPlayerSurvivalState
{
/// <summary>
/// 初始化状态
/// </summary>
void OnStateInitialize();
/// <summary>
/// 初始化异步状态
/// </summary>
/// <param name="cancellationToken">取消令牌</param>
/// <returns></returns>
UniTask OnStateInitializeAsync(CancellationToken cancellationToken);
/// <summary>
/// 已完成初始化
/// </summary>
void OnStateInitialized();
/// <summary>
/// 处理状态,类似于Update
/// </summary>
void ProcessState();
/// <summary>
/// 尝试获取新的状态事件
/// </summary>
bool TryGetNewEvent(out IPlayerSurvivalEvent newState);
/// <summary>
/// 尝试获取已关闭的状态事件
/// </summary>
bool TryGetClosedEvent(out IPlayerSurvivalEvent closedState);
}
/// <summary>
/// 玩家生存时间,例如饿了,渴了和生病了
/// </summary>
public interface IPlayerSurvivalEvent
{
string Title { get; }
string Message { get; }
}
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using BITKit;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace BITFALL.Player.Survival
{
public abstract class PlayerSurvivalState:IPlayerSurvivalState
{
public virtual void OnStateInitialize()
{
}
public virtual UniTask OnStateInitializeAsync(CancellationToken cancellationToken)
{
return UniTask.CompletedTask;
}
public virtual void OnStateInitialized()
{
}
public virtual void ProcessState()
{
}
public virtual bool TryGetNewEvent(out IPlayerSurvivalEvent newState)
{
newState = null;
return false;
}
public virtual bool TryGetClosedEvent(out IPlayerSurvivalEvent closedState)
{
closedState = null;
return false;
}
}
/// <summary>
/// 递减的玩家生存状态
/// </summary>
public abstract class PlayerSurvivalDecrementState:PlayerSurvivalState
{
[SerializeField] protected int value;
public override void ProcessState()
{
value = Mathf.Clamp(value - 1, 0, 100);
}
}
/// <summary>
/// 玩家饥饿值
/// </summary>
[Serializable]
public class PlayerHunger : PlayerSurvivalDecrementState
{
private bool _isHungry;
public override bool TryGetNewEvent(out IPlayerSurvivalEvent newState)
{
newState = null;
if (_isHungry|| value >= 50) return false;
_isHungry = true;
newState = new PlayerFeelHungryEvent();
BIT4Log.Log<PlayerHunger>("玩家饿了");
return true;
}
public override bool TryGetClosedEvent(out IPlayerSurvivalEvent closedState)
{
if(_isHungry && value >= 50)
{
_isHungry = false;
closedState = new PlayerFeelHungryEvent();
BIT4Log.Log<PlayerHunger>("玩家不饿了");
return true;
}
closedState = null;
return false;
}
}
/// <summary>
/// 玩家水分值
/// </summary>
[Serializable]
public class PlayerHydration : PlayerSurvivalState
{
}
/// <summary>
/// 玩家健康值
/// </summary>
[Serializable]
public class PlayerHealth : PlayerSurvivalState
{
}
public class PlayerFeelHungryEvent : IPlayerSurvivalEvent
{
public string Title => "饿了";
public string Message =>"你饿了,找点东西吃吧";
}
}

View File

@@ -53,7 +53,7 @@ namespace BITKit
/// <summary>
/// 可寻址路径,该路径用于查找物品
/// </summary>
string AdressablePath { get; }
string AddressablePath { get; }
/// <summary>
/// 物品描述
/// </summary>
@@ -81,13 +81,13 @@ namespace BITKit
#region
public int Id;
public string Name;
public string AdressablePath { get; set; }
public string AddressablePath { get; set; }
public string Description;
public ItemQuality Quality;
/// <summary>
/// 本地属性
/// </summary>
Property property = new();
private Property property = new();
#endregion
#region
int IBasicItem.Id => Id;
@@ -124,7 +124,7 @@ namespace BITKit
{
Id=item.Id;
Name = item.Name;
AdressablePath = item.AdressablePath;
AddressablePath = item.AddressablePath;
Description = item.Description;
Quality=item.Quality;
CopyPropertiesFrom(item);

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace BITKit
{
@@ -70,7 +71,11 @@ namespace BITKit
{
foreach (var x in factory)
{
properties.Add(x.GetType().FullName, x);
properties.Add(x.GetType()!.FullName, x);
foreach (var att in x.GetType().GetCustomAttributes<CustomTypeAttribute>())
{
properties.Add(att.Type!.FullName, x);
}
}
}
Dictionary<string, object> properties=new();

View File

@@ -1,24 +1,38 @@
namespace BITKit
{
/// <summary>
/// 执行接口,发布者下发任务
/// 订阅者,发布者下发任务给支持并优先级最高的订阅者
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IExcutor<T>
public interface TaskSubscriber<in T>
{
/// <summary>
/// 优先级
/// </summary>
int Priority { get; }
/// <summary>
/// 是否支持并执行任务
/// </summary>
/// <param name="value">值</param>
/// <returns>是否支持</returns>
bool TryExecute(T value);
}
/// <summary>
/// 发布接口,向发布者下发任务
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IRequestor<T>
public interface TaskPublisher<in T>
{
/// <summary>
/// 执行任务
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
bool Excute(T value);
bool Execute(T value);
public static TaskPublisher<T> operator+ (TaskPublisher<T> self, TaskSubscriber<T> x)
{
return self;
}
}
}

View File

@@ -74,7 +74,7 @@
"id": "9b32c7f1-0553-4735-b0f9-7726d59808ca",
"expectedControlType": "Button",
"processors": "",
"interactions": "Hold,Tap",
"interactions": "Press,Hold",
"initialStateCheck": false
},
{
@@ -128,7 +128,7 @@
"id": "113a3c02-0fbb-4081-9fac-c39878ddfd09",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"interactions": "Press,Hold",
"initialStateCheck": false
},
{
@@ -137,7 +137,7 @@
"id": "57a12f28-2fde-45e5-957f-d8d61afe44de",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"interactions": "Press,Hold",
"initialStateCheck": false
},
{
@@ -146,7 +146,7 @@
"id": "c2535f43-fec8-42bd-b680-6d1cee5246e5",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"interactions": "Press,Hold",
"initialStateCheck": false
},
{
@@ -155,7 +155,7 @@
"id": "6740f3a7-7571-4277-96e9-15aa08af7302",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"interactions": "Press,Hold",
"initialStateCheck": false
},
{
@@ -211,6 +211,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Holster",
"type": "Button",
"id": "7e9d80ac-533b-4a17-bf2a-74d3ccd6ec1c",
"expectedControlType": "Button",
"processors": "",
"interactions": "Press,Hold",
"initialStateCheck": false
}
],
"bindings": [
@@ -510,6 +519,17 @@
"action": "Quinary",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "570f3f2d-b544-4e16-b825-a59c546c18b9",
"path": "<Keyboard>/h",
"interactions": "",
"processors": "",
"groups": "",
"action": "Holster",
"isComposite": false,
"isPartOfComposite": false
}
]
},

View File

@@ -35,8 +35,6 @@ namespace BITKit.Animations
}
[Header(Constant.Header.Components)]
public Animator animator;
[Header(Constant.Header.State)]
public bool isMatchingTarget;
public AnimatorLayerInfo this[int index]
{
get
@@ -116,7 +114,6 @@ namespace BITKit.Animations
{
this[i].currentState = animator.GetCurrentAnimatorStateInfo(i);
}
isMatchingTarget = animator.isMatchingTarget;
}
}
}

View File

@@ -62,6 +62,14 @@ namespace BITKit.Entities
/// </summary>
public interface IEntityMovement:IStateMachine<IEntityMovementState>
{
/// <summary>
/// 视角中心,通常是摄像机的位置
/// </summary>
Vector3 ViewCenter { get; }
/// <summary>
/// 视角旋转,通常是摄像机的旋转
/// </summary>
Quaternion ViewRotation { get; }
/// <summary>
/// 基于运动的速度,是相对于标准化移动速度的相对速度
/// </summary>
@@ -75,6 +83,10 @@ namespace BITKit.Entities
/// </summary>
Vector3 GroundVelocity { get; }
/// <summary>
/// 旋转速度
/// </summary>
Vector3 AngularVelocity { get; }
/// <summary>
/// 是否在地面上
/// </summary>
bool IsGrounded { get; }
@@ -96,8 +108,16 @@ namespace BITKit.Entities
/// </summary>
/// <param name="context"></param>
void Movement(InputAction.CallbackContext context);
/// <summary>
/// 执行命令
/// </summary>
/// <param name="command"></param>
/// <typeparam name="T"></typeparam>
void ExecuteCommand<T>(T command=default);
/// <summary>
/// 执行命令的回调
/// </summary>
event Action<object> OnCommand;
}
public interface IEntityMovementState:IState
{
@@ -107,80 +127,4 @@ namespace BITKit.Entities
void AfterUpdateMovement(float deltaTime);
void ExecuteCommand<T>(T command);
}
public interface IPlayerMovementCommand{}
[Serializable]
public class MonoMovementProxy:IEntityMovement
{
[SerializeField] private MonoBehaviour monoBehaviour;
private IEntityMovement _entityMovementImplementation=>monoBehaviour as IEntityMovement;
public Vector3 LocomotionBasedVelocity=>_entityMovementImplementation.LocomotionBasedVelocity;
public Vector3 Velocity => _entityMovementImplementation.Velocity;
public Vector3 GroundVelocity => _entityMovementImplementation.GroundVelocity;
public bool IsGrounded => _entityMovementImplementation.IsGrounded;
public void SyncMovement(Vector3 velocity, Vector3 position, Quaternion rotation, bool isGrounded)
{
_entityMovementImplementation.SyncMovement(velocity, position, rotation, isGrounded);
}
public void Movement(Vector3 relativeVector)
{
_entityMovementImplementation.Movement(relativeVector);
}
public void Movement(InputAction.CallbackContext context)
{
_entityMovementImplementation.Movement(context);
}
public void ExecuteCommand<T>(T command)=>_entityMovementImplementation.ExecuteCommand(command);
public bool Enabled
{
get => _entityMovementImplementation.Enabled;
set => _entityMovementImplementation.Enabled = value;
}
public IEntityMovementState CurrentState
{
get => _entityMovementImplementation.CurrentState;
set => _entityMovementImplementation.CurrentState = value;
}
public event Action<IEntityMovementState, IEntityMovementState> OnStateChanged
{
add => _entityMovementImplementation.OnStateChanged += value;
remove => _entityMovementImplementation.OnStateChanged -= value;
}
public IDictionary<Type, IEntityMovementState> StateDictionary => _entityMovementImplementation.StateDictionary;
public void Initialize()
{
_entityMovementImplementation.Initialize();
}
public void UpdateState(float deltaTime)
{
_entityMovementImplementation.UpdateState(deltaTime);
}
public void DisposeState()
{
_entityMovementImplementation.DisposeState();
}
public void TransitionState<State>() where State : IEntityMovementState
{
_entityMovementImplementation.TransitionState<State>();
}
public void TransitionState(IEntityMovementState state)
{
_entityMovementImplementation.TransitionState(state);
}
}
}

View File

@@ -14,9 +14,12 @@ namespace BITKit
#endregion
#region
public Vector3 ViewCenter { get; set; }
public Quaternion ViewRotation { get; set; }
public Vector3 LocomotionBasedVelocity { get; private set; }
public Vector3 Velocity { get; private set; }
public Vector3 GroundVelocity { get; private set; }
public Vector3 AngularVelocity { get; private set; }
public bool IsGrounded { get; private set; }
private bool isDead;
private Vector3 recordPosition;
@@ -55,6 +58,8 @@ namespace BITKit
throw new NotImplementedException();
}
public event Action<object> OnCommand;
public void OnSetAlive(bool alive)
{
switch (alive)

View File

@@ -90,9 +90,6 @@ namespace BITKit.Entities
{
OnSetAliveInternal(IsAlive = _isAlive);
}
//entity.Invoke<int>(_onSetHP, newHP);
//entity.Set<int>("HP", newHP);
foreach (var x in entity.GetCallbacks<IHealthCallback>())
{
x.OnSetHP(newHP);
@@ -108,20 +105,17 @@ namespace BITKit.Entities
private void OnSetAliveInternal(bool alive)
{
IsAlive = alive;
foreach (var x in entity.GetCallbacks<IHealthCallback>())
{
x.OnSetAlive(alive);
}
foreach (var x in additiveCallback)
{
x.OnSetAlive(alive);
}
//entity.Invoke<bool>(_onSetAlive, alive);
//entity.Set<bool>(_isAlive, alive);
onSetAlive.Invoke(alive);
OnSetAlive?.Invoke(alive);
onSetAlive.Invoke(alive);
}
private void AddHP(int hp)

View File

@@ -68,7 +68,7 @@ namespace BITKit.Entities.Player
}
public void Interactive(InputAction.CallbackContext context)
{
if (context.interaction is not TapInteraction || !context.performed) return;
if (context.interaction is not PressInteraction || !context.performed) return;
var _selected = selected;
if (_selected is not MonoBehaviour monoBehaviour) return;
if (monoBehaviour.TryGetComponentAny<IAction>(out var action))

View File

@@ -31,8 +31,7 @@ namespace BITKit.Entities
entityComponents = GetComponentsInChildren<IEntityComponent>(true).Distinct().ToArray();
foreach (var x in entityComponents)
{
var att = x.GetType().GetCustomAttribute<CustomTypeAttribute>();
if (att is not null)
foreach (var att in x.GetType().GetCustomAttributes<CustomTypeAttribute>())
{
genericEvent.Set(att.Type, x);
}

View File

@@ -0,0 +1,27 @@
{
"name": "BITFALL.Entities.EquipSelector.Runtime",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:b355af20142c0c541ba9588ab1d0f64e",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:30cdc242b1ac6a944a460f4ab0b77b88",
"GUID:677cd05ca06c46b4395470200b1acdad",
"GUID:7efac18f239530141802fb139776f333",
"GUID:84d565da37ad40546a118cfb3c3509f3",
"GUID:42a9827d94e00374aa52e51f0a1b035c",
"GUID:d525ad6bd40672747bde77962f1c401e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:9354affc93e0f3e4a904785e7d4c0f59"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,164 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
using BITKit.Entities;
using UnityEngine.InputSystem;
using static UnityEditor.Progress;
using System.Diagnostics;
using System.Linq;
using BITKit.Entities.Player;
using UnityEngine.InputSystem.Interactions;
using Debug = UnityEngine.Debug;
namespace BITFALL
{
[CustomType(typeof(IPlayerEquipSelector))]
public class PlayerEquipSelector : EntityComponent,TaskSubscriber<IBasicItem>,IEntityInventoryCallback,IPlayerEquipSelector
{
[Header(Constant.Header.Components)]
public EntityEquipment equipment;
[Header(Constant.Header.InternalVariables)]
private readonly Dictionary<int, IBasicItem> equips=new();
private IBasicItemContainer inventory;
public event Action<IBasicItem> OnEquip;
public event Action<IBasicItem> OnDeEquip;
public event Action<IDictionary<int, IBasicItem>> OnUpdateEquip;
private IBasicItem currentEquip;
public override void OnAwake()
{
var health = entity.Get<IHealth>();
health.OnSetAlive += OnSetAlive;
OnDeEquip += DeEquip;
OnEquip += Equip;
}
public override void OnStart()
{
base.OnStart();
entity.RegisterCallback<TaskSubscriber<IBasicItem>>(this);
inventory = entity.Get<IBasicItemContainer>();
}
public void OnPrimary(InputAction.CallbackContext context)
{
if (context is not {interaction:PressInteraction ,performed:true}) return;
Equip(1);
}
public void OnSecondary(InputAction.CallbackContext context)
{
if (context is not {interaction:PressInteraction ,performed:true}) return;
Equip(2);
}
public void OnTertiary(InputAction.CallbackContext context)
{
if (context is not {interaction:PressInteraction ,performed:true}) return;
if (Equip(3) is false)
{
Equip(-1);
}
}
public void OnQuaternary(InputAction.CallbackContext context)
{
if (context is not {interaction:PressInteraction ,performed:true}) return;
Equip(4);
}
public void OnHolster(InputAction.CallbackContext context)
{
if (context is not {interaction:PressInteraction ,performed:true}) return;
Equip(-1);
}
private void OnSetAlive(bool alive)
{
if (alive) return;
foreach (var x in equips.ToArray())
{
inventory.Add(x.Value);
}
equips.Clear();
UpdateEquip();
Equip(-1);
}
int TaskSubscriber<IBasicItem>.Priority => 0;
bool TaskSubscriber<IBasicItem>.TryExecute(IBasicItem value)
{
var asset = value.GetAssetable();
if (IsSupportItem(value) is false) return false;
switch (asset)
{
case var _ when asset.TryGetProperty<EquipmentAsWeapon>(out _):
if (equips.TryAdd(1, value) || equips.TryAdd(2,value))
{
OnEquip?.Invoke(value);
UpdateEquip();
return true;
}
break;
}
return false;
}
public void OnAdd(IBasicItem item)
{
}
public void OnRemove(IBasicItem item)
{
if (IsSupportItem(item) is false)
{
UpdateEquip();
}
}
private bool IsSupportItem(IBasicItem item)
{
return equipment.equips.list.Any(x => x.AddressablePath == item.AddressablePath);
}
private void UpdateEquip()
{
OnUpdateEquip?.Invoke(new Dictionary<int, IBasicItem>(equips));
}
public bool TryDeEquip(IBasicItem item)
{
if (item is null) return false;
if (equips.Any(x => x.Value.AddressablePath == item.AddressablePath) is false) return false;
var index = equips.Single(x=>x.Value.AddressablePath==item.AddressablePath).Key;
if (equips.TryRemove(index) is false) return false;
if (!inventory.Add(item)) return false;
OnDeEquip?.Invoke(item);
UpdateEquip();
return true;
}
private void Equip(IBasicItem item)
{
if (item is null)
{
equipment.equips.Entry(-1);
}
else
{
equipment.equips.Entry(x=>x.AddressablePath == item.AddressablePath);
}
}
private bool Equip(int index)
{
if (!equips.TryGetValue(index, out var x) && index is not -1) return false;
if (index is -1)
{
OnEquip?.Invoke(x);
}
return true;
}
private void DeEquip(IBasicItem item)
{
equipment.equips.Entry(-1);
}
}
}

View File

@@ -4,37 +4,39 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using System.Linq;
namespace BITKit
{
[System.Serializable]
public class InputActionGroup : IDisposable
{
int lockFile = Guid.NewGuid().GetHashCode();
private int lockFile = Guid.NewGuid().GetHashCode();
public bool allowGlobalActivation = true;
public bool isEnabled;
InitializationState state = InitializationState.None;
[SerializeField, ReadOnly] private bool isEnabled;
private InitializationState state = InitializationState.None;
public ValidHandle allowInput = new();
List<InputAction> actions = new();
public InputActionGroup RegisterCallback(InputActionReference reference, Action<InputAction.CallbackContext> callback)
private readonly List<InputAction> actions = new();
public InputActionGroup RegisterCallback(InputActionReference reference,
Action<InputAction.CallbackContext> callback)
{
if (reference is null)
{
Debug.LogWarning($"未知的引用");
return this;
}
EnsureConfiguration();
var action = reference.action.Clone();
actions
.Where(x => x.name == action.name)
.CreateOrAddIfEmety(actions, action)
.ForEach(x =>
{
x.RegisterCallback(callback);
});
.ForEach(x => { x.RegisterCallback(callback); });
return this;
}
public void UnRegisterCallback(InputActionReference reference, Action<InputAction.CallbackContext> callback)
{
foreach (var action in actions.Where(x => x.name == reference.action.name))
@@ -42,7 +44,8 @@ namespace BITKit
action.UnRegisterCallback(callback);
}
}
void EnsureConfiguration()
private void EnsureConfiguration()
{
if (state is not InitializationState.Initialized)
{
@@ -50,18 +53,21 @@ namespace BITKit
state = InitializationState.Initialized;
}
}
void Init()
private void Init()
{
if (allowGlobalActivation)
BITInputSystem.AllowInput.AddListener(Listen);
allowInput.AddListener(Allow);
}
void Listen(bool allowInput)
private void Listen(bool allowInput)
{
this.allowInput.SetElements(lockFile, allowInput);
this.allowInput.SetDisableElements(lockFile, !allowInput);
}
void Allow(bool allow)
private void Allow(bool allow)
{
foreach (var action in actions)
{
@@ -74,6 +80,7 @@ namespace BITKit
action.Disable();
}
}
isEnabled = allow;
}
@@ -83,6 +90,7 @@ namespace BITKit
{
action.Disable();
}
actions.Clear();
}
}

View File

@@ -1,26 +1,27 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ReSharper disable InvertIf
namespace BITKit
{
public class LocationAdditive : BITBehavior
public class LocationAdditive : MonoBehaviour
{
Vector3 currentPosition;
Vector3 currentEulur;
private Vector3 currentPosition;
private Vector3 currentEuler;
public void AddPosition(Vector3 value)
{
currentPosition += value;
}
public void AddEuler(Vector3 value)
{
currentEulur += value;
currentEuler += value;
}
public void LateUpdate()
{
if (currentEulur.IsDefault() is false)
if (currentEuler.IsDefault() is false)
{
transform.localEulerAngles = currentEulur;
currentEulur = default;
transform.localEulerAngles = currentEuler;
currentEuler = default;
}
if (currentPosition.IsDefault() is false)
{

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class LocationAdditiveElement : MonoBehaviour
{
[SerializeField] private LocationAdditive locationAdditive;
private void Update()
{
locationAdditive.AddPosition(transform.localPosition);
locationAdditive.AddEuler(transform.localEulerAngles);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BITKit
public class LocationMixer : BITBehavior
{
[System.Serializable]
struct LocationInfo
private struct LocationInfo
{
public Location location;
public float weight;

View File

@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
namespace BITKit.UX
{
public class CustomButton : Button
{
public new class UxmlTraits : Button.UxmlTraits
{
}
public CustomButton() : base()
{
}
public new class UxmlFactory : UxmlFactory<CustomButton, UxmlTraits> { }
}
}

View File

@@ -23,12 +23,18 @@ namespace BITKit.UX
{
name = "tabs"
};
private readonly UxmlBoolAttributeDescription m_allowFocus = new ()
{
name = "allowFocus",
defaultValue = true
};
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
{
base.Init(ve, bag, cc);
var tabBar = (TabBar)ve;
tabBar.CurrentTab = m_TabBarAttribute.GetValueFromBag(bag, cc);
tabBar.Tabs = m_TabsAttribute.GetValueFromBag(bag, cc);
tabBar.allowFocus = m_allowFocus.GetValueFromBag(bag, cc);
}
}
public new class UxmlFactory : UxmlFactory<TabBar, UxmlTraits> { }
@@ -58,6 +64,22 @@ namespace BITKit.UX
SetTabs(value);
}
}
private bool allowFocus;
public bool AllowFocus
{
get => allowFocus;
set
{
allowFocus = value;
foreach (var x in _buttons)
{
x.focusable = value;
}
}
}
private void SetTabs(string value)
{
var split = value.Split(",");
@@ -72,6 +94,7 @@ namespace BITKit.UX
var index = i;
var button = _buttons[i] = this.Create<Button>();
button.text = tabName;
button.focusable = allowFocus;
button.clicked += () => CurrentTab = index;
}
}

View File

@@ -76,6 +76,8 @@ namespace BITKit.UX
[SerializeReference, SubclassSelector] private IUXPanel initialPanel;
[SerializeField] private TextAsset validTexts;
private bool initialized;
private void Awake()
{

View File

@@ -18,17 +18,16 @@ namespace BITKit
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true, Inherited = true)]
public class CustomTypeAttribute : System.Attribute
{
public readonly Type Type;
public CustomTypeAttribute(Type type)
{
Type = type;
}
}
public class BITEditorUtils
{
public const string InspectorPath = "Assets/BITKit/Unity/UX/BITInspector.uss";

View File

@@ -563,6 +563,7 @@ namespace BITKit
.CameraTransformWorldToPanel(self.panel, worldPosition, camera);
pos.x = (pos.x - self.layout.width / 2);
pos.y = (pos.y - self.layout.height / 2);
self.style.left = 0;
self.style.top = 0;

View File

@@ -0,0 +1,138 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5291136167880478882
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Billboard
m_Shader: {fileID: -6465566751694194690, guid: fc56a447eb0944f4f9fc3b51a4913759,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTexture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,8 @@
"name": "BITKit.Extension.Steamwork",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4"
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -1,7 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using Steamworks;
using Cysharp.Threading.Tasks;
namespace BITKit.Steamwork
{
/// <summary>
@@ -25,6 +27,7 @@ namespace BITKit.Steamwork
/// Steam客户端是否已经初始化
/// </summary>
bool IsInitialized { get; }
UniTask<Texture2D> GetAvatarAsync(CancellationToken token);
}
}

View File

@@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using Steamworks.Data;
using UnityEngine;
namespace BITKit.Steamwork
{
public static class SteamExtensions
{
public static Texture2D Covert( this Image image )
{
// Create a new Texture2D
var avatar = new Texture2D( (int)image.Width, (int)image.Height, TextureFormat.ARGB32, false )
{
// Set filter type, or else its really blury
filterMode = FilterMode.Trilinear
};
// Flip image
for ( int x = 0; x < image.Width; x++ )
{
for ( int y = 0; y < image.Height; y++ )
{
var p = image.GetPixel( x, y );
avatar.SetPixel( x, (int)image.Height - y, new UnityEngine.Color( p.r / 255.0f, p.g / 255.0f, p.b / 255.0f, p.a / 255.0f ) );
}
}
avatar.Apply();
return avatar;
}
}
}

View File

@@ -1,8 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;
using Steamworks;
using Steamworks.Data;
using UnityEditor.XR;
namespace BITKit.Steamwork
@@ -16,6 +19,13 @@ namespace BITKit.Steamwork
public ulong SteamId => SteamClient.SteamId;
public string Name => SteamClient.Name;
public bool IsInitialized=>SteamClient.IsValid&&SteamClient.IsLoggedOn;
public async UniTask<Texture2D> GetAvatarAsync(CancellationToken token)
{
var avatar =await SteamFriends.GetLargeAvatarAsync(SteamClient.SteamId);
var texture = new Texture2D(0, 0);
return avatar.Value.Covert();
}
public int Id => (int)SteamClient.SteamId.AccountId;
private bool initialized;
@@ -48,6 +58,7 @@ namespace BITKit.Steamwork
if (initialized)
SteamClient.Shutdown();
}
}
[Serializable]
public class SteamServiceSingleton:ISteamService
@@ -57,5 +68,6 @@ namespace BITKit.Steamwork
public ulong SteamId => _steamServiceImplementation.SteamId;
public string Name => _steamServiceImplementation.Name;
public bool IsInitialized=>_steamServiceImplementation.IsInitialized;
public UniTask<Texture2D> GetAvatarAsync(CancellationToken token)=>_steamServiceImplementation.GetAvatarAsync(token);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,370 @@
1.5.6
Fixed:
- Shader build error in Sunshaft particle shader in Unity 2022.2+
1.5.5
Minimum supported version is now Unity 2019.3.7f1
Added:
- (URP) Support for LOD crossfading in Vegetation Studio Pro 1.4.5
Changed:
- Reorganized folder structure to adhere to the traditional Model/Materials format
- Scripts are now separated into a Runtime/Editor folder and contain an assembly definition
- Improved normals for the majority of trees, resulting in better directional shading
- Normal maps for tree billboards are now actually correct, so will match a tree's shading more closely
- Roughness and Height maps for terrain layers are now packed into a new RGBA mask map
- Stiffness for trees is now stored in the UV3 V-component. Branch and trunk shaders have been modified to use this instead of the Alpha vertex color channel.
* This makes it more straightforward to add wind motion support to custom tree models, wind strength may need to be adjusted
- Tree models are now stored in a single FBX file per asset
- LOD meshes for rocks/cliffs are now in the same FBX file. LOD crossfading is now enabled for them (looks best in Forward rendering)
Fixed:
- Some particle materials not always converting properly to URP
Removed:
- Option to convert from URP to Built-in RP. Instead, his can be achieved by re-importing the package.
1.5.4
Changed:
- (URP) Converted all Shader Graph custom functions into Sub-graphs to solve Shader Graph's timing sensitive import errors
Fixed:
- (URP) Tree billboards not being rendered if used with Vegetation Studio Pro
- (URP) Some materials rendering invisible in URP 11+ (2021.1 beta)
1.5.3
Minimum supported version is now Unity 2018.4.0. URP now requires v7.4.1 (available since Unity 2019.3.7f1)
Added:
- Added terrain layers (part of auto upgrade in 2018.3)
- (URP) LOD crossfading support for vegetation shaders (already enabled by default on all prefabs)
- (URP) Foliage bending functionality to Foliage shader
Changed:
- Assuming Linear color space by default, colors have been adjusted to fit
- (URP) Greatly improved translucency for Foliage shader
- Particle effects now use the Standard particle shader (this also supports camera fading)
- Normal map inputs on cliff shaders are now correctly marked as such
- (URP) Vegetation shaders now use the same material UI as in the built-in RP
- URP material conversion now forces shaders to re-import after completion, as a workaround for Shader Graph import issues.
Fixed:
- Foliage bender now pushes grass/foliage away in the correct direction, regardless of the rotation of a mesh.
1.5.2
Added:
- Options to convert to Built/Universal Render Pipeline under Edit/Render Pipeline menu
- Color (HDR) field to tree branch shader. Transmission color is now also HDR-enabled.
Fixed:
- Errors in built-in water shader when reflection probe box projection wasn't enabled
1.5.1
Added:
- Pigment Map Generator now has a resolution parameter, and option to assign all active terrains
Fixed:
- (URP) Foliage shader light transmission effect is now influenced by directional light intensity
- (URP) Particle effect materials now convert completely when installing URP shaders (materials must still be selected once, before changes apply)
1.5.0
Minimum supported version is now Unity 2017.4.0
Added support for the Universal Render Pipeline in Unity 2019.3+. Shaders can be unpacked and FAE materials converted through the Help menu.
Notes:
- Grass is not available for the URP, the Stylized Grass Shader package offers a fully fledged URP grass shader. Grass materials will automatically use the foliage shader instead.
- LOD Crossfading is unavailable in the URP
- Custom shader UI's aren't supported by Shader Graph, material inspectors will use default formatting
Added:
- Revised water shader for the URP with improved intersection effect and shoreline waves.
Changed:
- Improved color padding on vegetation texture atlas, no longer shows dark edges on some plants on lower mipmaps
- (URP) Tree branches, light transmission is now masked by shadows
- Greatly reduced file size of cliff textures with no discernible quality loss (90mb savings)
- Shader controllers for Vegetation Studio Pro are now included in this package and support URP shaders
1.4.1
Fixed:
- Tree branch shader turning black if Directional Light was disabled or when using Mixed lighting with baked lightmaps.
- Shaders now receive lighting from Spot/Point lights in Forward Rendering when using Vegetation Studio
- Removed empty LOD2 from GrassPatch prefab, which prevented it from being used with Vegetation Studio Pro
1.4.0
- Unity 2019.3 compatibility verified
- All Substance materials have been replaced by textures
Added:
- Grass patch prefab, designed for mass placement
Changed:
- Cliff shaders now support Vegetation Studio's Instanced Indirect rendering
- Demo scenes now have post processing set up by default (Requires Post Processing package to be installed)
Fixed:
- Improved quality of tree billboard normal maps, fixes black billboards in Unity 2019.2+
1.3.1
Changed:
- Shading improvements for SpeedTree assets
Fixed:
- Custom pigment map option not accessible
1.3.0
Added:
- Ivy kit, consisting out of 6 variants
- Profile and LUT for the Post Processing Stack v2
Changed:
- PigmentMapGenerator
* Texture operations are now performed on the GPU resulting in much faster rendering
* Now has the option to manually input the terrain's size and position
- Foliage shader now has controls for global wind motion and leaf flutter
- Wind Controller, direction is now solely determined by the object's forward axis.
Fixed:
- Black color bleeding on elephant ear plant
- PigmentMapGenerator rendering half of the terrain when Game View is open and set to "Free Aspect"
Removed:
- Option to use legacy vertex color layout for tree branch and trunk shaders
1.2.6
- Checked for compatibility with v2.0.2 of the Substance plugin
- Minor changes and improvements
1.2.5:
Added:
- Grass terrain substance, rocks layer
- Dirt terrain substance, more controls for rocks
Fixed:
- PigmentMapGenerator fixes for some scenarios
1.2.4:
Fixed:
- Grass and foliage shader, light transmission issue on OpenGL
- PigmentMapGenerator fixes for some scenarios
- (2018+) Compatibility with Substance plugin v2.0.1
1.2.3
Added:
- WindController can now adjust the overall wind effect based on a WindZone's "Main" value.
Fixed:
- Water shader not compiling on MacOS when using Metal rendering
Changed:
- Foliage shader now uses a different wind animation method, resulting in less mesh deformation
- PigmentMapGenerator, improved workflow when using MegaSplat
- PigmentMapGenerator, improved support for mesh terrains with a centered pivot point.
- Minor improvements to tree branch shader
- Removed LOD group from plants with only one mesh
1.2.2
Unity 2018.1+: Substances have been converted to regular textures. Go to Help->Fantasy Adventure Environment to install Substance functionality.
1.2.1
Added:
- Vegetation shaders now support Instanced Indirect rendering
- Tree Branch shader now has a toggle to read SpeedTree wind for trees made using the Unity SpeedTree modeler
Changed:
- Usage of vertex color channels Blue and Alpha have been swapped, to be more in line with third-party baking tools.
A "Use Legacy Vertex Colors" toggle has been added to the Branch and Trunk shaders to swap them back.
- Optimized lightmap scale for all asset prefabs
Fixed:
- Warnings regarding Birch trees when using realtime GI
1.2.0
Updated minimum supported version to Unity 5.6 to make full use of GPU-instancing
Added:
- About window
- PigmentMapGenerator support for multi-terrain setups, please view the documentation for usage instructions
- Arrow gizmo to WindController
- Grass shader support for Vegetation Studio's TouchReact system. Flattened grass is also tinted slightly darker.
- Nav Mesh Obstacle component to all trees
- WindTrails particle effect
Changed:
- Recompiled shaders using latest ASE version (1.5.0)
- WindController no longer utilizes a Substance material
- WindAmplitude is now a shader value
- Sunshaft particles now use Soft Particles (Quality Settings) for better performance scaling
- Sunshafts no longer use the Directional Light's alpha channel for opacity, added an Opacity material parameter instead
- Grass wind tinting is now influenced by wind strength
- FoliageBender now adds a slight dark tint to grass
- Renamed "Resources" folder to "Source", to avoid unneccesary build inclusion
Fixed:
- Grass light transmission being visible in shadows
Removed:
- Water/Particles/RockDetail Substance materials (Had no parameters, so were baked to textures)
1.1.2
Fixed:
- Build errors on Nintendo Switch
- Recreated Sunshaft shaders in ASE, fixing PS4 issues
Changed:
- Removed all third party scripts from demo scene
1.1.1
Added:
- Willow_A tree asset (with LODs, billboard and collider)
- Willow_B tree asset (with LODs, billboard and collider)
- Ambient Occlusion to tree trunks
- ShaderGUI for FAE/Tree Trunk shader
- Current Wind Controller settings information in Shader GUI's when help is toggled
- Option under GameObject menu to create a new Wind Controller object
Changed:
Trees:
- Wind response, Ambient Occlusion and Light Transmission for all trees has been improved and fine-tuned per tree type
- Corrected normals on Pine_A LOD meshes
- Corrected UVs of Spruce and Pine tree trunks so the material is less vertically stretched
- Lowered all trees 0.3 units, so the trunk doesn't appear to float on steep terrain surfaces
Wind:
- Wind strength is now a shader function and thus can be changed during runtime
- Wind weight parameter in shaders is renamed to "MaxWindStrength"
Grass:
- Light transmission now visible in shorter grass as well
- Improved grass wind color influence (only brightens, rather than darkening and brightening)
1.1.0
Added:
- Collider meshes for Palm_B and Palm_C
- Pigment map generator now has options to flip or rotate the pigment map for mesh terrains
- Support for a custom pigment map
Changed:
- Tree trunk gradient is now inverted, making the top darker instead of the bottom (ambient occlusion for trunks to be added)
- Made wind vectors less uniform (Wind response for trees will soon be improved)
- Pigment map generator now works with mesh terrains with centered pivots
- Minor UI improvements
- Reduced splatmap size in demo scene
Fixed:
- High trunk weight wind values elongating the trees
1.0.9
Added
- Palm_B and Palm_C tree assets (with LODs, billboards)
- Dead branches to palm trees with separate color controls
- Custom inspector for WindController script
- Option to visualize the wind vectors in the Foliage, Grass and Tree Branch shader GUI's
Fixed:
- Several warnings
- Substance baker target folder not saving correctly
1.0.8
Added:
- Groundcover clovers, dead branches and two elephant ear plants
- Terrain sand material
Changed:
- PigmentmapGenerator now also works with mesh terrains
- Recompiled shaders using Amplify Shader Editor v1.3.4 ("_MaskClipValue" parameter is now called to "_Cutoff", adjusted Shader GUI's accordingly)
1.0.7
Added:
- New forest floor Substance material for the terrain, featuring needles, moss, roots, rocks and leafs
- Ability to bake the Substance textures for the terrain automatically, to allow for easy itteration
Changed:
- Refactored TerrainRock material, secondary and tertiary layers have been removed, more color properties have been added
- TerrainSnow material now has a sparkles effect when roughness is set to full
1.0.6
Added:
- Custom material inspectors for the Foliage, Grass and Tree Branch shaders. Features buttons to toggle parameter descriptions.
Changed:
- Removed the height- and pigment map functionality from the Foliage shader. Made a seperate "Grass" shader instead, which does have these features.
- WindController script, when added, now automatically tries to locate the FAE_WindVectors substance in the project
- PigmentMapGenerator clears the pigment map texture from the Grass shader when it is disabled. This avoids inadvertently using a pigment map from another scene.
Fixed:
- Grass animation not working when PigmentMap is deleted
1.0.5
Added:
- Grass billboard texture, for use on the terrain (Terrain/Textures folder)
Changed:
- Made vegetation meshes compatible with Vegetation Studio shaders
- Checked PigmentmapGenerator compatibilty with MicroSplat, made adjustments accordingly
- Improved usability of PigmentmapGenerator component
Fixed:
- Error catching in the PigmentmapGenerator script
- Corrected normal map behaviour in branch substances
- Fixed Palm bark artifacts in substance material
Removed:
- FAE_PigmentMap substance (obsolete)
- Standard Assets third person controller
1.0.4
Added:
- Grass blending with the terrain color is now 100% accurate, and no longer limited to the first 4 terrain textures.
- Random rotation parameter to GrassAtlas substance
Changed:
- Polished demo scene some more + performance improvements
- Cliff shader, increased base-intensity of detail normal map
- Cliff prefabs, set collider to "Convex" by default, added an optional Box Collider component
- Seperated the grass substance from the vegetation container
- Dust motes now use the Sunshaft particle shader, so they react better to lighting conditions
Fixed:
- CliffAppearance reverting some values to prefab defaults on play
- Face normals on fern mesh
1.0.3
Added:
- Billboard LODs for all trees. Allows you to have much more trees on screen.
- New Pine bark Substance material
Fixed:
- Tree branches turning black on DirectX 9
- Color bleeding on dead pine branches
- Wrong material on Cliff_E LODs
Changed:
- Trees now have a capsule collider, so they work as terrain trees. Tree colliders have not been removed, you can use these instead if you wish
- The Trees Substance container has been split up, each tree type has it's own container now.
- Spruce_B is now a little more distinct from its counterparts.
1.0.2
Added:
- Cliff coverage feature (snow, grass, etc)
- Custom inspector for CliffAppearance script
- Demo scene to showcase the cliff coverage functionality
Fixed:
- Shaders now work correctly on OSX
1.0.1
Fixed:
- Tree trunks and branches not moving synchronously when Static Batching is enabled
- PigmentmapGenerator will now work with any uniform terrain size and position
1.0.0
Initial release

View File

@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=http://staggart.xyz/unity/fantasy-adventure-environment/fae-documentation/

View File

@@ -0,0 +1,184 @@
// Fantasy Adventure Environment
// Copyright Staggart Creations
// staggart.xyz
using System;
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace FAE
{
[CustomEditor(typeof(CliffAppearance))]
public class CliffAppearanceInspector : Editor
{
CliffAppearance ca;
private bool showHelp = false;
public SerializedProperty targetMaterials;
public SerializedProperty objectColor;
public SerializedProperty roughness;
public SerializedProperty detailNormalMap;
public SerializedProperty detailNormalStrength;
public SerializedProperty globalColorMap;
public SerializedProperty globalColor;
public SerializedProperty globalTiling;
public SerializedProperty useCoverageShader;
public SerializedProperty coverageColorMap;
public SerializedProperty coverageNormalMap;
public SerializedProperty coverageAmount;
public SerializedProperty coverageTiling;
public SerializedProperty coverageMap;
#if UNITY_EDITOR
void OnEnable()
{
ca = (CliffAppearance)target;
targetMaterials = serializedObject.FindProperty("targetMaterials");
objectColor = serializedObject.FindProperty("objectColor");
roughness = serializedObject.FindProperty("roughness");
detailNormalMap = serializedObject.FindProperty("detailNormalMap");
detailNormalStrength = serializedObject.FindProperty("detailNormalStrength");
globalColorMap = serializedObject.FindProperty("globalColorMap");
globalColor = serializedObject.FindProperty("globalColor");
globalTiling = serializedObject.FindProperty("globalTiling");
useCoverageShader = serializedObject.FindProperty("useCoverageShader");
coverageColorMap = serializedObject.FindProperty("coverageColorMap");
coverageNormalMap = serializedObject.FindProperty("coverageNormalMap");
coverageAmount = serializedObject.FindProperty("coverageAmount");
coverageTiling = serializedObject.FindProperty("coverageTiling");
coverageMap = serializedObject.FindProperty("coverageMap");
Undo.undoRedoPerformed += OnUndoRedo;
}
private void OnDisable()
{
Undo.undoRedoPerformed -= OnUndoRedo;
}
private void OnUndoRedo()
{
ca.Apply();
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
if (ca.cliffShader == null) EditorGUILayout.HelpBox("Cliff shader could not be found!", MessageType.Error);
if (ca.cliffCoverageShader == null) EditorGUILayout.HelpBox("Cliff Coverage shader could not be found!", MessageType.Error);
DrawFields();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
ca.Apply();
}
}
private void DrawFields()
{
DoHeader();
EditorGUILayout.PropertyField(targetMaterials, true);
EditorGUILayout.Space();
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUILayout.LabelField("Coverage", EditorStyles.boldLabel);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(useCoverageShader, new GUIContent("Enable"));
if (showHelp) EditorGUILayout.HelpBox("Covers the objects from the Y-axis", MessageType.Info);
if (ca.useCoverageShader)
{
EditorGUILayout.HelpBox("Currently this feature requires you to have the PigmentMapGenerator script on your terrain", MessageType.Info);
EditorGUILayout.PropertyField(coverageMap, new GUIContent("Coverage map"));
if (showHelp) EditorGUILayout.HelpBox("This grayscale map represents the coverage amount on the terrain \n\nThe bottom left of the texture equals the pivot point of the terrain", MessageType.Info);
EditorGUILayout.PropertyField(coverageColorMap, new GUIContent("Albedo"));
EditorGUILayout.PropertyField(coverageNormalMap, new GUIContent("Normals"));
EditorGUILayout.PropertyField(coverageAmount, new GUIContent("Amount"));
EditorGUILayout.PropertyField(coverageTiling, new GUIContent("Tiling"));
}
EditorGUILayout.Space();
EditorGUILayout.EndVertical();
EditorGUILayout.Space();
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUILayout.LabelField("Object", EditorStyles.boldLabel);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(objectColor);
EditorGUILayout.PropertyField(roughness);
EditorGUILayout.Space();
EditorGUILayout.EndVertical();
EditorGUILayout.Space();
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUILayout.LabelField("Detail", EditorStyles.boldLabel);
EditorGUILayout.Space();
if (showHelp) EditorGUILayout.HelpBox("Normal details visible up close", MessageType.Info);
EditorGUILayout.PropertyField(detailNormalMap, new GUIContent("Detail normal map"));
EditorGUILayout.PropertyField(detailNormalStrength, new GUIContent("Normal strength"));
EditorGUILayout.Space();
EditorGUILayout.EndVertical();
EditorGUILayout.Space();
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUILayout.LabelField("Global", EditorStyles.boldLabel);
EditorGUILayout.Space();
if (showHelp) EditorGUILayout.HelpBox("A tri-planar projected color map which tiles across all the objects seamlessly", MessageType.Info);
EditorGUILayout.PropertyField(globalColorMap, new GUIContent("Global color map"));
EditorGUILayout.PropertyField(globalColor, new GUIContent("Color"));
EditorGUILayout.PropertyField(globalTiling, new GUIContent("Tiling"));
EditorGUILayout.Space();
EditorGUILayout.EndVertical();
GUIHelper.DrawFooter();
}
private void DoHeader()
{
EditorGUILayout.BeginHorizontal();
showHelp = GUILayout.Toggle(showHelp, "Toggle help", "Button");
GUILayout.Label("FAE Cliff Appearance", GUIHelper.Header);
EditorGUILayout.EndHorizontal();
if (showHelp) EditorGUILayout.HelpBox("This script allows you to edit multiple materials that use the FAE/Cliff shader. When it's loaded, the settings will be applied to them, so it acts as a sort of preset loader", MessageType.Info);
}
#endif
}
}

View File

@@ -0,0 +1,345 @@
// Fantasy Adventure Environment
// Staggart Creations
// http://staggart.xyz
using UnityEngine;
using System.IO;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
namespace FAE
{
public class FAE_Core : Editor
{
public const string ASSET_NAME = "Fantasy Adventure Environment";
public const string ASSET_ABRV = "FAE";
public const string ASSET_ID = "70354";
public static string INSTALLED_VERSION = "1.5.6";
public const string MIN_UNITY_VERSION = "2019.3";
public static string DOC_URL = "http://staggart.xyz/unity/fantasy-adventure-environment/fae-documentation/";
public static string FORUM_URL = "https://forum.unity3d.com/threads/486102";
#if UNITY_2019_3_OR_NEWER
private const string UniversalShaderPackageGUID = "7c884420a5dfbaa4db9afe42d366b843";
#endif
public static void OpenStorePage()
{
Application.OpenURL("com.unity3d.kharma:content/" + ASSET_ID);
}
public static string PACKAGE_ROOT_FOLDER
{
get { return SessionState.GetString(ASSET_ABRV + "_BASE_FOLDER", string.Empty); }
set { SessionState.SetString(ASSET_ABRV + "_BASE_FOLDER", value); }
}
public static string GetRootFolder()
{
//Get script path
string[] scriptGUID = AssetDatabase.FindAssets("FAE_Core t:script");
string scriptFilePath = AssetDatabase.GUIDToAssetPath(scriptGUID[0]);
//Truncate to get relative path
PACKAGE_ROOT_FOLDER = scriptFilePath.Replace("/Editor/FAE_Core.cs", string.Empty);
#if FAE_DEV
Debug.Log("<b>Package root</b> " + PACKAGE_ROOT_FOLDER);
#endif
return PACKAGE_ROOT_FOLDER;
}
#if UNITY_2019_3_OR_NEWER
public enum ShaderInstallation
{
BuiltIn,
UniversalRP
}
public class RunOnImport : AssetPostprocessor
{
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
foreach (string str in importedAssets)
{
if (str.Contains("FAE_Core.cs"))
{
GetRootFolder();
string urpFolder = FAE_Core.PACKAGE_ROOT_FOLDER + "/Shaders/URP/";
var info = new DirectoryInfo(urpFolder);
FileInfo[] fileInfo = info.GetFiles();
//Only one file in the folder, shaders not yet unpacked
if (fileInfo.Length <= 2 && UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset != null)
{
if (EditorUtility.DisplayDialog("Fantasy Adventure Environment", "The Universal Render Pipeline is in use.\n\nURP compatible shaders can be unpacked and materials upgraded through the \"Help\" window after importing has finished\n\nErrors about _GrabTexture can safely be ignored.", "OK"))
{
}
}
}
}
}
}
private const string urpName = "Universal Render Pipeline";
//Look up table to finding pipeline shader variants
private static Dictionary<string, string> ShaderRelations = new Dictionary<string, string>
{
//Peartickles
//Since 7.4.1, the legacy particle shaders will work
//{ "Legacy Shaders/Particles/Alpha Blended", urpName + "/Particles/Simple Lit" },
//No longer needed to convert particle materials. Barely works, so particle materials are now packaged for URP
//{ "Particles/Alpha Blended", urpName + "/Particles/Simple Lit" },
//{ "Mobile/Particles/Alpha Blended", urpName + "/Particles/Simple Lit" },
//{ "Particles/Standard Surface", urpName + "/Particles/Simple Lit" },
//{ "Particles/Standard Unlit", urpName + "/Particles/Unlit" },
{ "Standard", urpName + "/Lit" },
{ "Skybox/Cubemap","Skybox/Cubemap" },
{ "Nature/Terrain/Standard", urpName + "/Terrain/Lit" },
{ "FAE/Fog sheet", urpName + "/FAE/FAE_FogSheet" },
{ "FAE/Sunshaft", urpName + "/FAE/FAE_Sunshaft" },
//{ "FAE/Sunshaft particle", urpName + "/FAE/FAE_SunshaftParticle" },
{ "FAE/Cliff", urpName + "/FAE/FAE_Cliff" },
{ "FAE/Cliff coverage", urpName + "/FAE/FAE_Cliff_Coverage" },
{ "FAE/Water", urpName + "/FAE/FAE_Water" },
{ "FAE/Waterfall", urpName + "/FAE/FAE_Waterfall" },
{ "FAE/Waterfall foam", urpName + "/FAE/FAE_WaterfallFoam" },
{ "FAE/Foliage", urpName+ "/FAE/FAE_Foliage" },
{ "FAE/Tree Branch", urpName+ "/FAE/FAE_TreeBranch" },
{ "FAE/Tree Trunk", urpName+ "/FAE/FAE_TreeTrunk" },
{ "FAE/Tree Billboard", urpName+ "/FAE/FAE_TreeBillboard" }
};
[MenuItem("Edit/Render Pipeline/Fantasy Adventure Environment/Revert to Built-in")]
public static void InstallBuiltIn()
{
InstallShaders(ShaderInstallation.BuiltIn);
}
[MenuItem("Edit/Render Pipeline/Fantasy Adventure Environment/Convert to URP")]
public static void InstallURP()
{
#if UNITY_2019_3_OR_NEWER && FAE_DEV
SwitchRenderPipeline.SetPipeline(ShaderInstallation.UniversalRP);
#endif
if (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null)
{
if (EditorUtility.DisplayDialog("Fantasy Adventure Environment", "No URP asset has been assigned in the Graphics settings. URP should be set up, before converting the package.", "Show me", "Cancel"))
{
SettingsService.OpenProjectSettings("Project/Graphics");
return;
}
}
InstallShaders(ShaderInstallation.UniversalRP);
}
public static void InstallShaders(ShaderInstallation config)
{
string guid = UniversalShaderPackageGUID;
string packagePath = AssetDatabase.GUIDToAssetPath(guid);
GetRootFolder();
//TODO: Package up current shaders
if (config == ShaderInstallation.BuiltIn)
{
//AssetDatabase.ExportPackage(PACKAGE_ROOT_FOLDER + "/Shaders/URP", packagePath, ExportPackageOptions.Default | ExportPackageOptions.Recurse);
UpgradeMaterials(config);
}
else
{
if (packagePath == string.Empty)
{
Debug.LogError("URP Shader/material package with the GUID: " + guid + ". Could not be found in the project, was it changed or not imported? It should be located in <i>" + PACKAGE_ROOT_FOLDER + "/Shaders/URP</i>");
return;
}
AssetDatabase.ImportPackage(packagePath, false);
AssetDatabase.importPackageCompleted += new AssetDatabase.ImportPackageCallback(ImportURPCallback);
}
#if UNITY_2019_3_OR_NEWER && FAE_DEV
SwitchRenderPipeline.SetPipeline(config);
#endif
}
static void ImportURPCallback(string packageName)
{
AssetDatabase.Refresh();
UpgradeMaterials(ShaderInstallation.UniversalRP);
AssetDatabase.importPackageCompleted -= ImportURPCallback;
}
public static void UpgradeMaterials(ShaderInstallation config)
{
string[] GUIDs = AssetDatabase.FindAssets("t: material", new string[] { PACKAGE_ROOT_FOLDER });
int count = 0;
if (GUIDs.Length > 0)
{
Material[] mats = new Material[GUIDs.Length];
for (int i = 0; i < mats.Length; i++)
{
EditorUtility.DisplayProgressBar("Material configuration", "Converting FAE materials for " + config, (float)i / mats.Length);
string path = AssetDatabase.GUIDToAssetPath(GUIDs[i]);
mats[i] = (Material)AssetDatabase.LoadAssetAtPath(path, typeof(Material));
string dest = string.Empty;
string source = mats[i].shader.name;
bool matched = ShaderRelations.TryGetValue(source, out dest);
if (config == ShaderInstallation.BuiltIn)
{
//Get key by value (inverse lookup)
dest = ShaderRelations.FirstOrDefault(x => x.Value == source).Key;
matched = dest != null;
}
if (config == ShaderInstallation.UniversalRP)
{
//Set grass to foliage shader
if (source == "FAE/Grass")
{
dest = urpName + "/FAE/FAE_Foliage";
matched = true;
}
}
if (config == ShaderInstallation.BuiltIn)
{
//Set foliage to grass shader
if (mats[i].name.Contains("Grass"))
{
dest = "FAE/Grass";
matched = true;
}
}
if (source == null && dest == null) continue;
if (string.Equals(dest, source)) continue;
if (matched)
{
if (config == ShaderInstallation.UniversalRP)
{
Texture mainTex = null;
if (mats[i].HasProperty("_MainTex")) mainTex = mats[i].GetTexture("_MainTex");
if (mats[i].HasProperty("_Color")) mats[i].SetColor("_BaseColor", mats[i].GetColor("_Color"));
if (mats[i].HasProperty("_TintColor")) mats[i].SetColor("_BaseColor", mats[i].GetColor("_TintColor"));
//Grass to foliage switch
if (mats[i].HasProperty("_ColorTop")) mats[i].SetColor("_Color", mats[i].GetColor("_ColorTop"));
if (mats[i].HasProperty("_MainTex"))
{
mats[i].SetTexture("_BaseMap", mainTex);
}
if (mats[i].name.Contains("Grass"))
{
mats[i].SetFloat("_MaxWindStrength", 0.2f);
mats[i].SetFloat("_AmbientOcclusion", 0.15f);
}
mats[i].shader = Shader.Find(dest);
if (mainTex) mats[i].SetTexture("_BaseMap", mainTex);
}
if (mats[i].HasProperty("_TransmissionAmount"))
{
mats[i].SetFloat("_TransmissionAmount", Mathf.Clamp(mats[i].GetFloat("_TransmissionAmount"), 0, 10));
}
//Debug.Log("src: " + source + " dst:" + dest);
mats[i].shader = Shader.Find(dest);
EditorUtility.SetDirty(mats[i]);
count++;
}
else
{
#if FAE_DEV
Debug.LogError("No matching " + config + " shader could be found for " + mats[i].shader.name);
#endif
}
}
EditorUtility.ClearProgressBar();
Debug.Log(count + " materials were configured for the " + config + " render pipeline");
AssetDatabase.Refresh();
AssetDatabase.SaveAssets();
if (config == ShaderInstallation.UniversalRP)
{
delayTime = (float)EditorApplication.timeSinceStartup + renameDelaySec;
EditorApplication.update += PostURPConversion;
}
}
}
private static float delayTime;
private const float renameDelaySec = 1f;
private static void PostURPConversion()
{
//Wait 1s
if (EditorApplication.timeSinceStartup >= delayTime)
{
EditorApplication.update -= PostURPConversion;
//If any controllers are present in the open scene, these need to be nudged to apply the correct shaders
CliffAppearance[] cliffControllers = GameObject.FindObjectsOfType<CliffAppearance>();
for (int i = 0; i < cliffControllers.Length; i++)
{
cliffControllers[i].OnEnable();
}
string[] shaderFileGUIDS = AssetDatabase.FindAssets("t: Shader", new[] {PACKAGE_ROOT_FOLDER + "/Shaders/URP"});
//Force a re-import of the Shader Graphs, depending on the angle of the sun, and the orbit of Jupiter, they fail to reference the FAE.hlsl file if imported last
for (int i = 0; i < shaderFileGUIDS.Length; i++)
{
AssetDatabase.ImportAsset(AssetDatabase.GUIDToAssetPath(shaderFileGUIDS[i]));
}
if (EditorUtility.DisplayDialog("Fantasy Adventure Environment", "Ensure the Depth/Opaque Texture options are enabled in your pipeline settings, otherwise the water isn't visible in the game view", "Show me", "OK"))
{
Selection.activeObject = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
}
AssetDatabase.SaveAssets();
}
}
#endif
}
}//namespace

View File

@@ -0,0 +1,230 @@
// Fantasy Adventure Environment
// Copyright Staggart Creations
// staggart.xyz
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace FAE
{
public class FoliageShaderGUI : ShaderGUI
{
MaterialProperty _MaskClipValue;
//Main maps
MaterialProperty _MainTex;
MaterialProperty _BumpMap;
MaterialProperty _Color;
//Color
MaterialProperty _WindTint;
MaterialProperty _AmbientOcclusion;
MaterialProperty _TransmissionSize;
MaterialProperty _TransmissionAmount;
//Animation
MaterialProperty _MaxWindStrength;
MaterialProperty _GlobalWindMotion;
MaterialProperty _LeafFlutter;
MaterialProperty _WindAmplitudeMultiplier;
MaterialProperty _WindSwinging;
MaterialProperty _BendingInfluence;
MaterialEditor m_MaterialEditor;
private Material targetMat;
//Meta
bool showHelp;
bool showHelpColor;
bool showHelpAnimation;
bool hasWindController;
WindController windController;
GUIContent mainTexName = new GUIContent("Diffuse", "Diffuse (RGB) and Transparency (A)");
GUIContent normalMapName = new GUIContent("Normal Map");
private bool visualizeVectors;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
{
if (windController == null) LocateWindController();
//Receive
visualizeVectors = WindController._visualizeVectors;
this.m_MaterialEditor = materialEditor;
targetMat = (Material)materialEditor.target;
this.FindProperties(props);
//Style similar to Standard shader
m_MaterialEditor.SetDefaultGUIWidths();
m_MaterialEditor.UseDefaultMargins();
EditorGUIUtility.labelWidth = 0f;
#if UNITY_2019_3_OR_NEWER
if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline != null &&
!targetMat.shader.name.Contains("Universal Render Pipeline"))
{
EditorGUILayout.HelpBox("A render pipeline is in use, but this material is using a shader for the Built-in render pipeline.\n\nShaders and materials can be converted through the Help window", MessageType.Error);
EditorGUILayout.Space();
}
#endif
EditorGUI.BeginChangeCheck();
//Draw fields
DoHeader();
DoMapsArea();
DoColorArea();
DoAnimationArea();
if (EditorGUI.EndChangeCheck())
{
//Send
WindController.VisualizeVectors(visualizeVectors);
}
GUIHelper.DrawExtraFields(m_MaterialEditor);
GUIHelper.DrawFooter();
}
void DoHeader()
{
EditorGUILayout.BeginHorizontal();
showHelp = GUILayout.Toggle(showHelp, "Toggle help", "Button");
GUILayout.Label("FAE Foliage Shader", GUIHelper.Header);
EditorGUILayout.EndHorizontal();
if (showHelp) EditorGUILayout.HelpBox("Please bear in mind, when using custom meshes, that most shader feature require the tips of the mesh to be vertex colored.\n\nBaking Ambient Occlusion into the vertex colors will yield correct results.", MessageType.Warning);
}
void DoMapsArea()
{
GUILayout.Label("Main maps", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(_MaskClipValue.displayName);
_MaskClipValue.floatValue = EditorGUILayout.Slider(_MaskClipValue.floatValue, 0f, 1f);
EditorGUILayout.EndHorizontal();
this.m_MaterialEditor.TexturePropertySingleLine(mainTexName, this._MainTex);
if(targetMat.HasProperty("_BumpMap"))this.m_MaterialEditor.TexturePropertySingleLine(normalMapName, this._BumpMap);
EditorGUILayout.Space();
}
void DoColorArea()
{
EditorGUILayout.BeginHorizontal();
showHelpColor = GUILayout.Toggle(showHelpColor, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Color", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
m_MaterialEditor.ShaderProperty(_Color, _Color.displayName);
m_MaterialEditor.ShaderProperty(_AmbientOcclusion, _AmbientOcclusion.displayName);
if (showHelpColor) EditorGUILayout.HelpBox("Darkens the areas of the mesh where vertex colors are applied", MessageType.None);
m_MaterialEditor.ShaderProperty(_TransmissionAmount, _TransmissionAmount.displayName);
if (showHelpColor) EditorGUILayout.HelpBox("Simulates light passing through the material. This will have no effect on short grass.", MessageType.None);
m_MaterialEditor.ShaderProperty(_TransmissionSize, _TransmissionSize.displayName);
EditorGUILayout.Space();
}
void DoAnimationArea()
{
EditorGUILayout.BeginHorizontal();
showHelpAnimation = GUILayout.Toggle(showHelpAnimation, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Wind animation", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
#if UNITY_2019_3_OR_NEWER
if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline == null)
{
#endif
visualizeVectors = EditorGUILayout.Toggle("Visualize wind", visualizeVectors);
#if UNITY_2019_3_OR_NEWER
}
#endif
#if !VEGETATION_STUDIO_PRO //VS Pro has an FAE wind controller
if (!hasWindController)
{
EditorGUILayout.HelpBox("No \"WindController\" component was found in your scene. Please add this script to an empty GameObject\n\nA prefab can be found in the Prefabs/Effects folder.", MessageType.Warning);
EditorGUI.BeginDisabledGroup(true);
}
#else
EditorGUI.BeginDisabledGroup(false);
#endif
if (showHelpAnimation) EditorGUILayout.HelpBox("Toggle a visualisation of the wind vectors on all the objects that use FAE shaders featuring wind.\n\nThis allows you to more clearly see the effects of the settings.", MessageType.None);
m_MaterialEditor.ShaderProperty(_MaxWindStrength, _MaxWindStrength.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Determines how much influence the wind has on the object", MessageType.None);
m_MaterialEditor.ShaderProperty(_GlobalWindMotion, _GlobalWindMotion.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Back and forth motion", MessageType.None);
m_MaterialEditor.ShaderProperty(_LeafFlutter, _LeafFlutter.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Local wind turbulence", MessageType.None);
m_MaterialEditor.ShaderProperty(_WindAmplitudeMultiplier, _WindAmplitudeMultiplier.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Multiply the wind amplitude for this material.Essentally this is the size of the wind waves.", MessageType.None);
m_MaterialEditor.ShaderProperty(_WindSwinging, _WindSwinging.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Higher values mean the object always sways back against the wind direction", MessageType.None);
if (targetMat.HasProperty("_WindTint"))
{
m_MaterialEditor.ShaderProperty(_WindTint, _WindTint.displayName);
if (showHelpAnimation)
EditorGUILayout.HelpBox("Vizualises the wind by adding a slight tint, either dark (<0) or light (>0)", MessageType.None);
}
if (showHelpAnimation) EditorGUILayout.HelpBox("Multiply the wind amplitude for this material. Essentally this is the size of the wind waves.", MessageType.None);
if (!hasWindController)
{
EditorGUI.EndDisabledGroup();
}
m_MaterialEditor.ShaderProperty(_BendingInfluence, _BendingInfluence.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Determines how much influence the FoliageBender script has on the object", MessageType.None);
if (hasWindController && showHelpAnimation)
{
GUIHelper.DrawWindInfo();
}
EditorGUILayout.Space();
}
void LocateWindController()
{
//Debug.Log("Searching scene for WindController script");
windController = GameObject.FindObjectOfType<WindController>();
hasWindController = (windController) ? true : false;
}
public void FindProperties(MaterialProperty[] props)
{
//Rendering
#if UNITY_2017_1_OR_NEWER
_MaskClipValue = FindProperty("_Cutoff", props);
#else
_MaskClipValue = FindProperty("_Cutoff", props);
#endif
//Main maps
_MainTex = FindProperty("_MainTex", props);
if(targetMat.HasProperty("_BumpMap")) _BumpMap = FindProperty("_BumpMap", props);
//Color
if(targetMat.HasProperty("_WindTint")) _WindTint = FindProperty("_WindTint", props);
_Color = FindProperty("_Color", props);
_AmbientOcclusion = FindProperty("_AmbientOcclusion", props);
_TransmissionSize = FindProperty("_TransmissionSize", props);
_TransmissionAmount = FindProperty("_TransmissionAmount", props);
//Animation
_MaxWindStrength = FindProperty("_MaxWindStrength", props);
_GlobalWindMotion = FindProperty("_GlobalWindMotion", props);
_LeafFlutter = FindProperty("_LeafFlutter", props);
_WindAmplitudeMultiplier = FindProperty("_WindAmplitudeMultiplier", props);
_WindSwinging = FindProperty("_WindSwinging", props);
_BendingInfluence = FindProperty("_BendingInfluence", props);
}
}
}

View File

@@ -0,0 +1,75 @@
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace FAE
{
/// <summary>
/// Helper class to centralize commonly used fields and styles used in inspectors
/// </summary>
public class GUIHelper : Editor
{
/// <summary>Draws the Staggart Creations footer</summary>
public static void DrawFooter()
{
GUILayout.Label("- Staggart Creations -", new GUIStyle(EditorStyles.centeredGreyMiniLabel)
{
alignment = TextAnchor.MiddleCenter,
wordWrap = true,
fontSize = 12
});
}
/// <summary>Displays a box with the wind values from the current WindController</summary>
public static void DrawWindInfo()
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("Global wind settings", EditorStyles.boldLabel);
GUIHelper.ProgressBar(WindController._windStrength, 1f, "Strength");
GUIHelper.ProgressBar(WindController._windAmplitude, 32f, "Amplitude");
EditorGUILayout.Space();
}
private static void ProgressBar(float value, float maxValue, string label)
{
Rect rect = GUILayoutUtility.GetRect(6, 18, "TextField");
EditorGUI.ProgressBar(rect, value / maxValue, label + " (" + value + " / " + maxValue + ")");
}
/// <summary>If the supported Unity version is used, a field for setting the Render Queue and GPU Instancing options is drawn</summary>
public static void DrawExtraFields(MaterialEditor m_MaterialEditor)
{
#if UNITY_5_5_OR_NEWER
m_MaterialEditor.RenderQueueField();
#endif
#if UNITY_5_6_OR_NEWER
m_MaterialEditor.EnableInstancingField();
#endif
}
//Styles
private static GUIStyle _Header;
public static GUIStyle Header
{
get
{
if (_Header == null)
{
_Header = new GUIStyle(EditorStyles.centeredGreyMiniLabel)
{
alignment = TextAnchor.MiddleCenter,
wordWrap = true,
fontSize = 12
};
}
return _Header;
}
}
}
}

View File

@@ -0,0 +1,352 @@
// Fantasy Adventure Environment
// Copyright Staggart Creations
// staggart.xyz
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace FAE
{
[ExecuteInEditMode]
public class GrassShaderGUI : ShaderGUI
{
MaterialProperty _MaskClipValue;
//Main maps
MaterialProperty _MainTex;
MaterialProperty _BumpMap;
//Color
MaterialProperty _ColorTop;
MaterialProperty _ColorBottom;
MaterialProperty _ColorVariation;
MaterialProperty _AmbientOcclusion;
MaterialProperty _TransmissionSize;
MaterialProperty _TransmissionAmount;
//Animation
MaterialProperty _MaxWindStrength;
MaterialProperty _WindSwinging;
MaterialProperty _WindAmplitudeMultiplier;
MaterialProperty _BendingInfluence;
//VS Touch Bend
#if TOUCH_REACT
MaterialProperty _VS_TOUCHBEND;
MaterialProperty _BendingTint;
#endif
//Heightmap
MaterialProperty _HeightmapInfluence;
MaterialProperty _MinHeight;
MaterialProperty _MaxHeight;
//Pigment map
MaterialProperty _PigmentMapInfluence;
MaterialProperty _PigmentMapHeight;
MaterialEditor m_MaterialEditor;
//Meta
bool showHelp;
bool showHelpColor;
bool showHelpAnimation;
bool showHelpBending;
bool showHelpHeightmap;
bool showHelpPigmentmap;
#if UNITY_5_5_OR_NEWER
bool hasPigmentMap = true;
#endif
bool hasWindController;
WindController windController;
GUIContent mainTexName = new GUIContent("Diffuse", "Diffuse (RGB) and Transparency (A)");
GUIContent normalMapName = new GUIContent("Normal Map");
private bool visualizeVectors;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
{
if (windController == null) LocateWindController();
this.FindProperties(props);
//Receive
visualizeVectors = WindController._visualizeVectors;
this.m_MaterialEditor = materialEditor;
//Style similar to Standard shader
m_MaterialEditor.SetDefaultGUIWidths();
m_MaterialEditor.UseDefaultMargins();
EditorGUIUtility.labelWidth = 0f;
//GetGlobalTexture is only available since Unity 5.5
#if UNITY_5_5_OR_NEWER
hasPigmentMap = (Shader.GetGlobalTexture("_PigmentMap")) ? true : false;
#endif
EditorGUI.BeginChangeCheck();
//Draw fields
DoHeader();
DoMapsArea();
DoColorArea();
DoAnimationArea();
DoBendingArea();
DoHeightmapArea();
DoPigmentMapArea();
if (EditorGUI.EndChangeCheck())
{
//Send
WindController.VisualizeVectors(visualizeVectors);
}
GUIHelper.DrawExtraFields(m_MaterialEditor);
GUIHelper.DrawFooter();
}
void DoHeader()
{
EditorGUILayout.BeginHorizontal();
showHelp = GUILayout.Toggle(showHelp, "Toggle help", "Button");
GUILayout.Label("FAE Grass Shader", GUIHelper.Header);
EditorGUILayout.EndHorizontal();
if (showHelp) EditorGUILayout.HelpBox("Please bear in mind, when using custom meshes, that most shader feature require the top of the mesh to be vertex colored.", MessageType.Warning);
}
void DoMapsArea()
{
GUILayout.Label("Main maps", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(_MaskClipValue.displayName);
_MaskClipValue.floatValue = EditorGUILayout.Slider(_MaskClipValue.floatValue, 0f, 1f);
EditorGUILayout.EndHorizontal();
this.m_MaterialEditor.TexturePropertySingleLine(mainTexName, this._MainTex);
this.m_MaterialEditor.TexturePropertySingleLine(normalMapName, this._BumpMap);
EditorGUILayout.Space();
}
void DoColorArea()
{
EditorGUILayout.BeginHorizontal();
showHelpColor = GUILayout.Toggle(showHelpColor, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Color", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
EditorGUI.BeginDisabledGroup(_PigmentMapInfluence.floatValue == 1);
m_MaterialEditor.ShaderProperty(_ColorTop, "Top");
m_MaterialEditor.ShaderProperty(_ColorBottom, "Bottom");
EditorGUI.EndDisabledGroup();
if (_PigmentMapInfluence.floatValue == 1)
{
EditorGUILayout.HelpBox("These colors are disabled because the pigment map influence value is set to 1, so they would have no effect", MessageType.None);
}
m_MaterialEditor.ShaderProperty(_ColorVariation, _ColorVariation.displayName);
if (showHelpColor) EditorGUILayout.HelpBox("Vizualises the wind by adding a slight white tint. When the wind strength is set 0, this effect doesn't appear", MessageType.None);
m_MaterialEditor.ShaderProperty(_AmbientOcclusion, _AmbientOcclusion.displayName);
if (showHelpColor) EditorGUILayout.HelpBox("Darkens the areas of the mesh where vertex colors are applied", MessageType.None);
m_MaterialEditor.ShaderProperty(_TransmissionAmount, _TransmissionAmount.displayName);
if (showHelpColor) EditorGUILayout.HelpBox("Simulates light passing through the material. This will have no effect on short grass.", MessageType.None);
m_MaterialEditor.ShaderProperty(_TransmissionSize, _TransmissionSize.displayName);
EditorGUILayout.Space();
}
void DoAnimationArea()
{
EditorGUILayout.BeginHorizontal();
showHelpAnimation = GUILayout.Toggle(showHelpAnimation, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Wind animation", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
visualizeVectors = EditorGUILayout.Toggle("Visualize wind", visualizeVectors);
#if !VEGETATION_STUDIO_PRO //VS Pro has an FAE wind controller
if (!hasWindController)
{
EditorGUILayout.HelpBox("No \"WindController\" component was found in your scene. Please add this script to an empty GameObject\n\nA prefab can be found in the Prefabs/Effects folder.", MessageType.Warning);
EditorGUI.BeginDisabledGroup(true);
}
#else
EditorGUI.BeginDisabledGroup(false);
#endif
if (showHelpAnimation) EditorGUILayout.HelpBox("Toggle a visualisation of the wind vectors on all the objects that use FAE shaders featuring wind.\n\nThis allows you to more clearly see the effects of the settings.", MessageType.None);
m_MaterialEditor.ShaderProperty(_MaxWindStrength, _MaxWindStrength.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Determines how much influence the wind has on the object", MessageType.None);
m_MaterialEditor.ShaderProperty(_WindSwinging, _WindSwinging.displayName);
if (showHelpAnimation) EditorGUILayout.HelpBox("Higher values mean the object always sways back against the wind direction", MessageType.None);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(_WindAmplitudeMultiplier.displayName);
_WindAmplitudeMultiplier.floatValue = EditorGUILayout.FloatField(_WindAmplitudeMultiplier.floatValue, GUILayout.Width(65f));
EditorGUILayout.EndHorizontal();
if (showHelpAnimation) EditorGUILayout.HelpBox("Multiply the wind amplitude for this material. Essentally this is the size of the wind waves.", MessageType.None);
if (!hasWindController)
{
EditorGUI.EndDisabledGroup();
}
if (hasWindController && showHelpAnimation)
{
GUIHelper.DrawWindInfo();
}
EditorGUILayout.Space();
}
void DoBendingArea()
{
EditorGUILayout.BeginHorizontal();
showHelpBending = GUILayout.Toggle(showHelpBending, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Bending", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
#if TOUCH_REACT
m_MaterialEditor.ShaderProperty(_VS_TOUCHBEND, new GUIContent("Use Vegetation Studio TouchBend"));
if (showHelpBending) EditorGUILayout.HelpBox("Utilize Vegetation Studio's TouchBendSystem", MessageType.None);
if (_VS_TOUCHBEND.floatValue == 1)
{
m_MaterialEditor.ShaderProperty(_BendingTint, _BendingTint.displayName);
if (showHelpBending) EditorGUILayout.HelpBox("Darken the grass where it is bending", MessageType.None);
}
else
#endif
{
m_MaterialEditor.ShaderProperty(_BendingInfluence, _BendingInfluence.displayName);
if (showHelpBending) EditorGUILayout.HelpBox("Determines how much influence the FoliageBender script has on the object", MessageType.None);
}
EditorGUILayout.Space();
}
void LocateWindController()
{
//Debug.Log("Searching scene for WindController script");
windController = GameObject.FindObjectOfType<WindController>();
hasWindController = (windController) ? true : false;
}
void DoHeightmapArea()
{
EditorGUILayout.BeginHorizontal();
showHelpHeightmap = GUILayout.Toggle(showHelpHeightmap, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Heightmap", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
#if UNITY_5_5_OR_NEWER
if(!hasPigmentMap)
{
EditorGUILayout.HelpBox("No height map was found, please add the PigmentMapGenerator script to your terrain to enable these features", MessageType.Warning);
_HeightmapInfluence.floatValue = 0;
EditorGUI.BeginDisabledGroup(true);
}
#endif
if (showHelpHeightmap) EditorGUILayout.HelpBox("The heightmap is generated through the PigmentMapGenerator script on your terrain", MessageType.None);
m_MaterialEditor.ShaderProperty(_HeightmapInfluence, "Influence");
if (showHelpHeightmap) EditorGUILayout.HelpBox("Determines the influence the heightmap has on the object", MessageType.None);
m_MaterialEditor.ShaderProperty(_MinHeight, _MinHeight.displayName);
if (showHelpHeightmap) EditorGUILayout.HelpBox("Minimum grass height", MessageType.None);
m_MaterialEditor.ShaderProperty(_MaxHeight, _MaxHeight.displayName);
if (showHelpHeightmap) EditorGUILayout.HelpBox("Maximum grass height", MessageType.None);
EditorGUILayout.Space();
#if UNITY_5_5_OR_NEWER
if (!hasPigmentMap)
{
EditorGUI.EndDisabledGroup();
}
#endif
}
void DoPigmentMapArea()
{
EditorGUILayout.BeginHorizontal();
showHelpPigmentmap = GUILayout.Toggle(showHelpPigmentmap, "?", "Button", GUILayout.Width(25f)); GUILayout.Label("Pigment map", EditorStyles.boldLabel);
EditorGUILayout.EndHorizontal();
#if UNITY_5_5_OR_NEWER
if(!hasPigmentMap)
{
EditorGUILayout.HelpBox("No pigment map was found, please add the PigmentMapGenerator script to your terrain to enable these features", MessageType.Warning);
_PigmentMapInfluence.floatValue = 0;
EditorGUI.BeginDisabledGroup(true);
}
#endif
if (showHelpPigmentmap) EditorGUILayout.HelpBox("The pigment map is generated through the PigmentMapGenerator script on your terrain. It colors the grass by the terrain's color.", MessageType.None);
m_MaterialEditor.ShaderProperty(_PigmentMapInfluence, "Influence");
if (showHelpPigmentmap) EditorGUILayout.HelpBox("Determines how much the object should be colored through the pigment map", MessageType.None);
m_MaterialEditor.ShaderProperty(_PigmentMapHeight, "Height");
if (showHelpPigmentmap) EditorGUILayout.HelpBox("With this parameter you can choose to only color the base of the grass", MessageType.None);
EditorGUILayout.Space();
if (showHelpPigmentmap) EditorGUILayout.HelpBox("If your grass is completely white, bring the Influence parameter to 0. Or add the PigmentmapGenerator script to your terrain.", MessageType.Info);
#if UNITY_5_4 && !UNITY_5_5_OR_NEWER
if (showHelpPigmentmap) EditorGUILayout.HelpBox("In versions older than Unity 5.5, it is possible for your grass to still be colored by the last pigment map generated", MessageType.Info);
#endif
EditorGUILayout.Space();
#if UNITY_5_5_OR_NEWER
if (!hasPigmentMap)
{
EditorGUI.EndDisabledGroup();
}
#endif
}
public void FindProperties(MaterialProperty[] props)
{
//Rendering
_MaskClipValue = FindProperty("_Cutoff", props);
//Main maps
_MainTex = FindProperty("_MainTex", props);
_BumpMap = FindProperty("_BumpMap", props);
//Color
_ColorTop = FindProperty("_ColorTop", props);
_ColorBottom = FindProperty("_ColorBottom", props);
_ColorVariation = FindProperty("_ColorVariation", props);
_AmbientOcclusion = FindProperty("_AmbientOcclusion", props);
_TransmissionSize = FindProperty("_TransmissionSize", props);
_TransmissionAmount = FindProperty("_TransmissionAmount", props);
//Animation
_MaxWindStrength = FindProperty("_MaxWindStrength", props);
_WindSwinging = FindProperty("_WindSwinging", props);
_WindAmplitudeMultiplier = FindProperty("_WindAmplitudeMultiplier", props);
_BendingInfluence = FindProperty("_BendingInfluence", props);
#if TOUCH_REACT
//TouchBend
_VS_TOUCHBEND = FindProperty("_VS_TOUCHBEND", props);
_BendingTint = FindProperty("_BendingTint", props);
#endif
//Heightmap
_HeightmapInfluence = FindProperty("_HeightmapInfluence", props);
_MinHeight = FindProperty("_MinHeight", props);
_MaxHeight = FindProperty("_MaxHeight", props);
//Pigment map
_PigmentMapInfluence = FindProperty("_PigmentMapInfluence", props);
_PigmentMapHeight = FindProperty("_PigmentMapHeight", props);
}
}
}

View File

@@ -0,0 +1,342 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace FAE
{
public class HelpWindow : EditorWindow
{
//Window properties
private static int width = 440;
private static int height = 300;
private bool isTabInstallation = true;
private bool isTabGettingStarted = false;
private bool isTabSupport = false;
[MenuItem("Help/Fantasy Adventure Environment", false, 0)]
public static void ShowWindow()
{
EditorWindow editorWindow = EditorWindow.GetWindow<HelpWindow>(false, "About", true);
editorWindow.titleContent = new GUIContent("Help " + FAE_Core.INSTALLED_VERSION);
editorWindow.autoRepaintOnSceneChange = true;
//Open somewhat in the center of the screen
editorWindow.position = new Rect((Screen.width) / 2f, (Screen.height) / 2f, width, height);
//Fixed size
editorWindow.maxSize = new Vector2(width, height);
editorWindow.minSize = new Vector2(width, 200);
Init();
editorWindow.Show();
}
private void SetWindowHeight(float height)
{
this.maxSize = new Vector2(width, height);
this.minSize = new Vector2(width, height);
}
//Store values in the volatile SessionState
static void Init()
{
FAE_Core.GetRootFolder();
}
void OnGUI()
{
DrawHeader();
GUILayout.Space(5);
DrawTabs();
GUILayout.Space(5);
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
if (isTabInstallation) DrawInstallation();
if (isTabGettingStarted) DrawGettingStarted();
if (isTabSupport) DrawSupport();
//DrawActionButtons();
EditorGUILayout.EndVertical();
DrawFooter();
}
void DrawHeader()
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("<b><size=24>Fantasy Adventure Environment</size></b>", Header);
GUILayout.Label("Version: " + FAE_Core.INSTALLED_VERSION, Footer);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
}
void DrawTabs()
{
EditorGUILayout.BeginHorizontal();
if (GUILayout.Toggle(isTabInstallation, "Installation", Tab))
{
isTabInstallation = true;
isTabGettingStarted = false;
isTabSupport = false;
}
if (GUILayout.Toggle(isTabGettingStarted, "Getting started", Tab))
{
isTabInstallation = false;
isTabGettingStarted = true;
isTabSupport = false;
}
if (GUILayout.Toggle(isTabSupport, "Support", Tab))
{
isTabInstallation = false;
isTabGettingStarted = false;
isTabSupport = true;
}
EditorGUILayout.EndHorizontal();
}
void DrawInstallation()
{
SetWindowHeight(335);
EditorGUILayout.LabelField("Render pipeline conversion", EditorStyles.boldLabel);
#if !UNITY_2019_3_OR_NEWER
EditorGUILayout.HelpBox("Universal Render Pipeline support requires Unity 2019.3.7f1 or newer", MessageType.Info);
#else
if (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null)
{
EditorGUILayout.HelpBox("No Scriptable Render Pipeline is currently active", MessageType.Warning);
}
#if FAE_DEV
EditorGUILayout.BeginHorizontal();
{
if (GUILayout.Button("<b><size=16>Built-in</size></b>\n<i>Amplify Shader Editor shaders</i>", Button))
{
FAE_Core.InstallShaders(FAE_Core.ShaderInstallation.BuiltIn);
}
#endif
using (new EditorGUI.DisabledGroupScope(UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null))
{
if (GUILayout.Button("<b><size=16>Universal Render Pipeline</size></b>\n<i>Unpack Shader Graph shaders and URP materials</i>", Button))
{
FAE_Core.InstallShaders(FAE_Core.ShaderInstallation.UniversalRP);
}
}
#if FAE_DEV
}
EditorGUILayout.EndHorizontal();
#endif
EditorGUILayout.Space();
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.HelpBox("Note: Grass shader for the URP is available on the Asset Store", MessageType.Info);
if (GUILayout.Button("Open Asset Store", GUILayout.Height(40f), GUILayout.Width(120f)))
{
Application.OpenURL("https://assetstore.unity.com/packages/vfx/shaders/stylized-grass-shader-143830?aid=1011l7Uk8&pubref=fae-editor");
}
}
#endif
}
void DrawGettingStarted()
{
SetWindowHeight(335);
EditorGUILayout.HelpBox("Please view the documentation for further details about this package and its workings.", MessageType.Info);
EditorGUILayout.Space();
if (GUILayout.Button("<b><size=16>Online documentation</size></b>\n<i>Set up, best practices and troubleshooting</i>", Button))
{
Application.OpenURL(FAE_Core.DOC_URL + "#getting-started-3");
}
}
void DrawSupport()
{
SetWindowHeight(350f);
EditorGUILayout.BeginVertical(); //Support box
EditorGUILayout.HelpBox("If you have any questions, or ran into issues, please get in touch!", MessageType.Info);
EditorGUILayout.Space();
//Buttons box
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("<b><size=12>Email</size></b>\n<i>Contact</i>", Button))
{
Application.OpenURL("mailto:contact@staggart.xyz");
}
if (GUILayout.Button("<b><size=12>Twitter</size></b>\n<i>Follow developments</i>", Button))
{
Application.OpenURL("https://twitter.com/search?q=staggart%20creations");
}
if (GUILayout.Button("<b><size=12>Forum</size></b>\n<i>Join the discussion</i>", Button))
{
Application.OpenURL(FAE_Core.FORUM_URL);
}
EditorGUILayout.EndHorizontal();//Buttons box
EditorGUILayout.EndVertical(); //Support box
}
private void DrawActionButtons()
{
EditorGUILayout.Space();
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("<size=12>Rate</size>", Button))
Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/account/downloads/search=");
if (GUILayout.Button("<size=12>Review</size>", Button))
Application.OpenURL("");
EditorGUILayout.EndHorizontal();
EditorGUILayout.Space();
}
private void DrawFooter()
{
//EditorGUILayout.Space();
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.Space();
GUILayout.Label("- Staggart Creations -", Footer);
}
#region Styles
private static GUIStyle _Footer;
public static GUIStyle Footer
{
get
{
if (_Footer == null)
{
_Footer = new GUIStyle(EditorStyles.centeredGreyMiniLabel)
{
alignment = TextAnchor.MiddleCenter,
wordWrap = true,
fontSize = 12
};
}
return _Footer;
}
}
private static GUIStyle _Button;
public static GUIStyle Button
{
get
{
if (_Button == null)
{
_Button = new GUIStyle(GUI.skin.button)
{
alignment = TextAnchor.MiddleLeft,
stretchWidth = true,
richText = true,
wordWrap = true,
padding = new RectOffset()
{
left = 14,
right = 14,
top = 8,
bottom = 8
}
};
}
return _Button;
}
}
private static GUIStyle _Header;
public static GUIStyle Header
{
get
{
if (_Header == null)
{
_Header = new GUIStyle(GUI.skin.label)
{
richText = true,
alignment = TextAnchor.MiddleCenter,
wordWrap = true,
fontSize = 18,
fontStyle = FontStyle.Bold
};
}
return _Header;
}
}
private static Texture _HelpIcon;
public static Texture HelpIcon
{
get
{
if (_HelpIcon == null)
{
_HelpIcon = EditorGUIUtility.FindTexture("d_UnityEditor.InspectorWindow");
}
return _HelpIcon;
}
}
private static GUIStyle _Tab;
public static GUIStyle Tab
{
get
{
if (_Tab == null)
{
_Tab = new GUIStyle(EditorStyles.miniButtonMid)
{
alignment = TextAnchor.MiddleCenter,
stretchWidth = true,
richText = true,
wordWrap = true,
fontSize = 12,
fixedHeight = 30f,
fontStyle = FontStyle.Bold,
padding = new RectOffset()
{
left = 14,
right = 14,
top = 8,
bottom = 8
}
};
}
return _Tab;
}
}
#endregion //Stylies
}//Window Class
}

Some files were not shown because too many files have changed in this diff Show More