add scriptable object examples

add editor window example
add attribute + drawer example
This commit is contained in:
2025-06-13 18:07:18 +02:00
parent 0ae837c57b
commit a6dbfb224f
52 changed files with 1460 additions and 533 deletions
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7247052ccbf40494baed0f96685960bc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,521 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1070464673572517117
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6402465022401023432}
- component: {fileID: 8462721943427211658}
- component: {fileID: 3400850292469697201}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6402465022401023432
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1070464673572517117}
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: 4546649371236786253}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: 0}
m_SizeDelta: {x: 100, y: -20}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &8462721943427211658
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1070464673572517117}
m_CullTransparentMesh: 1
--- !u!114 &3400850292469697201
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1070464673572517117}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Health
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 26.85
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2579194692164950010
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5888282015079485259}
- component: {fileID: 7821883956305731368}
- component: {fileID: 5456567689598585164}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5888282015079485259
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2579194692164950010}
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: 9173085994629263686}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7821883956305731368
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2579194692164950010}
m_CullTransparentMesh: 1
--- !u!114 &5456567689598585164
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2579194692164950010}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Dead
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 26.85
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 17
m_HorizontalAlignment: 2
m_VerticalAlignment: 8192
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4142228742273787134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4546649371236786253}
- component: {fileID: 5354447802709037003}
- component: {fileID: 2935142698302731753}
- component: {fileID: 1555765786663984211}
m_Layer: 5
m_Name: HealthBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4546649371236786253
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4142228742273787134}
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: 6402465022401023432}
- {fileID: 9173085994629263686}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: -10}
m_SizeDelta: {x: 330, y: 50}
m_Pivot: {x: 0, y: 1}
--- !u!222 &5354447802709037003
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4142228742273787134}
m_CullTransparentMesh: 1
--- !u!114 &2935142698302731753
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4142228742273787134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1555765786663984211
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4142228742273787134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a98df6e31c94df993b83fcfbf7111e6, type: 3}
m_Name:
m_EditorClassIdentifier:
eventBroker: {fileID: 11400000, guid: 3f0ac1d79c88a4b7c8ff3c05e8b3a96e, type: 2}
maxHealth: {fileID: 11400000, guid: 57bc6db9af087491e819cc8c6802fc38, type: 2}
health: {fileID: 11400000, guid: 39d766df1e49f4f39a66eb9f40c1a326, type: 2}
fillingImage: {fileID: 6517050666981958359}
deadText: {fileID: 5456567689598585164}
--- !u!1 &7565880122607871686
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9173085994629263686}
- component: {fileID: 8660223812177649529}
- component: {fileID: 8478712239049725673}
m_Layer: 5
m_Name: HealthBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &9173085994629263686
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7565880122607871686}
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: 8043907806429562635}
- {fileID: 5888282015079485259}
m_Father: {fileID: 4546649371236786253}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -10, y: 0}
m_SizeDelta: {x: 200, y: -20}
m_Pivot: {x: 1, y: 0.5}
--- !u!222 &8660223812177649529
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7565880122607871686}
m_CullTransparentMesh: 1
--- !u!114 &8478712239049725673
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7565880122607871686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8872249888882285006
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8043907806429562635}
- component: {fileID: 8026777896975531635}
- component: {fileID: 6517050666981958359}
m_Layer: 5
m_Name: Filling
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8043907806429562635
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8872249888882285006}
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: 9173085994629263686}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &8026777896975531635
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8872249888882285006}
m_CullTransparentMesh: 1
--- !u!114 &6517050666981958359
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8872249888882285006}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 1, b: 0.12585473, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 408e5a183181244d2b58784e2120ec0b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,167 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2675275494874457661
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6243627945534082772}
- component: {fileID: 7864239582715792108}
- component: {fileID: 2026335564562150476}
- component: {fileID: 4000061670568050387}
- component: {fileID: 163136500847514136}
- component: {fileID: 5895690314969658453}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6243627945534082772
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7864239582715792108
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2026335564562150476
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &4000061670568050387
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!143 &163136500847514136
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Height: 2
m_Radius: 0.5
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &5895690314969658453
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2675275494874457661}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0047a716a65b04aedba74211b7d0dd43, type: 3}
m_Name:
m_EditorClassIdentifier:
eventBroker: {fileID: 11400000, guid: 3f0ac1d79c88a4b7c8ff3c05e8b3a96e, type: 2}
speed: 0
rotationSpeed: 0
characterAttributes: {fileID: 11400000, guid: 6f10cfd4eb3694b11a7de98345fec8b9, type: 2}
maxHealth: {fileID: 11400000, guid: 57bc6db9af087491e819cc8c6802fc38, type: 2}
health: {fileID: 11400000, guid: 39d766df1e49f4f39a66eb9f40c1a326, type: 2}
ability:
Name: Test
Value: 32
abilities:
- Name: Speed
Value: 2
- Name: Strength
Value: 32
- Name: Intelligence
Value: 12
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 67f0c4211b320453c8da1bbf1a40edd2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -256,83 +256,11 @@ MonoBehaviour:
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!1 &356724558
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 356724559}
- component: {fileID: 356724561}
- component: {fileID: 356724560}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &356724559
--- !u!224 &356724559 stripped
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
m_PrefabInstance: {fileID: 5744658404528951772}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 356724558}
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: 2068507217}
- {fileID: 1246611709}
m_Father: {fileID: 629767646}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: -10}
m_SizeDelta: {x: 330, y: 50}
m_Pivot: {x: 0, y: 1}
--- !u!114 &356724560
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 356724558}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &356724561
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 356724558}
m_CullTransparentMesh: 1
--- !u!1 &410087039
GameObject:
m_ObjectHideFlags: 0
@@ -605,457 +533,63 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &940291338
GameObject:
--- !u!1001 &1151603729
PrefabInstance:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 940291344}
- component: {fileID: 940291343}
- component: {fileID: 940291342}
- component: {fileID: 940291341}
- component: {fileID: 940291340}
- component: {fileID: 940291339}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &940291339
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0047a716a65b04aedba74211b7d0dd43, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 0
rotationSpeed: 0
maxHealth: 100
healthBarFillingImage: {fileID: 1472272814}
ability:
Name: Test
Value: 32
abilities:
- Name: Speed
Value: 2
- Name: Strength
Value: 32
- Name: Intelligence
Value: 12
_currentHealth: 0
--- !u!143 &940291340
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ProvidesContacts: 0
m_Enabled: 1
m_Modification:
serializedVersion: 3
m_Height: 2
m_Radius: 0.5
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0, z: 0}
--- !u!136 &940291341
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &940291342
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &940291343
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &940291344
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 940291338}
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1246611708
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1246611709}
- component: {fileID: 1246611711}
- component: {fileID: 1246611710}
m_Layer: 5
m_Name: HealthBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1246611709
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1246611708}
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: 1472272813}
m_Father: {fileID: 356724559}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -10, y: 0}
m_SizeDelta: {x: 200, y: -20}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &1246611710
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1246611708}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1246611711
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1246611708}
m_CullTransparentMesh: 1
--- !u!1 &1472272812
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1472272813}
- component: {fileID: 1472272815}
- component: {fileID: 1472272814}
m_Layer: 5
m_Name: Filling
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1472272813
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472272812}
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: 1246611709}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &1472272814
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472272812}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 1, b: 0.12585473, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1472272815
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472272812}
m_CullTransparentMesh: 1
--- !u!1 &2068507216
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2068507217}
- component: {fileID: 2068507219}
- component: {fileID: 2068507218}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2068507217
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068507216}
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: 356724559}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: 0}
m_SizeDelta: {x: 100, y: -20}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &2068507218
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068507216}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Health
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 26.85
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &2068507219
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068507216}
m_CullTransparentMesh: 1
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2675275494874457661, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6243627945534082772, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 67f0c4211b320453c8da1bbf1a40edd2, type: 3}
--- !u!1 &2144984568
GameObject:
m_ObjectHideFlags: 0
@@ -1135,6 +669,103 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &5744658404528951772
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 629767646}
m_Modifications:
- target: {fileID: 4142228742273787134, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_Name
value: HealthBar
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_SizeDelta.x
value: 330
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_SizeDelta.y
value: 50
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 10
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_AnchoredPosition.y
value: -10
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4546649371236786253, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 408e5a183181244d2b58784e2120ec0b, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
@@ -1142,6 +773,6 @@ SceneRoots:
- {fileID: 330585546}
- {fileID: 410087041}
- {fileID: 832575519}
- {fileID: 940291344}
- {fileID: 1151603729}
- {fileID: 629767646}
- {fileID: 2144984571}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d1b8d935f90154b0db35fac7c225ae87
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dc812ac8887bb4872a26d02b0bba3c56
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
%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: b61abb9f0ac44c59b3b2fd2042e9ace6, type: 3}
m_Name: Elbe
m_EditorClassIdentifier:
Name: Elbe
Health: 300
Strength: 5
StrengthMultiplier: 2
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6f10cfd4eb3694b11a7de98345fec8b9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
%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: b61abb9f0ac44c59b3b2fd2042e9ace6, type: 3}
m_Name: Knight
m_EditorClassIdentifier:
Name:
Health: 0
Strength: 0
StrengthMultiplier: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1b8fbdd8e1d82446e88b436db01cb77c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
%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: b61abb9f0ac44c59b3b2fd2042e9ace6, type: 3}
m_Name: Orc
m_EditorClassIdentifier:
Name: Orc
Health: 100
Strength: 10
StrengthMultiplier: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 58466ae83fcd148558d8fbf1d9fbd719
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
%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: b61abb9f0ac44c59b3b2fd2042e9ace6, type: 3}
m_Name: Troll
m_EditorClassIdentifier:
Name: Troll
Health: 500
Strength: 5
StrengthMultiplier: 0.5
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d97960c0750064c6e9b4073d8bdd4a76
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 703f36e53b8fa414d8bc2e5ba25f264a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
%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: fd75fdc6380d499a861c0efdba916acc, type: 3}
m_Name: MaxHealth
m_EditorClassIdentifier:
Value: 100
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57bc6db9af087491e819cc8c6802fc38
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c3aa969b83764441ab394a2278db027
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,14 @@
%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: c52cbf4a02ec44f3a6b94e25b84593d9, type: 3}
m_Name: EventBroker
m_EditorClassIdentifier:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3f0ac1d79c88a4b7c8ff3c05e8b3a96e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9627df4882fee483c91dd1b62c062893
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
%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: fd75fdc6380d499a861c0efdba916acc, type: 3}
m_Name: Health
m_EditorClassIdentifier:
Value: 100
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39d766df1e49f4f39a66eb9f40c1a326
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9af0d2fa264f4cc6bdd8c09bf2b52e57
timeCreated: 1749829795
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a2a86f13a318489c95e31e662cf4ccf8
timeCreated: 1749829930
@@ -0,0 +1,35 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Attributes.Editor
{
[CustomPropertyDrawer(typeof(RequireAttribute))]
public class RequireAttributeDrawer : PropertyDrawer
{
private readonly string HELPBOX_CONTENT = "Property has to be set!";
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
bool isNull = !property.objectReferenceValue;
if (isNull) position.height = EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(position, property, label);
if (isNull)
{
position.y += position.height + EditorGUIUtility.standardVerticalSpacing;
position.height = EditorStyles.helpBox.CalcHeight(new GUIContent(HELPBOX_CONTENT),
EditorGUIUtility.currentViewWidth) + 10.0f;
EditorGUI.HelpBox(position, HELPBOX_CONTENT, MessageType.Error);
}
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
if (property.objectReferenceValue) return EditorGUIUtility.singleLineHeight;
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing + EditorStyles.helpBox.CalcHeight(new GUIContent(HELPBOX_CONTENT), EditorGUIUtility.currentViewWidth) + 10.0f;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e966da3a6c3e4487ba279991b988a582
timeCreated: 1749829943
@@ -0,0 +1,9 @@
using UnityEngine;
namespace Attributes
{
public class RequireAttribute : PropertyAttribute
{
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a4b36ca3d21740d4ab5a0e19d2622dfb
timeCreated: 1749829828
@@ -0,0 +1,13 @@
using UnityEngine;
namespace Data
{
[CreateAssetMenu(fileName = "CharacterAttributes", menuName = "Data/Character Attributes", order = 0)]
public class CharacterAttributes : ScriptableObject
{
public string Name;
public int Health;
public int Strength;
public float StrengthMultiplier;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b61abb9f0ac44c59b3b2fd2042e9ace6
timeCreated: 1749826252
@@ -0,0 +1,28 @@
using Core;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Data
{
[CustomPropertyDrawer(typeof(CharacterAttributes))]
public class CharacterAttributesDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
position = EditorGUI.PrefixLabel(position, label);
position.width *= 0.75f;
EditorGUI.PropertyField(position, property, GUIContent.none);
position.x += position.width;
position.width *= 0.3333333f;
if (GUI.Button(position, "Open"))
{
CharacterAttributesWindow window = EditorWindow.GetWindow<CharacterAttributesWindow>();
window.CharacterAttributesToEdit = property.objectReferenceValue as CharacterAttributes;
window.Show();
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 484559cbb76043e19a4cacc8b753bebf
timeCreated: 1749829051
@@ -0,0 +1,23 @@
using Core;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Data
{
[CustomEditor(typeof(CharacterAttributes))]
public class CharacterAttributesEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (GUILayout.Button("Open Character Attributes Editor"))
{
CharacterAttributesWindow window = EditorWindow.GetWindow<CharacterAttributesWindow>();
window.CharacterAttributesToEdit = target as CharacterAttributes;
window.Show();
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 272269d36d454d6cbd79b57adc9f2692
timeCreated: 1749828536
@@ -0,0 +1,10 @@
using UnityEngine;
namespace Data
{
[CreateAssetMenu(fileName = "FloatValue", menuName = "Data/Values/Float", order = 0)]
public class FloatValue : ScriptableObject
{
public float Value;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fd75fdc6380d499a861c0efdba916acc
timeCreated: 1749823882
@@ -0,0 +1,96 @@
using Data;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;
namespace Core
{
public class CharacterAttributesWindow : EditorWindow
{
[MenuItem("Tools/Character Attributes #%^c")]
private static void ShowWindow()
{
var window = GetWindow<CharacterAttributesWindow>();
window.titleContent = new GUIContent("Character Attributes");
window.Show();
}
public CharacterAttributes CharacterAttributesToEdit;
private void OnGUI()
{
// EditorGUILayout.BeginHorizontal();
// EditorGUILayout.LabelField("Label", GUILayout.Width(100));
// EditorGUILayout.LabelField("Next Label", GUILayout.ExpandWidth(true));
//
// EditorGUILayout.BeginVertical();
//
// EditorGUILayout.LabelField("Another Label");
// EditorGUILayout.LabelField("Another Label");
// EditorGUILayout.LabelField("Another Label");
// EditorGUILayout.LabelField("Another Label");
//
// EditorGUILayout.EndVertical();
//
// EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.BeginVertical();
// show all project-wide character attribute assets
string[] characterAttributesGUIDs = AssetDatabase.FindAssets("t:CharacterAttributes");
foreach (string characterAttributeGUID in characterAttributesGUIDs)
{
string path = AssetDatabase.GUIDToAssetPath(characterAttributeGUID);
CharacterAttributes characterAttributes = AssetDatabase.LoadAssetAtPath<CharacterAttributes>(path);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(characterAttributes.name);
// EditorGUILayout.LabelField($"Health: {characterAttributes.Health}");
// EditorGUILayout.LabelField($"Strength: {characterAttributes.Strength}");
// EditorGUILayout.LabelField($"Strength Multiplier: {characterAttributes.StrengthMultiplier}");
if (GUILayout.Button("Edit"))
{
CharacterAttributesToEdit = characterAttributes;
}
EditorGUILayout.EndHorizontal();
}
if (CharacterAttributesToEdit)
{
EditorGUILayout.Separator();
EditorGUILayout.BeginVertical();
SerializedObject serializedObject = new SerializedObject(CharacterAttributesToEdit);
serializedObject.Update();
EditorGUILayout.PropertyField(serializedObject.FindProperty("Health"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("Strength"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("StrengthMultiplier"));
serializedObject.ApplyModifiedProperties();
EditorGUILayout.EndVertical();
}
EditorGUILayout.Separator();
if (GUILayout.Button("Create"))
{
CharacterAttributes newCharacterAttributes = CreateInstance<CharacterAttributes>();
string path = EditorUtility.SaveFilePanelInProject("Save Character Attributes", "Character Attributes", "asset", "");
AssetDatabase.CreateAsset(newCharacterAttributes, path);
AssetDatabase.SaveAssets();
}
EditorGUILayout.EndVertical();
EditorGUILayout.EndHorizontal();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 61b92e412196482db3a322c1e66a6c9f
timeCreated: 1749826501
@@ -1,3 +1,4 @@
using System;
using UnityEditor;
namespace Core
@@ -5,15 +6,28 @@ namespace Core
[CustomEditor(typeof(PlayerController))]
public class PlayerControllerEditor : Editor
{
private SerializedProperty _eventBrokerProperty;
private void OnEnable()
{
_eventBrokerProperty = serializedObject.FindProperty("eventBroker");
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
// serializedObject.Update();
serializedObject.Update();
//
// // update your serialized properties
//
// serializedObject.ApplyModifiedProperties();
// warning info text if the event broker is not set
if (!_eventBrokerProperty.objectReferenceValue)
{
EditorGUILayout.HelpBox("Event Broker Property has to be set!", MessageType.Warning);
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cbb6edf533104c27a71d6e1c16addd3e
timeCreated: 1749825253
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c31ec81529dc4f3fb828508c80171ff6
timeCreated: 1749825893
@@ -0,0 +1,22 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Events
{
[CustomEditor(typeof(EventBroker))]
public class EventBrokerEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (!EditorApplication.isPlaying) return;
if (GUILayout.Button("Player Died"))
{
(target as EventBroker)?.RaisePlayerDied();
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 12b0037e847a41a1b18c0ef2643e47a8
timeCreated: 1749825911
@@ -0,0 +1,13 @@
using System;
using UnityEngine;
namespace Events
{
[CreateAssetMenu(fileName = "EventBroker", menuName = "Events/Event Broker", order = 0)]
public class EventBroker : ScriptableObject
{
public event Action PlayerDied;
public void RaisePlayerDied() => PlayerDied?.Invoke();
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c52cbf4a02ec44f3a6b94e25b84593d9
timeCreated: 1749825311
@@ -1,34 +1,47 @@
using System;
using Attributes;
using Data;
using Events;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(CharacterController))]
public class PlayerController : MonoBehaviour
{
[Header("Events")]
[SerializeField] private EventBroker eventBroker;
[Header("Movement")]
[SerializeField] private float speed;
[SerializeField] private float rotationSpeed;
[Header("Values")]
[SerializeField] private float maxHealth = 100.0f;
// [SerializeField] private float maxHealth = 100.0f;
[SerializeField] private CharacterAttributes characterAttributes;
[SerializeField, Require] private FloatValue maxHealth;
[SerializeField, Require] private FloatValue health;
[Header("References")]
[SerializeField] private Image healthBarFillingImage;
// [Header("References")]
// [SerializeField] private Image healthBarFillingImage;
[Header("Abilities")] [SerializeField] private Ability ability;
[SerializeField] private Ability[] abilities;
public float _currentHealth; // stupid public value for testing
// public float _currentHealth; // stupid public value for testing
private void Awake()
{
_currentHealth = maxHealth;
// _currentHealth = maxHealth;
// set health
health.Value = maxHealth.Value;
}
private void Update()
{
healthBarFillingImage.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal,
Mathf.Clamp01(_currentHealth / maxHealth) * 200.0f);
// healthBarFillingImage.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal,
// Mathf.Clamp01(_currentHealth / maxHealth) * 200.0f);
if (health.Value <= 0.0f) eventBroker.RaisePlayerDied();
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 91606e4cfd524defb445a3e187076a33
timeCreated: 1749824195
@@ -0,0 +1,53 @@
using System;
using Data;
using Events;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace UI
{
public class HealthBar : MonoBehaviour
{
[Header("Events")]
[SerializeField] private EventBroker eventBroker;
[Header("Values")]
[SerializeField] private FloatValue maxHealth;
[SerializeField] private FloatValue health;
[Header("References")]
[SerializeField] private Image fillingImage;
[SerializeField] private TextMeshProUGUI deadText;
private void Awake()
{
fillingImage.type = Image.Type.Filled;
fillingImage.fillMethod = Image.FillMethod.Horizontal;
deadText.gameObject.SetActive(false);
}
private void OnEnable()
{
eventBroker.PlayerDied += OnPlayerDied;
}
private void OnDisable()
{
eventBroker.PlayerDied -= OnPlayerDied;
}
private void Update()
{
fillingImage.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal,
Mathf.Clamp01(health.Value / maxHealth.Value) * 200.0f);
}
private void OnPlayerDied()
{
fillingImage.fillAmount = 0.0f;
fillingImage.color = Color.red;
deadText.gameObject.SetActive(true);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7a98df6e31c94df993b83fcfbf7111e6
timeCreated: 1749824203