bug fixes

This commit is contained in:
Nim-XD 2025-06-23 17:06:59 +05:30
parent 9255b0f61d
commit 6f66dd5023
26 changed files with 5693 additions and 5406 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
Assets/.DS_Store vendored

Binary file not shown.

BIN
Assets/GFX/.DS_Store vendored

Binary file not shown.

View File

@ -0,0 +1,944 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &686763862883061915
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1146384432894135131}
- component: {fileID: 6089113215202315958}
m_Layer: 5
m_Name: Slider_Wave
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1146384432894135131
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 686763862883061915}
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: 6845882053283979484}
- {fileID: 4285775412387772156}
- {fileID: 1352999495374664306}
- {fileID: 5398334386740236440}
- {fileID: 6350604953279406742}
- {fileID: 5088244965666228193}
m_Father: {fileID: 2798614091166486018}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -26.000004}
m_SizeDelta: {x: 408.17, y: 41}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6089113215202315958
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 686763862883061915}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 5065253928134292927}
m_HandleRect: {fileID: 0}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0.956
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!1 &1130455721626041096
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2798614091166486018}
m_Layer: 5
m_Name: StageInfo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2798614091166486018
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1130455721626041096}
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: 7267035877357592999}
- {fileID: 1146384432894135131}
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: 341, y: -58}
m_SizeDelta: {x: 422, y: 116}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2388182499273024451
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7267035877357592999}
- component: {fileID: 4787326584219096223}
- component: {fileID: 6146345901191647263}
m_Layer: 5
m_Name: Text_Chapter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7267035877357592999
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2388182499273024451}
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: 2798614091166486018}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -50.077, y: 19.5}
m_SizeDelta: {x: 299.84497, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4787326584219096223
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2388182499273024451}
m_CullTransparentMesh: 0
--- !u!114 &6146345901191647263
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2388182499273024451}
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: Chapter 2-3
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: d70f485aa27dc43f79a8fd168f58435c, type: 2}
m_sharedMaterial: {fileID: 5416806443266638455, guid: d70f485aa27dc43f79a8fd168f58435c, 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: 32
m_fontSizeBase: 32
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 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: 1
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 &2437194303932381259
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7416032737268845817}
- component: {fileID: 2868758957985937728}
- component: {fileID: 1368749547396216020}
m_Layer: 5
m_Name: InnerBorder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7416032737268845817
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2437194303932381259}
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: 1352999495374664306}
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: -4, y: -4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2868758957985937728
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2437194303932381259}
m_CullTransparentMesh: 0
--- !u!114 &1368749547396216020
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2437194303932381259}
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.9372549, g: 0.53333336, b: 0.09803922, 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: 21300000, guid: f7035e6e3409341f1b193f9163818fe7, type: 3}
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 &4746890671139789804
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5088244965666228193}
- component: {fileID: 3398197481064400104}
- component: {fileID: 7590039207881876790}
- component: {fileID: 5207181021222477224}
m_Layer: 5
m_Name: Icon_Right
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5088244965666228193
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4746890671139789804}
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: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -28.024414, y: 0}
m_SizeDelta: {x: 56, y: 41}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3398197481064400104
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4746890671139789804}
m_CullTransparentMesh: 0
--- !u!114 &7590039207881876790
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4746890671139789804}
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: 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: 21300000, guid: 44fcbe9a150c244b7b2ae28131d46f92, type: 3}
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!114 &5207181021222477224
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4746890671139789804}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.2}
m_EffectDistance: {x: 0, y: -3}
m_UseGraphicAlpha: 1
--- !u!1 &4814233189336420360
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5065253928134292927}
- component: {fileID: 7302017727947505053}
- component: {fileID: 905379351115850969}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5065253928134292927
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4814233189336420360}
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: 4285775412387772156}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7302017727947505053
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4814233189336420360}
m_CullTransparentMesh: 0
--- !u!114 &905379351115850969
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4814233189336420360}
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.93725497, g: 0.40000004, b: 0.098039225, 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: 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!1 &5159015584599573085
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5398334386740236440}
- component: {fileID: 8033338146548289571}
- component: {fileID: 5046988174897913864}
- component: {fileID: 5233914222638371454}
m_Layer: 5
m_Name: Icon_Center
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5398334386740236440
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5159015584599573085}
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: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -72.62988, y: 0}
m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8033338146548289571
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5159015584599573085}
m_CullTransparentMesh: 0
--- !u!114 &5046988174897913864
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5159015584599573085}
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.9960785, g: 0.7490196, 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: 21300000, guid: ad48a3929aef849d882331b041839bbd, type: 3}
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!114 &5233914222638371454
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5159015584599573085}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.2}
m_EffectDistance: {x: 0, y: -3}
m_UseGraphicAlpha: 1
--- !u!1 &6397660117172712752
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4285775412387772156}
m_Layer: 5
m_Name: Fill_Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4285775412387772156
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6397660117172712752}
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: 5065253928134292927}
m_Father: {fileID: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -2.7998047, y: 0}
m_SizeDelta: {x: -49.190063, y: 16}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6410841580721371749
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1352999495374664306}
- component: {fileID: 4041250150582370988}
- component: {fileID: 2096623972248801495}
- component: {fileID: 7372331360845928328}
m_Layer: 5
m_Name: Icon_Left
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1352999495374664306
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6410841580721371749}
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: 7416032737268845817}
m_Father: {fileID: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 19.964844, y: 0}
m_SizeDelta: {x: 40, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4041250150582370988
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6410841580721371749}
m_CullTransparentMesh: 0
--- !u!114 &2096623972248801495
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6410841580721371749}
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.9960785, g: 0.7490196, 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: 21300000, guid: 32c97d7cb31c8448baa922cec15f9313, type: 3}
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!114 &7372331360845928328
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6410841580721371749}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.2}
m_EffectDistance: {x: 0, y: -3}
m_UseGraphicAlpha: 1
--- !u!1 &6604828820574111948
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6350604953279406742}
- component: {fileID: 5670751554279128076}
- component: {fileID: 3834687928479580920}
- component: {fileID: 4871398122183219179}
m_Layer: 5
m_Name: Icon_Center
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6350604953279406742
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6604828820574111948}
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: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 37.370117, y: 0}
m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5670751554279128076
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6604828820574111948}
m_CullTransparentMesh: 0
--- !u!114 &3834687928479580920
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6604828820574111948}
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.9960785, g: 0.7490196, 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: 21300000, guid: ad48a3929aef849d882331b041839bbd, type: 3}
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!114 &4871398122183219179
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6604828820574111948}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.2}
m_EffectDistance: {x: 0, y: -3}
m_UseGraphicAlpha: 1
--- !u!1 &7228516825088376195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6845882053283979484}
- component: {fileID: 4236467548652370357}
- component: {fileID: 9194806074392701959}
- component: {fileID: 9171077277203775805}
m_Layer: 5
m_Name: Bg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6845882053283979484
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228516825088376195}
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: 1146384432894135131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -2.7998047, y: 0}
m_SizeDelta: {x: -44.210083, y: 21}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4236467548652370357
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228516825088376195}
m_CullTransparentMesh: 0
--- !u!114 &9194806074392701959
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228516825088376195}
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.34117648, g: 0.27058825, b: 0.3647059, 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: 21300000, guid: 1ab7680f499d84d3e8763ff538b30ca3, type: 3}
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 &9171077277203775805
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228516825088376195}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_TargetGraphic: {fileID: 9194806074392701959}
m_FillRect: {fileID: 0}
m_HandleRect: {fileID: 0}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0.616
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6dfd7f79d727549a88658a85d98739c7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -92,7 +92,7 @@ public class GameManager : NetworkBehaviour
{
instance.onEnemyDeath(enemy,spawnPos);
}
[SerializeField]private float monsterspawnDelay = 45f;
public void onEnemyDeath(enemyScript enemy, Vector3 spawnPos)
{
if (!isServer)
@ -109,7 +109,7 @@ public class GameManager : NetworkBehaviour
{
if (entry.prefab.name.Contains(enemyName.Replace("(Clone)","")))
{
StartCoroutine(SpawnLater(entry.prefab, spawnPos, 30, enemyLevel));
StartCoroutine(SpawnLater(entry.prefab, spawnPos, monsterspawnDelay, enemyLevel));
Debug.Log("Found enemy prefab for " + enemyName);
return;
}

Binary file not shown.

View File

@ -71,8 +71,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8890752418855122191}
- {fileID: 1985619048386718235}
- {fileID: 8804263351493683255}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -103,7 +101,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 1b30e6bfb9cebd5418e40f107af416af, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -219,7 +217,7 @@ BoxCollider2D:
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.045366943, y: 3.246708}
@ -363,13 +361,13 @@ Transform:
m_GameObject: {fileID: 1672692904241662118}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.2, y: 1.06, z: 0}
m_LocalPosition: {x: 0.1999997, y: -0.08000016, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 20142901320141619}
- {fileID: 5780847139131698005}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 8890752418855122191}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1954305035495809110
GameObject:
@ -403,6 +401,8 @@ Transform:
m_Children:
- {fileID: 4187290182399561599}
- {fileID: 1467402635446084849}
- {fileID: 1985619048386718235}
- {fileID: 8804263351493683255}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &1676736618395566739
@ -820,15 +820,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.26, y: 1.79, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.26000002, y: 0.65, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 8890752418855122191}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5090109001001354634
GameObject:

