스킬 컨트롤러 부분 테스트 작업
This commit is contained in:
@@ -13,7 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 9038613328287168246}
|
- component: {fileID: 9038613328287168246}
|
||||||
- component: {fileID: 3669420560598532132}
|
- component: {fileID: 3669420560598532132}
|
||||||
- component: {fileID: 320122261167411594}
|
- component: {fileID: 320122261167411594}
|
||||||
- component: {fileID: 8378046191530183079}
|
- component: {fileID: 6767522583486039941}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: BubblePop
|
m_Name: BubblePop
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -171,7 +171,7 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 4
|
m_Constraints: 4
|
||||||
--- !u!114 &8378046191530183079
|
--- !u!114 &6767522583486039941
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -180,7 +180,7 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 2348644397580482668}
|
m_GameObject: {fileID: 2348644397580482668}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 097cc9f5338c42f4dacb309030086af2, type: 3}
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playerData:
|
playerData:
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ GameObject:
|
|||||||
- component: {fileID: 759552675758406580}
|
- component: {fileID: 759552675758406580}
|
||||||
- component: {fileID: 7492690471538067993}
|
- component: {fileID: 7492690471538067993}
|
||||||
- component: {fileID: 721481636574888361}
|
- component: {fileID: 721481636574888361}
|
||||||
- component: {fileID: -3275633907703003897}
|
|
||||||
- component: {fileID: 9113494596136640624}
|
- component: {fileID: 9113494596136640624}
|
||||||
- component: {fileID: -7794782427701892011}
|
- component: {fileID: -7794782427701892011}
|
||||||
|
- component: {fileID: 6756012842473655295}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Darknessball
|
m_Name: Darknessball
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -109,18 +109,6 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
--- !u!114 &-3275633907703003897
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 589444956133359262}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 46951a2e33fdd5a409f1579de9b7acfa, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!50 &9113494596136640624
|
--- !u!50 &9113494596136640624
|
||||||
Rigidbody2D:
|
Rigidbody2D:
|
||||||
serializedVersion: 4
|
serializedVersion: 4
|
||||||
@@ -183,3 +171,27 @@ CapsuleCollider2D:
|
|||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
m_Size: {x: 0.33, y: 0.32}
|
m_Size: {x: 0.33, y: 0.32}
|
||||||
m_Direction: 1
|
m_Direction: 1
|
||||||
|
--- !u!114 &6756012842473655295
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 589444956133359262}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
playerData:
|
||||||
|
id: 0
|
||||||
|
type:
|
||||||
|
name:
|
||||||
|
level: 0
|
||||||
|
experience: 0
|
||||||
|
hp: 0
|
||||||
|
mp: 0
|
||||||
|
attackPower: 0
|
||||||
|
defensivePower: 0
|
||||||
|
critical: 0
|
||||||
|
destoryTime: 2
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 6178516325091986387}
|
- component: {fileID: 6178516325091986387}
|
||||||
- component: {fileID: 3056202625502292237}
|
- component: {fileID: 3056202625502292237}
|
||||||
- component: {fileID: 5208689614317904018}
|
- component: {fileID: 5208689614317904018}
|
||||||
- component: {fileID: 6962075032689792435}
|
- component: {fileID: 1854460126165076812}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Earth Smash
|
m_Name: Earth Smash
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -171,7 +171,7 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
--- !u!114 &6962075032689792435
|
--- !u!114 &1854460126165076812
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -180,7 +180,7 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 725522673186316604}
|
m_GameObject: {fileID: 725522673186316604}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 58aa952974ab33d448446d7e947feb10, type: 3}
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playerData:
|
playerData:
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 1708996747545980439}
|
- component: {fileID: 1708996747545980439}
|
||||||
- component: {fileID: 751188261029751302}
|
- component: {fileID: 751188261029751302}
|
||||||
- component: {fileID: 8761893032860631160}
|
- component: {fileID: 8761893032860631160}
|
||||||
|
- component: {fileID: 8639718758756888688}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: ElementalBurst
|
m_Name: ElementalBurst
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -170,3 +171,27 @@ CapsuleCollider2D:
|
|||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
m_Size: {x: 0.35, y: 0.11}
|
m_Size: {x: 0.35, y: 0.11}
|
||||||
m_Direction: 1
|
m_Direction: 1
|
||||||
|
--- !u!114 &8639718758756888688
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5823506627603727293}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
playerData:
|
||||||
|
id: 0
|
||||||
|
type:
|
||||||
|
name:
|
||||||
|
level: 0
|
||||||
|
experience: 0
|
||||||
|
hp: 0
|
||||||
|
mp: 0
|
||||||
|
attackPower: 0
|
||||||
|
defensivePower: 0
|
||||||
|
critical: 0
|
||||||
|
destoryTime: 2
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ GameObject:
|
|||||||
- component: {fileID: 7275089485906890891}
|
- component: {fileID: 7275089485906890891}
|
||||||
- component: {fileID: 4707210132887916293}
|
- component: {fileID: 4707210132887916293}
|
||||||
- component: {fileID: 8358053220907271229}
|
- component: {fileID: 8358053220907271229}
|
||||||
- component: {fileID: -409206718854825505}
|
|
||||||
- component: {fileID: 7592981806478228525}
|
- component: {fileID: 7592981806478228525}
|
||||||
- component: {fileID: 7577941235322895627}
|
- component: {fileID: 7577941235322895627}
|
||||||
|
- component: {fileID: 7009580840987262329}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Fireball
|
m_Name: Fireball
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -109,18 +109,6 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
--- !u!114 &-409206718854825505
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 6328494989662859589}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 26dd04ed34a3c4042bfbe12766af2d60, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!70 &7592981806478228525
|
--- !u!70 &7592981806478228525
|
||||||
CapsuleCollider2D:
|
CapsuleCollider2D:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -183,3 +171,27 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 4
|
m_Constraints: 4
|
||||||
|
--- !u!114 &7009580840987262329
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6328494989662859589}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
playerData:
|
||||||
|
id: 0
|
||||||
|
type:
|
||||||
|
name:
|
||||||
|
level: 0
|
||||||
|
experience: 0
|
||||||
|
hp: 0
|
||||||
|
mp: 0
|
||||||
|
attackPower: 0
|
||||||
|
defensivePower: 0
|
||||||
|
critical: 0
|
||||||
|
destoryTime: 2
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ GameObject:
|
|||||||
- component: {fileID: 6892128790266366542}
|
- component: {fileID: 6892128790266366542}
|
||||||
- component: {fileID: 1317263097951514820}
|
- component: {fileID: 1317263097951514820}
|
||||||
- component: {fileID: 3514874755737400832}
|
- component: {fileID: 3514874755737400832}
|
||||||
- component: {fileID: -3377048296267459566}
|
|
||||||
- component: {fileID: 1179248653527079395}
|
- component: {fileID: 1179248653527079395}
|
||||||
- component: {fileID: 4076849194862890134}
|
- component: {fileID: 4076849194862890134}
|
||||||
|
- component: {fileID: 8757402249180582990}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Iceball
|
m_Name: Iceball
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -109,18 +109,6 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
--- !u!114 &-3377048296267459566
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2209934716239183953}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: aa5541b68c81e2347960b5eeaf373bf4, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!70 &1179248653527079395
|
--- !u!70 &1179248653527079395
|
||||||
CapsuleCollider2D:
|
CapsuleCollider2D:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -183,3 +171,27 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 4
|
m_Constraints: 4
|
||||||
|
--- !u!114 &8757402249180582990
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2209934716239183953}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
playerData:
|
||||||
|
id: 0
|
||||||
|
type:
|
||||||
|
name:
|
||||||
|
level: 0
|
||||||
|
experience: 0
|
||||||
|
hp: 0
|
||||||
|
mp: 0
|
||||||
|
attackPower: 0
|
||||||
|
defensivePower: 0
|
||||||
|
critical: 0
|
||||||
|
destoryTime: 2
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 3321478883644359179}
|
- component: {fileID: 3321478883644359179}
|
||||||
- component: {fileID: 212275300155788510}
|
- component: {fileID: 212275300155788510}
|
||||||
- component: {fileID: 2922771234883919603}
|
- component: {fileID: 2922771234883919603}
|
||||||
- component: {fileID: 5559617156593048031}
|
- component: {fileID: 1538103544923951145}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Leaf Cutter
|
m_Name: Leaf Cutter
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -171,7 +171,7 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 4
|
m_Constraints: 4
|
||||||
--- !u!114 &5559617156593048031
|
--- !u!114 &1538103544923951145
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -180,7 +180,7 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 774765665418399614}
|
m_GameObject: {fileID: 774765665418399614}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: ecd1248961250a0459b097be2a5f840d, type: 3}
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playerData:
|
playerData:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 3594168943760168462}
|
- component: {fileID: 3594168943760168462}
|
||||||
- component: {fileID: 3898881956917593441}
|
- component: {fileID: 3898881956917593441}
|
||||||
- component: {fileID: 3923960153182909598}
|
- component: {fileID: 3923960153182909598}
|
||||||
- component: {fileID: 5319750382995448671}
|
- component: {fileID: 8315617979406152983}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Leaf Shuriken
|
m_Name: Leaf Shuriken
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -171,7 +171,7 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 4
|
m_Constraints: 4
|
||||||
--- !u!114 &5319750382995448671
|
--- !u!114 &8315617979406152983
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -180,7 +180,7 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 1380883064370067919}
|
m_GameObject: {fileID: 1380883064370067919}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 88908efcef71610458a84067666b485b, type: 3}
|
m_Script: {fileID: 11500000, guid: 9407c2d7c54dec74eac0fe37da48ef1d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playerData:
|
playerData:
|
||||||
|
|||||||
@@ -737,6 +737,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: TON.ObjectPoolSystem
|
value: TON.ObjectPoolSystem
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6504236090121797777, guid: ab2e507b20e5dc844a1ea24b5619f656, type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
|
|||||||
@@ -160,24 +160,20 @@ namespace TON
|
|||||||
attackCollider.EnableCollider(false);
|
attackCollider.EnableCollider(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SkillAttack(string skillId)
|
public bool SkillAttack(string skillId)
|
||||||
{
|
{
|
||||||
|
// 스킬 매니저에서 스킬을 쏠 수 있는지 여부를 판단
|
||||||
|
bool canExecute = SkillDataManager.Singleton.CanExecuteSkill(skillId);
|
||||||
|
if (canExecute)
|
||||||
|
{
|
||||||
|
// 스킬 애니메이터 실행
|
||||||
animator.Play("Skill Attack");
|
animator.Play("Skill Attack");
|
||||||
|
|
||||||
// 스킬 생성
|
// 스킬 매니저에 스킬 발사 요청
|
||||||
GameObject skill = ObjectPoolManager.Instance.GetEffect(skillId);
|
SkillDataManager.Singleton.ExecuteSkill(skillId, firePoint, lastDirection);
|
||||||
|
}
|
||||||
|
|
||||||
// skill.transform.SetParent(firePoint);
|
return canExecute;
|
||||||
skill.transform.SetPositionAndRotation(firePoint.position, firePoint.rotation);
|
|
||||||
|
|
||||||
// 🔥 스킬 방향 반전
|
|
||||||
var bulletScale = skill.transform.localScale;
|
|
||||||
bulletScale.x = Mathf.Abs(bulletScale.x) * lastDirection;
|
|
||||||
skill.transform.localScale = bulletScale;
|
|
||||||
|
|
||||||
// 스킬 이동 방향 설정
|
|
||||||
Rigidbody2D skillRb = skill.GetComponent<Rigidbody2D>();
|
|
||||||
skillRb.velocity = new Vector2(lastDirection * 5f, 0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class BubblePop : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 097cc9f5338c42f4dacb309030086af2
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class DarknessBall : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 46951a2e33fdd5a409f1579de9b7acfa
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class EarthSmash : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 58aa952974ab33d448446d7e947feb10
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class ElementalBurst : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 251310a05dd69154f930fc61ec1795c7
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class FireBall : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 26dd04ed34a3c4042bfbe12766af2d60
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class IceBall : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: aa5541b68c81e2347960b5eeaf373bf4
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class LeafCutter : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ecd1248961250a0459b097be2a5f840d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TON
|
|
||||||
{
|
|
||||||
public class LeafShuriken : SkillBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 88908efcef71610458a84067666b485b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
|||||||
namespace TON
|
namespace TON
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public abstract class SkillBase : PoolAble
|
public class SkillBase : PoolAble
|
||||||
{
|
{
|
||||||
public float SkillCoolDown => SkillData.coolDown;
|
public float SkillCoolDown => SkillData.coolDown;
|
||||||
public float CurrentCoolDown { get; protected set; }
|
public float CurrentCoolDown { get; protected set; }
|
||||||
@@ -15,7 +15,7 @@ namespace TON
|
|||||||
|
|
||||||
private DamageCalculator damageCalculator = new DamageCalculator();
|
private DamageCalculator damageCalculator = new DamageCalculator();
|
||||||
|
|
||||||
private float elapsedTime; // 경과 시간 저장 변수
|
private float elapsedTime = 0f; // 경과 시간 저장 변수
|
||||||
public float destoryTime = 2f;
|
public float destoryTime = 2f;
|
||||||
|
|
||||||
|
|
||||||
@@ -27,19 +27,43 @@ namespace TON
|
|||||||
|
|
||||||
void OnEnable()
|
void OnEnable()
|
||||||
{
|
{
|
||||||
elapsedTime = 0f; // 오브젝트가 활성화될 때 초기화
|
elapsedTime = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InvokeExcuteSkill()
|
||||||
|
{
|
||||||
|
InvokeRepeating(nameof(ExecuteSkill), 0f, 1f); // 즉시 실행 후 1초 간격 반복
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExecuteSkill()
|
||||||
|
{
|
||||||
|
if (elapsedTime >= destoryTime)
|
||||||
|
{
|
||||||
|
CancelInvoke(nameof(ExecuteSkill)); // 반복 중지
|
||||||
|
ReleaseObject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Log("SkillBase:: " + SkillData.name);
|
||||||
|
UpdateSkill(Time.deltaTime);
|
||||||
|
elapsedTime += 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
CancelInvoke(nameof(ExecuteSkill)); // 오브젝트 비활성화 시 중지
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
UpdateSkill(Time.deltaTime);
|
|
||||||
elapsedTime += Time.deltaTime; // 경과 시간 누적
|
|
||||||
|
|
||||||
// 2초가 지나면 오브젝트 풀에 반환
|
|
||||||
if (elapsedTime >= destoryTime)
|
|
||||||
{
|
|
||||||
ReleaseObject();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetCurrentCoolDown()
|
||||||
|
{
|
||||||
|
CurrentCoolDown = SkillData.coolDown; // 쿨타임 시작
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSkill(float deltaTime)
|
public void UpdateSkill(float deltaTime)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace TON
|
|||||||
public class SkillDataManager : SingletonBase<SkillDataManager>
|
public class SkillDataManager : SingletonBase<SkillDataManager>
|
||||||
{
|
{
|
||||||
public List<SkillData> skillDatas { get; private set; }
|
public List<SkillData> skillDatas { get; private set; }
|
||||||
public List<SkillBase> skillBases { get; private set; }
|
public SerializableDictionary<string, SkillBase> skillInstances { get; private set; }
|
||||||
|
|
||||||
protected override void Awake()
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
@@ -22,12 +22,121 @@ namespace TON
|
|||||||
{
|
{
|
||||||
skillDatas = new List<SkillData>();
|
skillDatas = new List<SkillData>();
|
||||||
}
|
}
|
||||||
// skillData를 skillBase로 치환
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SkillData GetSkillData(string skillId)
|
public void SetSkillInstances()
|
||||||
{
|
{
|
||||||
return skillDatas.Find(v => v.id == skillId);
|
skillInstances = new SerializableDictionary<string, SkillBase>();
|
||||||
|
// skillData를 skillBase로 치환
|
||||||
|
foreach (var skillData in skillDatas)
|
||||||
|
{
|
||||||
|
skillInstances.Add(skillData.id, InitSkillData(skillData));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 스킬 슬롯에 배치할 수 있는 스킬 수 리턴하는 메소드
|
||||||
|
public int GetActiveSkillCount()
|
||||||
|
{
|
||||||
|
int characterLevel = PlayerDataManager.Singleton.player.level;
|
||||||
|
int availableSkillCount = 0;
|
||||||
|
|
||||||
|
foreach (SkillData skill in skillDatas)
|
||||||
|
{
|
||||||
|
if (skill.requiredLevel <= characterLevel)
|
||||||
|
{
|
||||||
|
availableSkillCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return availableSkillCount > 3 ? 3 : availableSkillCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 슬롯에 적용해야하는 스킬 리스트 리턴
|
||||||
|
public List<SkillBase> GetActiveSkillInstance()
|
||||||
|
{
|
||||||
|
List<SkillBase> filteredSkills = new List<SkillBase>();
|
||||||
|
|
||||||
|
foreach (SkillData skill in skillDatas)
|
||||||
|
{
|
||||||
|
if (skill.slotNumber == 1 || skill.slotNumber == 2 || skill.slotNumber == 3)
|
||||||
|
{
|
||||||
|
filteredSkills.Add(skillInstances.GetValueOrDefault(skill.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return filteredSkills;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 쿨타임 설정하는 메소드
|
||||||
|
public void SetCoolTime(string skillId)
|
||||||
|
{
|
||||||
|
if (skillInstances.TryGetValue(skillId, out SkillBase skillBase))
|
||||||
|
{
|
||||||
|
skillBase.SetCurrentCoolDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 쿨타임 업데이트 메소드
|
||||||
|
public void UpdateSkillCoolDown(string skillId)
|
||||||
|
{
|
||||||
|
if (skillInstances.TryGetValue(skillId, out SkillBase skillBase))
|
||||||
|
{
|
||||||
|
skillBase.UpdateSkill(Time.deltaTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬을 실행할 수 있는지 확인
|
||||||
|
public bool CanExecuteSkill(string skillId)
|
||||||
|
{
|
||||||
|
if (skillInstances.TryGetValue(skillId, out SkillBase skill))
|
||||||
|
{
|
||||||
|
return skill.CurrentCoolDown <= 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬의 쿨타임 및 파괴 로직 실행 메소드
|
||||||
|
public void InvokeExcuteSkill(string skillId)
|
||||||
|
{
|
||||||
|
if (skillInstances.TryGetValue(skillId, out SkillBase skill))
|
||||||
|
{
|
||||||
|
skill.InvokeExcuteSkill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 스킬 발사(생성) 메소드 추가
|
||||||
|
public void ExecuteSkill(string skillId, Transform firePoint, float lastDirection)
|
||||||
|
{
|
||||||
|
// 스킬 생성
|
||||||
|
GameObject skill = ObjectPoolManager.Instance.GetEffect(skillId);
|
||||||
|
|
||||||
|
skill.transform.SetPositionAndRotation(firePoint.position, firePoint.rotation);
|
||||||
|
|
||||||
|
// 🔥 스킬 방향 반전
|
||||||
|
var bulletScale = skill.transform.localScale;
|
||||||
|
bulletScale.x = Mathf.Abs(bulletScale.x) * lastDirection;
|
||||||
|
skill.transform.localScale = bulletScale;
|
||||||
|
|
||||||
|
// 스킬 이동 방향 설정
|
||||||
|
Rigidbody2D skillRb = skill.GetComponent<Rigidbody2D>();
|
||||||
|
skillRb.velocity = new Vector2(lastDirection * 5f, 0f);
|
||||||
|
|
||||||
|
|
||||||
|
InvokeExcuteSkill(skillId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SkillBase InitSkillData(SkillData skillData)
|
||||||
|
{
|
||||||
|
SkillBase skill = gameObject.AddComponent<SkillBase>();
|
||||||
|
skill.Init(skillData);
|
||||||
|
return skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SkillBase GetSkillData(string skillId)
|
||||||
|
{
|
||||||
|
return skillInstances.GetValueOrDefault(skillId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace TON
|
|||||||
PlayerDataManager.Singleton.SetCurrentUserData();
|
PlayerDataManager.Singleton.SetCurrentUserData();
|
||||||
// HeartDataManager.Singleton.();
|
// HeartDataManager.Singleton.();
|
||||||
List<SkillData> skillDatas = SkillDataManager.Singleton.skillDatas;
|
List<SkillData> skillDatas = SkillDataManager.Singleton.skillDatas;
|
||||||
|
SkillDataManager.Singleton.SetSkillInstances();
|
||||||
|
|
||||||
// TODO : Custom Order After System Load
|
// TODO : Custom Order After System Load
|
||||||
// UIManager.Show<IngameUI>(UIList.IngameUI);
|
// UIManager.Show<IngameUI>(UIList.IngameUI);
|
||||||
|
|||||||
@@ -19,30 +19,30 @@ namespace TON
|
|||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private SerializableDictionary<int, ControllerUI_SkillButton> skillButtons;
|
private SerializableDictionary<int, ControllerUI_SkillButton> skillButtons;
|
||||||
|
private SerializableDictionary<string, SkillBase> skillInstances;
|
||||||
private List<SkillData> skillDatas;
|
private List<SkillData> skillDatas;
|
||||||
|
private List<SkillBase> skillBases;
|
||||||
|
|
||||||
|
|
||||||
public void Initalize()
|
public void Initalize()
|
||||||
{
|
{
|
||||||
int characterLevel = PlayerDataManager.Singleton.player.level;
|
int characterLevel = PlayerDataManager.Singleton.player.level;
|
||||||
skillDatas = SkillDataManager.Singleton.skillDatas;
|
skillInstances = SkillDataManager.Singleton.skillInstances;
|
||||||
|
|
||||||
if (skillDatas != null)
|
// 내가 사용할 스킬은 스킬 매니저에서 가져오게 변경
|
||||||
|
|
||||||
|
if (skillInstances != null)
|
||||||
{
|
{
|
||||||
// 사용 가능한 스킬 필터링 (캐릭터 레벨보다 필요 레벨이 낮거나 같은 것만)
|
int skillSlotCount = SkillDataManager.Singleton.GetActiveSkillCount();
|
||||||
List<SkillData> availableSkills = skillDatas
|
List<SkillBase> skillList = SkillDataManager.Singleton.GetActiveSkillInstance();
|
||||||
.Where(skill => skill.requiredLevel <= characterLevel)
|
|
||||||
.OrderBy(skill => skill.requiredLevel) // 필요 레벨이 낮은 순으로 정렬
|
|
||||||
.Take(3) // 최대 3개 선택
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
// 버튼 설정
|
// 버튼 설정
|
||||||
for (int i = 0; i < buttons.Length; i++)
|
for (int i = 0; i < buttons.Length; i++)
|
||||||
{
|
{
|
||||||
if (i < availableSkills.Count)
|
if (i < skillSlotCount)
|
||||||
{
|
{
|
||||||
buttons[i].interactable = true; // 사용 가능
|
buttons[i].interactable = true; // 사용 가능
|
||||||
SkillData skillData = skillDatas.Find(skill => skill.slotNumber == i + 1);
|
SkillBase skillData = skillList.Find(skill => skill.SkillData.slotNumber == i + 1);
|
||||||
skillButtons[i].Initalize(skillData);
|
skillButtons[i].Initalize(skillData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -55,8 +55,6 @@ namespace TON
|
|||||||
{
|
{
|
||||||
Debug.LogError("스킬 정보 로드 오류 발생");
|
Debug.LogError("스킬 정보 로드 오류 발생");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClickJumpButton()
|
public void OnClickJumpButton()
|
||||||
@@ -71,11 +69,15 @@ namespace TON
|
|||||||
|
|
||||||
public void OnClickSkillButton(ControllerUI_SkillButton button)
|
public void OnClickSkillButton(ControllerUI_SkillButton button)
|
||||||
{
|
{
|
||||||
linkedCharactor.SkillAttack(button.skillId);
|
bool skillAttack = linkedCharactor.SkillAttack(button.skillBase.SkillData.id);
|
||||||
SkillData skillData = skillDatas.Find(skill => skill.id == button.skillId);
|
// skill Attack 이 true 일때 만 쿨타임 흘러가게끔
|
||||||
button.SetCoolTime(skillData.coolDown);
|
if (skillAttack)
|
||||||
|
{
|
||||||
|
// SkillData skillData = skillDatas.Find(skill => skill.id == button.skillId);
|
||||||
|
button.SetCoolTime();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ namespace TON
|
|||||||
{
|
{
|
||||||
public class ControllerUI_SkillButton : MonoBehaviour
|
public class ControllerUI_SkillButton : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
[SerializeField] private TextMeshProUGUI coolTimeText;
|
[SerializeField] private TextMeshProUGUI coolTimeText;
|
||||||
[SerializeField] private Image coolTimeDimd;
|
[SerializeField] private Image coolTimeDimd;
|
||||||
[SerializeField] private GameObject skillIcon;
|
[SerializeField] private GameObject skillIcon;
|
||||||
@@ -17,61 +16,49 @@ namespace TON
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private SerializableDictionary<string, Sprite> skillSprite = new SerializableDictionary<string, Sprite>();
|
private SerializableDictionary<string, Sprite> skillSprite = new SerializableDictionary<string, Sprite>();
|
||||||
|
|
||||||
public string skillId;
|
public float currentCoolDown;
|
||||||
|
public SkillBase skillBase;
|
||||||
public float maxCooldown;
|
|
||||||
|
|
||||||
|
|
||||||
|
public void Initalize(SkillBase skillData)
|
||||||
public void Initalize(SkillData skillData)
|
|
||||||
{
|
{
|
||||||
skillId = skillData.id;
|
skillBase = skillData;
|
||||||
maxCooldown = skillData.coolDown;
|
|
||||||
InitSkillData(skillData);
|
|
||||||
skillIcon.SetActive(true);
|
skillIcon.SetActive(true);
|
||||||
skillIcon.GetComponent<Image>().sprite = skillSprite.GetValueOrDefault(skillData.id, null);
|
skillIcon.GetComponent<Image>().sprite = skillSprite.GetValueOrDefault(skillBase.SkillData.id, null);
|
||||||
lockImage.SetActive(false);
|
lockImage.SetActive(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCoolTime(float remain)
|
public void SetCoolTime()
|
||||||
{
|
{
|
||||||
coolTimeText.gameObject.SetActive(remain > 0f);
|
SkillDataManager.Singleton.SetCoolTime(skillBase.SkillData.id);
|
||||||
coolTimeText.text = $"{Mathf.CeilToInt(remain)}s";
|
if (skillBase.CurrentCoolDown <= 0)
|
||||||
coolTimeDimd.fillAmount = remain / maxCooldown;
|
|
||||||
|
|
||||||
}
|
|
||||||
private SkillBase InitSkillData(SkillData skillData)
|
|
||||||
{
|
{
|
||||||
switch (skillData.id)
|
// 현재 스킬의 스킬 쿨다운 값을 설정
|
||||||
|
skillBase.SetCurrentCoolDown();
|
||||||
|
currentCoolDown = skillBase.CurrentCoolDown;
|
||||||
|
UpdateCooldownUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateCooldownUI()
|
||||||
{
|
{
|
||||||
case "K0001":
|
coolTimeText.gameObject.SetActive(currentCoolDown > 0); // 남은 쿨타임이 있을 때만 표시
|
||||||
var fireBall = gameObject.AddComponent<FireBall>();
|
coolTimeText.text = $"{Mathf.CeilToInt(currentCoolDown)}s"; // 정수 초단위 표시
|
||||||
fireBall.Init(skillData);
|
coolTimeDimd.fillAmount = currentCoolDown / skillBase.SkillData.coolDown; // 1 → 0 으로 감소
|
||||||
return fireBall;
|
}
|
||||||
case "K0002":
|
|
||||||
var iceBall = gameObject.AddComponent<IceBall>();
|
void Update()
|
||||||
iceBall.Init(skillData);
|
{
|
||||||
return iceBall;
|
if (currentCoolDown > 0)
|
||||||
case "K0003":
|
{
|
||||||
return null;
|
SkillDataManager.Singleton.UpdateSkillCoolDown(skillBase.SkillData.id); // 남은 쿨타임 감소
|
||||||
case "K0004":
|
UpdateCooldownUI(); // UI 업데이트
|
||||||
return null;
|
}
|
||||||
case "K0005":
|
else
|
||||||
return null;
|
{
|
||||||
case "K0006":
|
|
||||||
return null;
|
|
||||||
case "K0007":
|
|
||||||
return null;
|
|
||||||
case "K0008":
|
|
||||||
return null;
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user