View File

@ -153,14 +153,14 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1023040156354395308}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.55, y: -0.11, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5500002, y: -0.68000025, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6614720076231091068}
- {fileID: 2090882969196870531}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 3772381091555662337}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1162534051785449981
GameObject:
@ -201,8 +201,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3772381091555662337}
- {fileID: 1985619048386718235}
- {fileID: 8437872175258444569}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -232,7 +230,8 @@ MeshRenderer:
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials: []
m_Materials:
- {fileID: 2100000, guid: 8e74db0c7188ac54caf60d60c6f47ad8, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -289,7 +288,7 @@ MonoBehaviour:
materialsInsideMask: []
materialsOutsideMask: []
disableRenderingOnOverride: 1
_animationName: Front_Idle
_animationName: Side_Idle
loop: 1
timeScale: 1
--- !u!50 &7093817780660591154
@ -348,7 +347,7 @@ BoxCollider2D:
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.1117599, y: 0.8405181}
@ -819,15 +818,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.59, y: 0.5, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.58999974, y: -0.06999999, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 3772381091555662337}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5097258206472635861
GameObject:
@ -945,6 +944,8 @@ Transform:
m_Children:
- {fileID: 8440944829939490929}
- {fileID: 6585738515573820415}
- {fileID: 1985619048386718235}
- {fileID: 8437872175258444569}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &9128464502459145600

View File

@ -71,8 +71,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 437086168465758400}
- {fileID: 1985619048386718235}
- {fileID: 4168104139217719120}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -103,7 +101,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: cf8ec3e416933f743be4df134d5e44b1, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -219,7 +217,7 @@ BoxCollider2D:
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.16937256, y: 0.6145453}
@ -645,13 +643,13 @@ Transform:
m_GameObject: {fileID: 2582579985296048284}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.08, y: -0.110000245, z: 0}
m_LocalPosition: {x: -0.08000009, y: -0.7700003, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8826131781685144263}
- {fileID: 8138893460700823084}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 437086168465758400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2653370529608982279
GameObject:
@ -872,15 +870,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.61, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.050000012, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 437086168465758400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4979296979780838370
GameObject:
@ -1095,6 +1093,8 @@ Transform:
m_Children:
- {fileID: 5147233434191962800}
- {fileID: 7579515677591128382}
- {fileID: 1985619048386718235}
- {fileID: 4168104139217719120}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &4796804256665898163

View File

@ -71,8 +71,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6553627824343142004}
- {fileID: 1985619048386718235}
- {fileID: 2028339836095968879}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -103,7 +101,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 2613116b8a9839f4eb8abb181b83477e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -219,7 +217,7 @@ BoxCollider2D:
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.23830795, y: 0.44725013}
@ -657,15 +655,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.95, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.029999912, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 6553627824343142004}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4219437323657878317
GameObject:
@ -699,6 +697,8 @@ Transform:
m_Children:
- {fileID: 1985343946610652164}
- {fileID: 3876516383691333514}
- {fileID: 1985619048386718235}
- {fileID: 2028339836095968879}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &784237716743909800
@ -854,13 +854,13 @@ Transform:
m_GameObject: {fileID: 6312888248176388115}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.1, y: 0.21, z: 0}
m_LocalPosition: {x: -0.09999985, y: -0.7699999, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4959125589177985481}
- {fileID: 4536626752077848554}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 6553627824343142004}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7560883661715122194
GameObject:

View File

@ -168,8 +168,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4823730940860246971}
- {fileID: 1985619048386718235}
- {fileID: 7820688229898850416}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -200,7 +198,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 5c1e5d25177fa1740921151b338e4d3b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -316,7 +314,7 @@ BoxCollider2D:
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.31513762, y: 0.77473223}
@ -664,6 +662,8 @@ Transform:
m_Children:
- {fileID: 256467407972651467}
- {fileID: 3300676113066932805}
- {fileID: 1985619048386718235}
- {fileID: 7820688229898850416}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2594362919437246835
@ -774,15 +774,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.88, y: 0.72, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.37999994, y: -0.13, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 4823730940860246971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5097258206472635861
GameObject:
@ -991,13 +991,13 @@ Transform:
m_GameObject: {fileID: 6959163251970517438}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.71, y: 0.05, z: 0}
m_LocalPosition: {x: 0.2100004, y: -0.8000001, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3896238875870760639}
- {fileID: 5690042296298702950}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 4823730940860246971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7030352650604398679
GameObject:

View File

@ -168,8 +168,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3772381091555662337}
- {fileID: 1985619048386718235}
- {fileID: 2821587341131724907}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -200,7 +198,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: f6a02f93ff106dc4182282e95c48a7b6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -657,13 +655,13 @@ Transform:
m_GameObject: {fileID: 2631343464316229384}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.22, y: 0.36, z: 0}
m_LocalPosition: {x: 0.13000049, y: -0.68000007, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3643126710200941610}
- {fileID: 6026525598218971238}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 3772381091555662337}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4138028292173026706
GameObject:
@ -689,15 +687,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.33, y: 0.9, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.23999971, y: -0.13999999, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 3772381091555662337}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5017303759967367556
GameObject:
@ -914,6 +912,8 @@ Transform:
m_Children:
- {fileID: 8440944829939490929}
- {fileID: 6585738515573820415}
- {fileID: 1985619048386718235}
- {fileID: 2821587341131724907}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &6937193516565783505

View File

@ -187,8 +187,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 437086168465758400}
- {fileID: 1985619048386718235}
- {fileID: 2324485362800312333}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -219,7 +217,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 645f88d72b3eef14ea19d492a14cf019, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -871,15 +869,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.74, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.13, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 437086168465758400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4979296979780838370
GameObject:
@ -1087,13 +1085,13 @@ Transform:
m_GameObject: {fileID: 6240206743352771274}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.05, y: 0.14, z: 0}
m_LocalPosition: {x: -0.049999926, y: -0.73000014, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4857957903878656049}
- {fileID: 5910728305015542187}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 437086168465758400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7380711111102991769
GameObject:
@ -1127,6 +1125,8 @@ Transform:
m_Children:
- {fileID: 5147233434191962800}
- {fileID: 7579515677591128382}
- {fileID: 1985619048386718235}
- {fileID: 2324485362800312333}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &5027856117409343589

View File

@ -71,8 +71,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8890752418855122191}
- {fileID: 1985619048386718235}
- {fileID: 3283631584437078361}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -103,7 +101,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 29a955f37eb0e3549a9a2dfdc8ebcff6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -370,6 +368,8 @@ Transform:
m_Children:
- {fileID: 4187290182399561599}
- {fileID: 1467402635446084849}
- {fileID: 1985619048386718235}
- {fileID: 3283631584437078361}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &5324656884169612457
@ -688,15 +688,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.55, y: 1.7, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5500002, y: 1.02, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 8890752418855122191}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4209867818744213455
GameObject:
@ -1133,13 +1133,13 @@ Transform:
m_GameObject: {fileID: 7786224416043427696}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5500002, y: 1.12, z: 0}
m_LocalPosition: {x: 0.5500002, y: 0.44000012, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7611597923345294679}
- {fileID: 1449554240864759761}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 8890752418855122191}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8012223407765828159
GameObject:

View File

@ -57,13 +57,13 @@ Transform:
m_GameObject: {fileID: 1126934590627672349}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.02, y: 0.13, z: 0}
m_LocalPosition: {x: -0.019999769, y: -0.89, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4862474287095145940}
- {fileID: 6621384745784260226}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 6553627824343142004}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1162534051785449981
GameObject:
@ -104,8 +104,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6553627824343142004}
- {fileID: 1985619048386718235}
- {fileID: 2706871704866700234}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -136,7 +134,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: ad5de8193a625af48b1318e417ae6c7e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -623,15 +621,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.84, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.18000013, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 6553627824343142004}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4219437323657878317
GameObject:
@ -665,6 +663,8 @@ Transform:
m_Children:
- {fileID: 1985343946610652164}
- {fileID: 3876516383691333514}
- {fileID: 1985619048386718235}
- {fileID: 2706871704866700234}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!210 &9168207458868640020

View File

@ -168,8 +168,6 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4823730940860246971}
- {fileID: 1985619048386718235}
- {fileID: 8153166232711862060}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &541726386239973379
@ -200,7 +198,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
- {fileID: 2100000, guid: 9636898e0cabdf64d99f5040090fe41e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -565,6 +563,8 @@ Transform:
m_Children:
- {fileID: 256467407972651467}
- {fileID: 3300676113066932805}
- {fileID: 1985619048386718235}
- {fileID: 8153166232711862060}
m_Father: {fileID: 6996804995074212180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2781538296072363958
@ -592,13 +592,13 @@ Transform:
m_GameObject: {fileID: 2781538296072363958}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.82, y: -0.110000245, z: 0}
m_LocalPosition: {x: 0.24999964, y: -0.7100003, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8216762809602117158}
- {fileID: 4781289244599139407}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 4823730940860246971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3566355236351520967
GameObject:
@ -807,15 +807,15 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4138028292173026706}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.88, y: 0.64, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.30999994, y: 0.039999902, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8964528504973515913}
- {fileID: 4744380201510388511}
- {fileID: 3648012348632283978}
m_Father: {fileID: 6996804995074212180}
m_Father: {fileID: 4823730940860246971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5097258206472635861
GameObject:

File diff suppressed because it is too large Load Diff

View File

@ -387,6 +387,7 @@ public class enemyScript : NetworkBehaviour
IEnumerator couroutineDeath(){
animationString = "Death";
StartCoroutine(PopDisappearUI());
UpdateAnimation(directionString , animationString);
// RpcUpdateAnim(directionString, animationString,false);
Vector3 lootSpawnPos = transform.position;
@ -395,7 +396,8 @@ public class enemyScript : NetworkBehaviour
GameObject newLoot = Instantiate(GameManager.instance.GetRandomLoot(), lootSpawnPos, Quaternion.identity);
NetworkServer.Spawn(newLoot);
yield return new WaitForSecondsRealtime(5);
yield return new WaitForSecondsRealtime(7);// dead corpse delay
if (!isServer)
@ -433,4 +435,39 @@ public class enemyScript : NetworkBehaviour
MagicalhealthBar.SetHealth(newValue,maxHealth);
}
//etc for ui Disspear coroutine
IEnumerator PopDisappearUI(){
Vector3 originalScale = uiEnemy.localScale;
// First, scale up slightly
float popDuration = 0.15f;
float elapsedTime = 0f;
Vector3 popScale = originalScale * 1.2f;
while(elapsedTime < popDuration)
{
float t = elapsedTime / popDuration;
uiEnemy.localScale = Vector3.Lerp(originalScale, popScale, t);
elapsedTime += Time.deltaTime;
yield return null;
}
// Then scale down to zero quickly
float shrinkDuration = 0.3f;
elapsedTime = 0f;
while(elapsedTime < shrinkDuration)
{
float t = elapsedTime / shrinkDuration;
// Use ease-in curve for faster shrinking
float easedT = t * t;
uiEnemy.localScale = Vector3.Lerp(popScale, Vector3.zero, easedT);
elapsedTime += Time.deltaTime;
yield return null;
}
uiEnemy.localScale = Vector3.zero;
uiEnemy.gameObject.SetActive(false);
}
}

View File

@ -3,17 +3,20 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class healthBar : MonoBehaviour{
public class healthBar : MonoBehaviour
{
public Slider slider;
public Slider slider;
public void SetMaxHealth(int health){
public void SetMaxHealth(int health)
{
slider.maxValue = health;
slider.value = health;
}
public void SetHealth(int health){
}
public void SetHealth(int health)
{
slider.value = health;
}
}
}

View File

@ -26,13 +26,13 @@ public class playerNetwork : NetworkBehaviour
[HideInInspector]
public StatManager statManager;
//public const int XPFORLEVEL = 10;
[SyncVar(hook =nameof(OnHealthChanged))] public int health = 100;
[SyncVar(hook = nameof(OnHealthChanged))] public int health = 100;
public Character4D character;
public characterManager characterMan;
[SyncVar(hook =nameof(OnDirectionChanged))]
[SyncVar(hook = nameof(OnDirectionChanged))]
public Vector2 directionNetwork;
[SyncVar(hook =nameof(OnAnimChanged))]
[SyncVar(hook = nameof(OnAnimChanged))]
public int animIntNetwork;
[SyncVar(hook = nameof(onKillCountChange))]
@ -50,34 +50,43 @@ public class playerNetwork : NetworkBehaviour
[SyncVar]
public string myPartyOwner;
public int lvl2 { get{
public int lvl2
{
get
{
return GetLevelForKills2(enemyKillCount);
}}
}
}
public int GetLevelForKills2(int kills){
public int GetLevelForKills2(int kills)
{
int val = 0;
for(int i =10; i <= kills; i+=10){
val ++;
for (int i = 10; i <= kills; i += 10)
{
val++;
}
return val;
}
public int lvl{
get{
public int lvl
{
get
{
return GetLevelByXp(XP);
}
}
public int GetLevelByXp(int xp){
public int GetLevelByXp(int xp)
{
// int level = Mathf.CeilToInt(Mathf.Sqrt(xp/100f));
// if(level <= 0){level = 1;}
// return level;
int level = Mathf.CeilToInt(Mathf.Log(xp / 100f,2) + 1);
if(level <=0){level = 1;}
int level = Mathf.CeilToInt(Mathf.Log(xp / 100f, 2) + 1);
if (level <= 0) { level = 1; }
return level;
// int level = 1;
// int xpNeeded = 100;
@ -91,7 +100,8 @@ public class playerNetwork : NetworkBehaviour
// return level - 1;
}
public int GetXpForLevel(int level){
public int GetXpForLevel(int level)
{
if (level <= 0)
level = 1;
@ -99,20 +109,23 @@ public class playerNetwork : NetworkBehaviour
}
public float XpSliderVal{
get{
public float XpSliderVal
{
get
{
int nextLevelXp = GetXpForLevel(lvl);
int prevLevelXp = GetXpForLevel(lvl-1);
int prevLevelXp = GetXpForLevel(lvl - 1);
if(nextLevelXp == prevLevelXp){
if (nextLevelXp == prevLevelXp)
{
prevLevelXp = 0;
}
int range = nextLevelXp - prevLevelXp;
// Debug.Log($"{XP-prevLevelXp} / {range}");
//Debug.Log($"next : {nextLevelXp}, prev: {prevLevelXp}, xp:{XP}, xpSince:{XP-prevLevelXp}");
return ((float)(XP-prevLevelXp) / (float)range);
return ((float)(XP - prevLevelXp) / (float)range);
// int nextLevel = lvl+1;
// int curLevelXp = lvl * lvl;
@ -163,20 +176,25 @@ public class playerNetwork : NetworkBehaviour
public string selectedCharacterJson = CharacterSelection.selectedCharJson;
public void SetActiveQuest(QuestScriptable questData){
public void SetActiveQuest(QuestScriptable questData)
{
currentQuest = questData;
questText.text = questData.questTitle;
questUI.SetActive(true);
foreach(QuestAction quest in questActions){
if(quest.questData == questData){
foreach (QuestAction quest in questActions)
{
if (quest.questData == questData)
{
quest.activate();
}
}
}
public void CompleteQuest(QuestScriptable questData){
if(questData != currentQuest){
public void CompleteQuest(QuestScriptable questData)
{
if (questData != currentQuest)
{
Debug.LogError("Completed a quest that wasnt active");
return;
}
@ -191,7 +209,8 @@ public class playerNetwork : NetworkBehaviour
}
public void CancelledQuest(){
public void CancelledQuest()
{
questText.text = "Quest Cancelled: " + currentQuest.questTitle;
//
@ -200,54 +219,68 @@ public class playerNetwork : NetworkBehaviour
StartCoroutine(DelayUI());
}
IEnumerator DelayUI(){
IEnumerator DelayUI()
{
yield return new WaitForSecondsRealtime(10f);
questUI.SetActive(false);
}
public static void registerQuestAction(QuestAction action){
public static void registerQuestAction(QuestAction action)
{
localPlayerTransform.GetComponent<playerNetwork>().questActions.Add(action);
}
void Awake(){
void Awake()
{
invitePlayer = GetComponent<invitePlayer>();
rangeEnemyFind = GetComponent<rangeEnemyFinder>();
}
void Start(){
void Start()
{
#if UNITY_EDITOR
if(isServer){
#if UNITY_EDITOR
if (isServer)
{
playerName = "Player" + Random.Range(0, 100);
}
#endif
#endif
if(!isLocalPlayer){
if (!isLocalPlayer)
{
canvas.SetActive(false);
if(!isServer){
if (!isServer)
{
CmdRequestCharJson();
}
}else{
}
else
{
localPlayerTransform = transform;
localPlayer = this;
cameraRPG.instance.SetTarget(transform);
#if UNITY_EDITOR
#if UNITY_EDITOR
ResetHealthAndArmor();
#else
#else
LoadPlayerData();
#endif
#endif
statManager.OnStatsChanged += ConfigArmorHealthSliders;
if(isServer){
if (isServer)
{
playerName = gplayAuth.userNameCloud;
myCharJson = CharacterSelection.selectedCharJson;
RpcBroadcastCharJson(CharacterSelection.selectedCharJson);
}
else{
if(gplayAuth.userNameCloud.Length > 0){
else
{
if (gplayAuth.userNameCloud.Length > 0)
{
CmdSetName(gplayAuth.userNameCloud);
}else{
}
else
{
CmdSetName("Player" + Random.Range(0, 100));
}
CmdSetCharJson(CharacterSelection.selectedCharJson);
@ -257,60 +290,74 @@ public class playerNetwork : NetworkBehaviour
}
[Command]
public void CmdInvitePlayer(string otherPlayerName){
if(myPartyOwner == null || myPartyOwner.Length == 0){
public void CmdInvitePlayer(string otherPlayerName)
{
if (myPartyOwner == null || myPartyOwner.Length == 0)
{
FindPlayerByName(otherPlayerName).ShowInvite(playerName);
}else{
}
else
{
FindPlayerByName(otherPlayerName).ShowInvite(myPartyOwner);
}
}
public void ShowInvite(string ownerName){
public void ShowInvite(string ownerName)
{
RpcInvitePlayer(ownerName);
}
[ClientRpc]
void RpcInvitePlayer(string playerName){
if(!isLocalPlayer){return;}
void RpcInvitePlayer(string playerName)
{
if (!isLocalPlayer) { return; }
invitePlayer.ShowInvite(playerName);
}
[Command]
public void CmdAcceptInvite(string otherPlayerName){
public void CmdAcceptInvite(string otherPlayerName)
{
myPartyOwner = otherPlayerName;
Debug.Log("Invite accepted: " + myPartyOwner);
}
[Command]
public void CmdLeaveParty(){
public void CmdLeaveParty()
{
myPartyOwner = null;
}
playerNetwork FindPlayerByName(string playerName){
playerNetwork FindPlayerByName(string playerName)
{
playerNetwork[] players = FindObjectsOfType<playerNetwork>();
foreach(playerNetwork player in players){
if(player.playerName == playerName){
foreach (playerNetwork player in players)
{
if (player.playerName == playerName)
{
return player;
}
}
return null;
}
void LoadCharFromJson(string json){
if(json.Length <=0){return;}
character.FromJson(json,true);
void LoadCharFromJson(string json)
{
if (json.Length <= 0) { return; }
character.FromJson(json, true);
}
public void SavePlayerData(){
#if UNITY_EDITOR
public void SavePlayerData()
{
#if UNITY_EDITOR
return;
#endif
#endif
Debug.Log("*** Save Method Got Called ! ***");
if(!isLoaded){
if (!isLoaded)
{
Debug.Log("*** Save Method Return ***");
return;
}
@ -331,27 +378,33 @@ public class playerNetwork : NetworkBehaviour
};
DocumentReference docRef = db.Collection("PlayerData").Document(gplayAuth.userID);
docRef.SetAsync(saveValues).ContinueWithOnMainThread(task => {
if(task.IsCompleted){
docRef.SetAsync(saveValues).ContinueWithOnMainThread(task =>
{
if (task.IsCompleted)
{
Debug.Log("**** Save Completed Firestore ****");
}
else{
else
{
Debug.Log("**** Failed to save data to firestore ****");
}
});
}
public bool isLoaded = false;
public void LoadPlayerData(){
#if UNITY_EDITOR
public void LoadPlayerData()
{
#if UNITY_EDITOR
return;
#endif
#endif
Debug.Log("**** Data Load method got called ****");
FirebaseFirestore db = FirebaseFirestore.DefaultInstance;
DocumentReference docRef = db.Collection("PlayerData").Document(gplayAuth.userID);
docRef.GetSnapshotAsync().ContinueWithOnMainThread(task => {
docRef.GetSnapshotAsync().ContinueWithOnMainThread(task =>
{
DocumentSnapshot snapshot = task.Result;
if(snapshot.Exists){
if (snapshot.Exists)
{
Debug.Log("**** Found previous Data to load ****");
//load data
// Dictionary<string,object> dic = snapshot.ToDictionary(ServerTimestampBehavior.Estimate);
@ -374,7 +427,7 @@ public class playerNetwork : NetworkBehaviour
int savedHealth = snapshot.GetValue<int>("playerHealth");
SetHealth(savedHealth);
ResetHealthAndArmor();
healthBar.value =(savedHealth);
healthBar.value = (savedHealth);
armorBar.value = savedHealth;
//load Inventory
Dictionary<int, string> inventoryGetData = JsonConvert.DeserializeObject<Dictionary<int, string>>(snapshot.GetValue<string>("playerInventory"));
@ -386,7 +439,9 @@ public class playerNetwork : NetworkBehaviour
isLoaded = true;
}else{
}
else
{
//show error previous data doesnt exists to load
Debug.Log("**** No previous data to load ****");
isLoaded = true;
@ -395,32 +450,38 @@ public class playerNetwork : NetworkBehaviour
});
}
[Command]
void CmdSetName(string nameValue){
void CmdSetName(string nameValue)
{
playerName = nameValue;
}
[Command(requiresAuthority =false)]
void CmdRequestCharJson(){
[Command(requiresAuthority = false)]
void CmdRequestCharJson()
{
RpcBroadcastCharJson(myCharJson);
}
[Command]
void CmdSetCharJson(string newValue){
void CmdSetCharJson(string newValue)
{
myCharJson = newValue;
RpcBroadcastCharJson(newValue);
LoadCharFromJson(newValue);
}
[ClientRpc]
void RpcBroadcastCharJson(string newValue){
void RpcBroadcastCharJson(string newValue)
{
LoadCharFromJson(newValue);
}
void OnDirectionChanged(Vector2 oldVal, Vector2 newVal){
void OnDirectionChanged(Vector2 oldVal, Vector2 newVal)
{
character.SetDirection(newVal);
}
void OnAnimChanged(int oldVal, int newVal){
if(isLocalPlayer){return;}
void OnAnimChanged(int oldVal, int newVal)
{
if (isLocalPlayer) { return; }
character.AnimationManager.SetState((CharacterState)newVal);
}
@ -432,26 +493,34 @@ public class playerNetwork : NetworkBehaviour
float attackTimer = 0;
[HideInInspector]
public PlayerAttack playerAttack;
void Update(){
if(isLocalPlayer){
void Update()
{
if (isLocalPlayer)
{
if(attackTimer >0){attackTimer-=Time.deltaTime;}
if (attackTimer > 0) { attackTimer -= Time.deltaTime; }
if(isServer){
if (isServer)
{
SetAnimationData(character.Direction, character.Animator.GetInteger("State"));
}else{
}
else
{
CmdUpdateAnim(character.Direction, character.Animator.GetInteger("State"));
}
healthBar.value =(health);
healthBar.value = (health);
armorBar.value = health;
txtEnemyKillCount.text = enemyKillCount.ToString();
coinText.text = playerCoin.ToString();
txtPlayerName.text = gplayAuth.userNameCloud;
if(myPartyOwner != null && myPartyOwner.Length > 0){
if (myPartyOwner != null && myPartyOwner.Length > 0)
{
invitePlayer.InParty(myPartyOwner);
}else{
}
else
{
invitePlayer.InParty("");
}
@ -462,34 +531,41 @@ public class playerNetwork : NetworkBehaviour
}
[Command]
void CmdUpdateAnim(Vector2 direction, int animState){
void CmdUpdateAnim(Vector2 direction, int animState)
{
SetAnimationData(direction, animState);
}
void SetAnimationData(Vector2 direction, int animState){
void SetAnimationData(Vector2 direction, int animState)
{
directionNetwork = direction;
animIntNetwork = animState;
if(!isLocalPlayer){
if (!isLocalPlayer)
{
character.AnimationManager.SetState((CharacterState)animState);
character.SetDirection(direction);
}
}
void OnHealthChanged(int oldVal, int newVal){
void OnHealthChanged(int oldVal, int newVal)
{
if(!isLocalPlayer){return;}
if (!isLocalPlayer) { return; }
//
if(oldVal < newVal){
GameObject newObject = Instantiate(healthVfx , character.characterTransform());
if (oldVal < newVal)
{
GameObject newObject = Instantiate(healthVfx, character.characterTransform());
newObject.transform.localPosition = Vector3.zero;
newObject.transform.parent = transform;
//StartCoroutine (Couroutine_autoDisableVFX(newObject));
vfxScript vfxSc = newObject.AddComponent<vfxScript>();
}else if (oldVal > newVal ){
}
else if (oldVal > newVal)
{
//damage VFX
GameObject newObject = Instantiate(damageVfx , character.characterTransform());
GameObject newObject = Instantiate(damageVfx, character.characterTransform());
newObject.transform.localPosition = new Vector3(0, 5f, 0);
newObject.transform.parent = transform;
@ -500,7 +576,7 @@ public class playerNetwork : NetworkBehaviour
}
SavePlayerData();
healthBar.value =(newVal);
healthBar.value = (newVal);
armorBar.value = newVal;
}
@ -509,9 +585,10 @@ public class playerNetwork : NetworkBehaviour
// Destroy(go);
// }
void onKillCountChange(int oldval, int newval){
void onKillCountChange(int oldval, int newval)
{
if(!isLocalPlayer){return;}
if (!isLocalPlayer) { return; }
// int prevLevel = GetLevelForKills(oldval);
// int newLevel = GetLevelForKills(newval);
SavePlayerData();
@ -526,63 +603,81 @@ public class playerNetwork : NetworkBehaviour
// }
}
void OnXpChanged(int oldVal, int newVal){
if(!isLocalPlayer){return;}
void OnXpChanged(int oldVal, int newVal)
{
if (!isLocalPlayer) { return; }
int prevLevel = GetLevelByXp(oldVal);
int newLevle = GetLevelByXp(newVal);
if(newLevle > prevLevel){
if (newLevle > prevLevel)
{
int levelChange = newLevle - prevLevel;
GameObject newObject = Instantiate(levelUpVfx , character.characterTransform());
GameObject newObject = Instantiate(levelUpVfx, character.characterTransform());
newObject.transform.localPosition = Vector3.zero;
newObject.transform.parent = transform;
StartCoroutine(uiTxtDelay(25f, levelChange));
}
}
public void SetHealth(int newvalue){
if(isServer){
public void SetHealth(int newvalue)
{
if (isServer)
{
health = newvalue;
healthBar.value =(newvalue);
healthBar.value = (newvalue);
armorBar.value = newvalue;
}else{
}
else
{
CmdSetHealth(newvalue);
}
}
public void SetEnemyKillCount(int newValue){
if(isServer){
public void SetEnemyKillCount(int newValue)
{
if (isServer)
{
enemyKillCount = newValue;
}else{
}
else
{
CmdSetEnemyKillCount(newValue);
}
}
public void SetPlayerCoins(int newVal){
if(isServer){
public void SetPlayerCoins(int newVal)
{
if (isServer)
{
playerCoin = newVal;
}else{
}
else
{
CmdSetPlayerCoin(newVal);
}
}
[Command]
void CmdSetPlayerCoin(int newVal){
void CmdSetPlayerCoin(int newVal)
{
playerCoin = newVal;
}
[Command]
void CmdSetEnemyKillCount(int newValue){
void CmdSetEnemyKillCount(int newValue)
{
enemyKillCount = newValue;
}
[Command]
void CmdSetHealth(int newValue){
void CmdSetHealth(int newValue)
{
health = newValue;
}
public void TakeDamage(int attackDamage){
public void TakeDamage(int attackDamage)
{
serverTakeDmg(attackDamage);
// if(isLocalPlayer){
// takedmg(attackDamage);
@ -591,41 +686,48 @@ public class playerNetwork : NetworkBehaviour
// }
}
void serverTakeDmg(int damage){
void serverTakeDmg(int damage)
{
health -= damage;
if(health <=0){
if (health <= 0)
{
RpcDeath();
death();
}
}
float xpTimer = 0;
public void ShowXP(){
if(xpTimer >0){xpTimer -= Time.deltaTime;return;}
public void ShowXP()
{
if (xpTimer > 0) { xpTimer -= Time.deltaTime; return; }
xpTimer = 1;
xpText.text = (Mathf.RoundToInt(XP/100f) * 100f).ToString();
xpText.text = (Mathf.RoundToInt(XP / 100f) * 100f).ToString();
xpSlider.value = XpSliderVal;
for(int i=0; i < 10; i++){
float val = (float)i /10f;
for (int i = 0; i < 10; i++)
{
float val = (float)i / 10f;
xpSliderSlots[i].SetActive(xpSlider.value > val);
}
}
public void ShowLevel(){
public void ShowLevel()
{
lvlText.text = lvl.ToString();
}
public void OnEnemyKilled(int enemyLevel){
public void OnEnemyKilled(int enemyLevel)
{
//disable take damage and disable healthbar going backwards
int prevValue = lvl;
// SavePlayerData();
enemyKillCount++;
//XP += (int)(enemyScript.XP_GAIN * (enemyLevel/2f));
XP += enemyScript.XP_GAIN_Base + Mathf.FloorToInt(enemyScript.XP_GAIN * (enemyLevel-1));
XP += enemyScript.XP_GAIN_Base + Mathf.FloorToInt(enemyScript.XP_GAIN * (enemyLevel - 1));
}
IEnumerator uiTxtDelay (float delayTime, int levelChange){
IEnumerator uiTxtDelay(float delayTime, int levelChange)
{
//enable
xpEnableTxt.gameObject.SetActive(true);
//int attackDamageChange= 5 * levelChange;
@ -645,18 +747,21 @@ public class playerNetwork : NetworkBehaviour
// //questText.text = "<s>Kill 5 Enemies to claim 100Golds</s> Completed";
// Debug.Log("First quest completed");
// }
public void AddCoin(){
public void AddCoin()
{
playerCoin += 100;
coinText.text = playerCoin.ToString();
}
[ClientRpc]
public void RpcDeath(){
public void RpcDeath()
{
death();
}
public bool isDead = false;
public void death(){
public void death()
{
Debug.Log("Death called");
character.AnimationManager.Die();
isDead = true;
@ -665,26 +770,33 @@ public class playerNetwork : NetworkBehaviour
// throw new System.Exception();
}
IEnumerator CouroutineWaitDeath (){
IEnumerator CouroutineWaitDeath()
{
yield return new WaitForSecondsRealtime(3);
isDead = false;
playerRespawn();
}
public void OnAttack(){
if(attackTimer > 0){
public void OnAttack()
{
if (attackTimer > 0)
{
return;
}
//characterMan.SetActiveWeapon(78);
attackTimer = ATTACK_COOLDOWN;
if(isLocalPlayer){
if (isLocalPlayer)
{
PlayAttackAnim();
playerAttack.Attack(false);
if(isServer){
if (isServer)
{
RpcPlayAttackAnim();
}else{
}
else
{
CmdPlayAttackAnim();
}
}
@ -694,11 +806,13 @@ public class playerNetwork : NetworkBehaviour
[SerializeField] public float arrowShootOffset = 1;
[SerializeField] public float arrowShootHeightOffset = 1;
public void OnRangeAttack(){
if(attackTimer>0){
public void OnRangeAttack()
{
if (attackTimer > 0)
{
return;
}
if(closestEnemy==null){return;}
if (closestEnemy == null) { return; }
attackTimer = ATTACK_COOLDOWN;
@ -712,11 +826,12 @@ public class playerNetwork : NetworkBehaviour
}
public float arrowDelay;
IEnumerator ArrowShootDelay (){
IEnumerator ArrowShootDelay()
{
yield return new WaitForSeconds(arrowDelay);
Vector3 startingPosition = transform.position ;
Vector3 startingPosition = transform.position;
Vector3 destination = closestEnemy.transform.position;
//TODO: Move attack projectile from startingPosition to destination
@ -726,26 +841,28 @@ public class playerNetwork : NetworkBehaviour
destination += (Vector3.up * arrowShootHeightOffset);
// Quaternion rotation = Quaternion.LookRotation(direction);
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
Quaternion rotation = Quaternion.Euler(0,0,angle - 90f);
Quaternion rotation = Quaternion.Euler(0, 0, angle - 90f);
GameObject newArrow = Instantiate(arrowRange , transform.position + (direction * arrowShootOffset) , rotation);
GameObject newArrow = Instantiate(arrowRange, transform.position + (direction * arrowShootOffset), rotation);
StartCoroutine(moveArrow(newArrow.transform , startingPosition , destination , closestEnemy));
StartCoroutine(moveArrow(newArrow.transform, startingPosition, destination, closestEnemy));
}
public int RangeDmg = 10;
IEnumerator moveArrow (Transform arrow , Vector3 start, Vector3 destination, enemyScript target ){
IEnumerator moveArrow(Transform arrow, Vector3 start, Vector3 destination, enemyScript target)
{
float dist = Vector3.Distance(start , destination);
float dist = Vector3.Distance(start, destination);
float duration = dist/arrowSpeed;
float duration = dist / arrowSpeed;
float timer = 0f;
while(timer < duration){
while (timer < duration)
{
arrow.position = Vector3.Lerp(start , destination , timer/duration);
arrow.position = Vector3.Lerp(start, destination, timer / duration);
timer += Time.deltaTime;
yield return null;
@ -758,40 +875,49 @@ public class playerNetwork : NetworkBehaviour
}
public int MagicAttackWeaponIndex = 52;
public void OnMagicAttack(){
if(attackTimer > 0){
public void OnMagicAttack()
{
if (attackTimer > 0)
{
return;
}
attackTimer = ATTACK_COOLDOWN;
//characterMan.SetActiveWeapon(MagicAttackWeaponIndex);
if(isLocalPlayer){
if (isLocalPlayer)
{
PlayAttackAnim();
//?
playerAttack.MagicalAttack();
playerAttack.Attack(true);
if(isServer){
if (isServer)
{
RpcPlayAttackAnim();
}else{
}
else
{
CmdPlayAttackAnim();
}
}
}
[Command]
void CmdPlayAttackAnim(){
void CmdPlayAttackAnim()
{
PlayAttackAnim();
RpcPlayAttackAnim();
}
[ClientRpc]
void RpcPlayAttackAnim(){
if(isLocalPlayer){return;}
void RpcPlayAttackAnim()
{
if (isLocalPlayer) { return; }
PlayAttackAnim();
}
void PlayAttackAnim(){
void PlayAttackAnim()
{
switch (character.WeaponType)
{
case WeaponType.Melee1H:
@ -807,18 +933,20 @@ public class playerNetwork : NetworkBehaviour
}
}
public void playerRespawn(){
public void playerRespawn()
{
Debug.Log("Respawning");
// healthBar.SetMaxHealth(statManager.GetEffectiveValue("health"));
ResetHealthAndArmor();
healthBar.value = health;
character.AnimationManager.SetState(CharacterState.Idle);
Transform newSpawnLocationPlayer = GameManager.instance.spawnPointsPlayer.GetChild(Random.Range(0,GameManager.instance.spawnPointsPlayer.childCount));
Transform newSpawnLocationPlayer = GameManager.instance.spawnPointsPlayer.GetChild(Random.Range(0, GameManager.instance.spawnPointsPlayer.childCount));
transform.position = newSpawnLocationPlayer.position;
}
void ResetHealthAndArmor(){
void ResetHealthAndArmor()
{
healthBar.maxValue = statManager.GetEffectiveValue("health");
health = statManager.GetEffectiveValue("health") + statManager.GetEffectiveValue("defence");
@ -828,7 +956,8 @@ public class playerNetwork : NetworkBehaviour
armorBar.value = health;
}
void ConfigArmorHealthSliders(){
void ConfigArmorHealthSliders()
{
healthBar.maxValue = statManager.GetEffectiveValue("health");
float maxHealth = statManager.GetEffectiveValue("health") + statManager.GetEffectiveValue("defence");
// Debug.Log($"Setting armor bar, maxVal:{health}, minVal:{healthBar.maxValue}, val:{health}");
@ -839,39 +968,51 @@ public class playerNetwork : NetworkBehaviour
}
//Pickup
public void PickupObject(pickup item){
if(!isServer){ Debug.LogError("Cant call command on client, 403"); return; }
if(isLocalPlayer){
public void PickupObject(pickup item)
{
if (!isServer) { Debug.LogError("Cant call command on client, 403"); return; }
if (isLocalPlayer)
{
pickupObject(item.lootData.type);
}else{
}
else
{
RpcPickupObject(item.lootData.type);
}
}
[ClientRpc]
void RpcPickupObject(string type){
if(isLocalPlayer){
void RpcPickupObject(string type)
{
if (isLocalPlayer)
{
pickupObject(type);
}
}
void pickupObject(string type){
void pickupObject(string type)
{
inventory.AddItem(type);
}
public void DropPickup(string type){
if(isServer){
GameManager.instance.SpawnPickup(type,transform.position + new Vector3(0.85f,0.6f));
}else{
public void DropPickup(string type)
{
if (isServer)
{
GameManager.instance.SpawnPickup(type, transform.position + new Vector3(0.85f, 0.6f));
}
else
{
CmdDropPickup(type);
}
}
[Command]
void CmdDropPickup(string type){
GameManager.instance.SpawnPickup(type,transform.position + new Vector3(4,0));
void CmdDropPickup(string type)
{
GameManager.instance.SpawnPickup(type, transform.position + new Vector3(4, 0));
}
int magicalDmg = 0;
@ -910,14 +1051,15 @@ public class playerNetwork : NetworkBehaviour
{
//magical damage with intelligance stat ?
//int damageamount = magicalDmg + (lvl * 5);
int damageamount = magicalDmg + (statManager.GetEffectiveValue("intelligence")*2);
int damageamount = magicalDmg + (statManager.GetEffectiveValue("intelligence") * 2);
Debug.Log("magic damage amount " + damageamount);
victim.TakeMagicalDamage(damageamount, netId);
}
public void GoBackMenu(){
public void GoBackMenu()
{
startClient.instance.networkManager.StopClient();
SceneManager.LoadScene("GameLogin");

View File

@ -27,6 +27,9 @@ public class rangeEnemyFinder : MonoBehaviour
float closestDist = radius * 10f;
targetEnemy = null;
foreach(enemyScript enemy in enemies){
//only consider enemies that are in chase range and have a target
if(!enemy.isInChaseRange || enemy.target == null) continue;
float dist = Vector3.Distance((Vector2)enemy.transform.position,(Vector2)transform.position);
if(dist < radius){
if(dist < closestDist){

236
Assets/sliderProgressSc.cs Normal file
View File

@ -0,0 +1,236 @@
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using System.Collections.Generic;
public class sliderProgressSc : MonoBehaviour
{
[Header("Slider Reference")]
[SerializeField] private Slider targetSlider;
[Header("Dots Configuration")]
[SerializeField] private List<Transform> dots = new List<Transform>();
[SerializeField] private List<Image> dotImages = new List<Image>();
[Header("Animation Settings")]
[SerializeField] private float scaleDuration = 0.3f;
[SerializeField] private float colorDuration = 0.2f;
[SerializeField] private Vector3 activeScale = Vector3.one * 1.2f;
[SerializeField] private Vector3 inactiveScale = Vector3.one;
[SerializeField] private Ease scaleEase = Ease.OutBack;
[Header("Colors")]
[SerializeField] private Color inactiveColor = new Color(0.3f, 0.3f, 0.3f, 0.6f);
[SerializeField] private Color activeColor = new Color(0f, 1f, 0.4f, 1f); // Bright green
private float previousSliderValue;
private int lastActivatedDot = -1;
void Start()
{
InitializeSlider();
SetupInitialState();
}
void Update()
{
// Check if slider value changed
if (Mathf.Abs(targetSlider.value - previousSliderValue) > 0.001f)
{
CheckAndAnimateDots(targetSlider.value);
previousSliderValue = targetSlider.value;
}
}
void InitializeSlider()
{
if (targetSlider == null)
targetSlider = GetComponent<Slider>();
if (targetSlider == null)
{
Debug.LogError("No slider found! Please assign a slider reference.");
return;
}
// Auto-populate dots if empty
if (dots.Count == 0)
{
Debug.Log("No dots found! Please assign dot transforms manually.");
}
previousSliderValue = targetSlider.value;
}
void SetupInitialState()
{
// Set all dots to inactive state
for (int i = 0; i < dots.Count; i++)
{
if (dots[i] != null)
{
dots[i].localScale = inactiveScale;
if (i < dotImages.Count && dotImages[i] != null)
{
dotImages[i].color = inactiveColor;
}
}
}
lastActivatedDot = -1;
}
void CheckAndAnimateDots(float sliderValue)
{
// Calculate how many dots should be active based on slider value
// For 10 dots: dot 0 at 0.1, dot 1 at 0.2, ..., dot 9 at 1.0
int dotsToActivate = Mathf.FloorToInt(sliderValue * dots.Count);
// Clamp to valid range
dotsToActivate = Mathf.Clamp(dotsToActivate, 0, dots.Count);
// The actual active dot index (0-based, -1 means no dots active)
int targetActiveDot = dotsToActivate - 1;
// Check if we've moved forward to activate more dots
if (targetActiveDot > lastActivatedDot)
{
// Activate dots from lastActivatedDot+1 to targetActiveDot
for (int i = lastActivatedDot + 1; i <= targetActiveDot; i++)
{
if (i < dots.Count && i >= 0)
{
ActivateDot(i);
}
}
lastActivatedDot = targetActiveDot;
}
// Check if we've moved backward (deactivate dots)
else if (targetActiveDot < lastActivatedDot)
{
// Deactivate dots from lastActivatedDot down to targetActiveDot+1
for (int i = lastActivatedDot; i > targetActiveDot; i--)
{
if (i < dots.Count && i >= 0)
{
DeactivateDot(i);
}
}
lastActivatedDot = targetActiveDot;
}
}
void ActivateDot(int dotIndex)
{
if (dotIndex >= dots.Count || dotIndex < 0 || dots[dotIndex] == null) return;
Transform dot = dots[dotIndex];
// Scale up animation
dot.DOScale(activeScale, scaleDuration).SetEase(scaleEase);
// Color change to active
if (dotIndex < dotImages.Count && dotImages[dotIndex] != null)
{
dotImages[dotIndex].DOColor(activeColor, colorDuration);
}
}
void DeactivateDot(int dotIndex)
{
if (dotIndex >= dots.Count || dotIndex < 0 || dots[dotIndex] == null) return;
Transform dot = dots[dotIndex];
// Scale down animation
dot.DOScale(inactiveScale, scaleDuration * 0.7f).SetEase(Ease.OutQuad);
// Color change to inactive
if (dotIndex < dotImages.Count && dotImages[dotIndex] != null)
{
dotImages[dotIndex].DOColor(inactiveColor, colorDuration * 0.7f);
}
}
// Public methods for external control
public void SetSliderValue(float value)
{
if (targetSlider != null)
{
targetSlider.value = value;
}
}
public void ResetDots()
{
// Kill any running animations
for (int i = 0; i < dots.Count; i++)
{
if (dots[i] != null)
{
dots[i].DOKill();
}
if (i < dotImages.Count && dotImages[i] != null)
{
dotImages[i].DOKill();
}
}
// Reset state
lastActivatedDot = -1;
SetupInitialState();
}
// Get current progress (0-10)
public int GetCurrentProgress()
{
return lastActivatedDot + 1;
}
// Check if specific dot is active
public bool IsDotActive(int dotIndex)
{
return dotIndex <= lastActivatedDot;
}
void OnDestroy()
{
// Clean up any running tweens
for (int i = 0; i < dots.Count; i++)
{
if (dots[i] != null)
{
dots[i].DOKill();
}
if (i < dotImages.Count && dotImages[i] != null)
{
dotImages[i].DOKill();
}
}
}
// // Debug helper - shows current calculation values in inspector
// [System.Serializable]
// public class DebugInfo
// {
// [SerializeField] public float currentSliderValue;
// [SerializeField] public int dotsToActivate;
// [SerializeField] public int targetActiveDot;
// [SerializeField] public int lastActivatedDot;
// }
// [Header("Debug Info (Runtime Only)")]
// [SerializeField] private DebugInfo debugInfo = new DebugInfo();
// void LateUpdate()
// {
// // Update debug info for inspector visibility
// if (targetSlider != null)
// {
// debugInfo.currentSliderValue = targetSlider.value;
// debugInfo.dotsToActivate = Mathf.FloorToInt(targetSlider.value * dots.Count);
// debugInfo.targetActiveDot = debugInfo.dotsToActivate - 1;
// debugInfo.lastActivatedDot = lastActivatedDot;
// }
// }
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6df071435caf945e1b93f46b42c36ba9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: