Add Player Skills panel

This commit is contained in:
kabix09 2022-12-25 03:39:31 +01:00
parent 92a1c69685
commit 886eec8984
24 changed files with 4005 additions and 48 deletions

BIN
Assets/GUI items/A_Add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -0,0 +1,109 @@
fileFormatVersion: 2
guid: e83136731832d6342899ba837d5224bb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -52,10 +52,15 @@ public class NewGame : MonoBehaviour
PlayerPrefs.SetInt("pickaxe", 0);
PlayerPrefs.SetInt("healthPoints", 0);
PlayerPrefs.SetInt("defensePoints", 0);
PlayerPrefs.SetInt("StrengthPoints", 0);
PlayerPrefs.SetInt("IntelligencePoints", 0);
// PLAYER SKILLS ------------------------------------------------------
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, 0);
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS, 0); // healthPoints
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS, 0); // defensePoints
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_STRENGHT_POINTS, 0); // StrengthPoints
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_INTELIGENCE_POINTS, 0); // IntelligencePoints
// --------------------------------------------------------------------
//LETTER --------------------------------------------------------------
PlayerPrefs.SetInt("PrologueLetter.WhereDisplayed", 0);
@ -64,6 +69,7 @@ public class NewGame : MonoBehaviour
//NPC ACTIONS HERE ----------------------------------------------------
// -> Wizard House
PlayerPrefs.SetInt("Wizard.FirstDialogue", 0);
// --------------------------------------------------------------------

View File

@ -16,7 +16,7 @@ MonoBehaviour:
CurrentStep: 0
DialogueSteps:
- Header: Boss Thug
WasDisplayed: 1
WasDisplayed: 0
ListOfSentences:
- Sentence: Who are you? How did you get past my guards?!
Buttons: []

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -24421,6 +24421,54 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 158070407}
m_CullTransparentMesh: 1
--- !u!1 &180810562
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 180810563}
- component: {fileID: 180810564}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &180810563
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 180810562}
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_Children: []
m_Father: {fileID: 277471083}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &180810564
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 180810562}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &182783044
GameObject:
m_ObjectHideFlags: 0
@ -50832,6 +50880,7 @@ Transform:
- {fileID: 1133845001}
- {fileID: 67120569}
- {fileID: 239749517}
- {fileID: 180810563}
m_Father: {fileID: 557637066}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -182685,6 +182734,7 @@ GameObject:
- component: {fileID: 1288958692}
- component: {fileID: 1288958691}
- component: {fileID: 1288958690}
- component: {fileID: 1288958695}
- component: {fileID: 1288958689}
- component: {fileID: 1288958688}
- component: {fileID: 1288958694}
@ -182817,6 +182867,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &1288958695
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1288958686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &1290903873
GameObject:
m_ObjectHideFlags: 0

View File

@ -74106,9 +74106,58 @@ Transform:
- {fileID: 1206337686}
- {fileID: 1022973875}
- {fileID: 764402918}
- {fileID: 142543313}
m_Father: {fileID: 1228769387}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &142543312
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 142543313}
- component: {fileID: 142543314}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &142543313
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 142543312}
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_Children: []
m_Father: {fileID: 41994467}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &142543314
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 142543312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &153193740
GameObject:
m_ObjectHideFlags: 0
@ -74615,6 +74664,7 @@ GameObject:
- component: {fileID: 222320499}
- component: {fileID: 222320498}
- component: {fileID: 222320497}
- component: {fileID: 222320502}
- component: {fileID: 222320496}
- component: {fileID: 222320495}
- component: {fileID: 222320501}
@ -74747,6 +74797,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &222320502
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 222320493}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &276945914
GameObject:
m_ObjectHideFlags: 0
@ -119202,7 +119266,7 @@ MonoBehaviour:
ChestType: 0
Content: []
UiManager: {fileID: 0}
ElementsToBuildOnSceneList: []
ChestsToBuildOnScene: []
convertedData: []
--- !u!1 &1567981116
GameObject:

View File

@ -238477,14 +238477,8 @@ MonoBehaviour:
- Key: 0
Value: {fileID: 11400000, guid: 0b370999d245bbf4ab85d24fd050f82a, type: 2}
Dialogue: {fileID: 0}
shop:
Content:
- Key: 0
Value: {fileID: 11400000, guid: 5cc7ba6926eaba9458a2713287847799, type: 2}
- Key: 1
Value: {fileID: 11400000, guid: b366ff81d4bcf0d4f9633bbbf7ea17df, type: 2}
- Key: 2
Value: {fileID: 11400000, guid: 56c5c2b6450ca9e44bae4cf253354d38, type: 2}
shopModel:
Content: []
--- !u!114 &593922350
MonoBehaviour:
m_ObjectHideFlags: 0
@ -502520,6 +502514,7 @@ GameObject:
- component: {fileID: 1734853911}
- component: {fileID: 1734853910}
- component: {fileID: 1734853909}
- component: {fileID: 1734853914}
- component: {fileID: 1734853908}
- component: {fileID: 1734853907}
- component: {fileID: 1734853913}
@ -502652,6 +502647,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &1734853914
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1734853905}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &1735824300
GameObject:
m_ObjectHideFlags: 0
@ -515371,6 +515380,7 @@ Transform:
- {fileID: 166764749}
- {fileID: 1743473112}
- {fileID: 184342403}
- {fileID: 1966318584}
m_Father: {fileID: 1618102915}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -527301,6 +527311,54 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1966318583
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1966318584}
- component: {fileID: 1966318585}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1966318584
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1966318583}
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_Children: []
m_Father: {fileID: 1864162581}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1966318585
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1966318583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &1966720116
GameObject:
m_ObjectHideFlags: 0

View File

@ -509,7 +509,7 @@ Transform:
- {fileID: 1726606093}
- {fileID: 716255557}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &155263505
GameObject:
@ -575,7 +575,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &165983836
GameObject:
@ -4788,7 +4788,7 @@ Transform:
- {fileID: 226494199}
- {fileID: 1154981160}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &478505921
GameObject:
@ -4824,7 +4824,7 @@ Transform:
- {fileID: 2025408080}
- {fileID: 1708139362}
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &489004227
GameObject:
@ -4961,7 +4961,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &539229154
GameObject:
@ -5494,7 +5494,7 @@ RectTransform:
- {fileID: 1745081657}
- {fileID: 644925731}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -19025,12 +19025,12 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 675531960}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_Father: {fileID: 2056121819}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &712469804
GameObject:
@ -21184,6 +21184,7 @@ Transform:
- {fileID: 2082022417}
- {fileID: 2056121819}
- {fileID: 1766935697}
- {fileID: 1780879780}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -25415,7 +25416,7 @@ Transform:
m_LocalScale: {x: 1.975, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1515634641
GameObject:
@ -27237,7 +27238,7 @@ MonoBehaviour:
ChestType: 0
Content: []
UiManager: {fileID: 0}
ElementsToBuildOnSceneList: []
ChestsToBuildOnScene: []
convertedData: []
--- !u!1 &1775895168
GameObject:
@ -27353,6 +27354,54 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1780879779
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1780879780}
- component: {fileID: 1780879781}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1780879780
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780879779}
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_Children: []
m_Father: {fileID: 992309625}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1780879781
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1780879779}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &1816694439
GameObject:
m_ObjectHideFlags: 0
@ -28767,6 +28816,7 @@ Transform:
- {fileID: 787186378}
- {fileID: 1301442102}
- {fileID: 1234651974}
- {fileID: 675531964}
m_Father: {fileID: 992309625}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -28782,6 +28832,7 @@ GameObject:
- component: {fileID: 2082022422}
- component: {fileID: 2082022421}
- component: {fileID: 2082022420}
- component: {fileID: 2082022423}
- component: {fileID: 2082022419}
- component: {fileID: 2082022418}
m_Layer: 0
@ -28881,6 +28932,20 @@ MonoBehaviour:
DynamicPanel: {fileID: 0}
keyToOpen: 113
Elements: []
--- !u!114 &2082022423
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2082022416}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &2096268658
GameObject:
m_ObjectHideFlags: 0
@ -28937,7 +29002,7 @@ Transform:
- {fileID: 437961818}
- {fileID: 1446355165}
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2132145651
GameObject:
@ -29076,5 +29141,5 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -151010,6 +151010,54 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 398661287}
m_CullTransparentMesh: 1
--- !u!1 &399522537
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 399522538}
- component: {fileID: 399522539}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &399522538
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 399522537}
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_Children: []
m_Father: {fileID: 1777083284}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &399522539
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 399522537}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &399600711
GameObject:
m_ObjectHideFlags: 0
@ -191418,6 +191466,7 @@ GameObject:
- component: {fileID: 737146846}
- component: {fileID: 737146845}
- component: {fileID: 737146844}
- component: {fileID: 737146849}
- component: {fileID: 737146843}
- component: {fileID: 737146842}
- component: {fileID: 737146848}
@ -191550,6 +191599,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &737146849
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 737146840}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &741504831
GameObject:
m_ObjectHideFlags: 0
@ -769708,6 +769771,7 @@ Transform:
- {fileID: 501671382}
- {fileID: 920737004}
- {fileID: 32218798}
- {fileID: 399522538}
m_Father: {fileID: 578984179}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -41608,6 +41608,7 @@ Transform:
- {fileID: 1833717355}
- {fileID: 149978586}
- {fileID: 2073875298}
- {fileID: 2059437276}
m_Father: {fileID: 1602706375}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -42831,6 +42832,7 @@ GameObject:
- component: {fileID: 1458715764}
- component: {fileID: 1458715763}
- component: {fileID: 1458715762}
- component: {fileID: 1458715767}
- component: {fileID: 1458715761}
- component: {fileID: 1458715760}
- component: {fileID: 1458715766}
@ -42963,6 +42965,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &1458715767
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1458715758}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &1463806449
GameObject:
m_ObjectHideFlags: 0
@ -148214,6 +148230,54 @@ PolygonCollider2D:
- {x: 1.1122776, y: -0.191046}
- {x: 1.196473, y: 0.21573138}
- {x: 1.2040371, y: 0.46017045}
--- !u!1 &2059437275
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2059437276}
- component: {fileID: 2059437277}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2059437276
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2059437275}
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_Children: []
m_Father: {fileID: 1273555370}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2059437277
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2059437275}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &2060891297
GameObject:
m_ObjectHideFlags: 0

View File

@ -28356,6 +28356,54 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1129725519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1129725520}
- component: {fileID: 1129725521}
m_Layer: 0
m_Name: Skills
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1129725520
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1129725519}
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_Children: []
m_Father: {fileID: 1539180721}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1129725521
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1129725519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d182c7598cb76644a8d4fa68ef71c95e, type: 3}
m_Name:
m_EditorClassIdentifier:
FreePoints: 0
StrenghtPoints: 0
DefensePoints: 0
HealthPoints: 0
InteligencePoints: 0
--- !u!1 &1134345424
GameObject:
m_ObjectHideFlags: 0
@ -31356,6 +31404,7 @@ Transform:
- {fileID: 1134345425}
- {fileID: 1284827861}
- {fileID: 1302056881}
- {fileID: 1129725520}
m_Father: {fileID: 1144548810}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -34019,6 +34068,7 @@ GameObject:
- component: {fileID: 1701466742}
- component: {fileID: 1701466741}
- component: {fileID: 1701466740}
- component: {fileID: 1701466745}
- component: {fileID: 1701466739}
- component: {fileID: 1701466738}
- component: {fileID: 1701466744}
@ -34151,6 +34201,20 @@ MonoBehaviour:
keyToOpen: 101
Elements: []
CurrentShopOwnerName:
--- !u!114 &1701466745
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1701466736}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dbf560da69f41534780f479f1d5566eb, type: 3}
m_Name:
m_EditorClassIdentifier:
DynamicPanel: {fileID: 0}
keyToOpen: 117
--- !u!1 &1702764354
GameObject:
m_ObjectHideFlags: 0

View File

@ -104,6 +104,10 @@ public class Player : MonoBehaviour
lvl = 2;
lvlUp = true;
maxExp = 50;
// Add points and refresh view (if opened)
SkillsPointsManger.Instance.AddFreePoints(2);
SkillsPointsManger.Instance.UpdatePanelView();
}
}
else if (lvl == 2)
@ -114,6 +118,10 @@ public class Player : MonoBehaviour
lvl = 3;
lvlUp = true;
maxExp = 100;
// Add points and refresh view (if opened)
SkillsPointsManger.Instance.AddFreePoints(2);
SkillsPointsManger.Instance.UpdatePanelView();
}
}
else if (lvl == 3)
@ -124,6 +132,10 @@ public class Player : MonoBehaviour
lvl = 4;
lvlUp = true;
maxExp = 200;
// Add points and refresh view (if opened)
SkillsPointsManger.Instance.AddFreePoints(2);
SkillsPointsManger.Instance.UpdatePanelView();
}
}
}
@ -131,7 +143,7 @@ public class Player : MonoBehaviour
public void TakeDamage(float damage, bool isPanelEnabled = true)
{
defensePoints = PlayerPrefs.GetInt("defensePoints");
defensePoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS);
if(defensePoints == 1)
{
damage = damage * 0.95f;
@ -329,7 +341,7 @@ public class Player : MonoBehaviour
public void ManageHealth()
{
healthPoints = PlayerPrefs.GetInt("healthPoints");
healthPoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS);
if (healthPoints == 0)
{
PlayerPrefs.SetFloat("maxHealth", 10);
@ -350,9 +362,12 @@ public class Player : MonoBehaviour
public void AddHealthPoint()
{
healthPoints = PlayerPrefs.GetInt("healthPoints");
healthPoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS);
healthPoints = healthPoints + 1;
PlayerPrefs.SetInt("healthPoints", healthPoints);
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS, healthPoints);
// Fetch change in scene manager responsible for this data
SkillsPointsManger.Instance.UpdatePanelView();
}
public void ManageStrength()
@ -376,7 +391,7 @@ public class Player : MonoBehaviour
PlayerPrefs.SetFloat("attackValue", attackValue);
}
strengthPoints = PlayerPrefs.GetInt("strengthPoints");
strengthPoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_STRENGHT_POINTS);
if(strengthPoints == 1)
{
attackValue = PlayerPrefs.GetFloat("attackValue");
@ -399,39 +414,47 @@ public class Player : MonoBehaviour
public void AddStrengthPoint()
{
strengthPoints = PlayerPrefs.GetInt("strengthPoints");
strengthPoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_STRENGHT_POINTS);
strengthPoints = strengthPoints + 1;
PlayerPrefs.SetInt("strengthPoints", strengthPoints);
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_STRENGHT_POINTS, strengthPoints);
// Fetch change in scene manager responsible for this data
SkillsPointsManger.Instance.UpdatePanelView();
}
public void ManageDefense()
{
defensePoints = PlayerPrefs.GetInt("defensePoints");
defensePoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS);
}
public void AddDefensePoint()
{
defensePoints = PlayerPrefs.GetInt("defensePoints");
defensePoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS);
defensePoints = defensePoints + 1;
PlayerPrefs.SetInt("defensePoints", defensePoints);
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS, defensePoints);
// Fetch change in scene manager responsible for this data
SkillsPointsManger.Instance.UpdatePanelView();
}
public void ManageIntelligence()
{
intelligencePoints = PlayerPrefs.GetInt("intelligencePoints");
intelligencePoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_INTELIGENCE_POINTS);
}
public void AddIntelligencePoint()
{
intelligencePoints = PlayerPrefs.GetInt("intelligencePoints");
intelligencePoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_INTELIGENCE_POINTS);
intelligencePoints = intelligencePoints + 1;
PlayerPrefs.SetInt("intelligencePoitns", intelligencePoints);
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_INTELIGENCE_POINTS, intelligencePoints);
// Fetch change in scene manager responsible for this data
SkillsPointsManger.Instance.UpdatePanelView();
}
public void LevelUpPopUp()
{
healthPoints = PlayerPrefs.GetInt("healthPoints");
healthPoints = PlayerPrefs.GetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS);
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4fe926dfbcaddae4086d6182345995c0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 95e49ccca1d67da419c3cd02f2019162
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
class SkillsPointsManger : MonoBehaviour
{
public const string PLAYER_SKILS_FREE_POINTS = "Player.Skills.FreePoints";
public const string PLAYER_SKILS_HEALTH_POINTS = "Player.Skills.HealthPoints";
public const string PLAYER_SKILS_STRENGHT_POINTS = "Player.Skills.StenghtPoints";
public const string PLAYER_SKILS_DEFENSE_POINTS = "Player.Skills.DefensePoints";
public const string PLAYER_SKILS_INTELIGENCE_POINTS = "Player.Skills.InteligencePoints";
public static SkillsPointsManger Instance;
[Header("Player Skills Points")]
public int FreePoints = 0;
public int StrenghtPoints = 0;
public int DefensePoints = 0;
public int HealthPoints = 0;
public int InteligencePoints = 0;
public void Awake()
{
if (Instance == null)
{
// Load saved gold value
LoadValue();
Instance = this;
}
else
{
Destroy(gameObject);
}
}
/// <summary>
/// Function to load values after loading scenes but after changing them by player script
/// Thats because:
/// - this manager fetch values globally on scene
/// - Skills Panel gets info from this script
/// - but.. Plater script modify vales themself and save them in PlayerPrefs instead of this Singleton class - messy...
/// So we must fetch every one change from player.cs
/// </summary>
public void LoadValue()
{
if (PlayerPrefs.HasKey(PLAYER_SKILS_FREE_POINTS))
{
FreePoints = PlayerPrefs.GetInt(PLAYER_SKILS_FREE_POINTS);
}
if (PlayerPrefs.HasKey(PLAYER_SKILS_HEALTH_POINTS))
{
HealthPoints = PlayerPrefs.GetInt(PLAYER_SKILS_HEALTH_POINTS);
}
if (PlayerPrefs.HasKey(PLAYER_SKILS_STRENGHT_POINTS))
{
StrenghtPoints = PlayerPrefs.GetInt(PLAYER_SKILS_STRENGHT_POINTS);
}
if (PlayerPrefs.HasKey(PLAYER_SKILS_DEFENSE_POINTS))
{
DefensePoints = PlayerPrefs.GetInt(PLAYER_SKILS_DEFENSE_POINTS);
}
if (PlayerPrefs.HasKey(PLAYER_SKILS_INTELIGENCE_POINTS))
{
InteligencePoints = PlayerPrefs.GetInt(PLAYER_SKILS_INTELIGENCE_POINTS);
}
}
/// <summary>
/// Points are added after level up! :D
/// see Player::ManageLevels
/// </summary>
public void AddFreePoints(int newPoints)
{
FreePoints += newPoints;
PlayerPrefs.SetInt(PLAYER_SKILS_FREE_POINTS, FreePoints);
}
/// <summary>
/// Function to update value displayed on Inventory Panel - only if is opened
/// </summary>
public void UpdatePanelView()
{
LoadValue();
if (SkillsUIManager.Instance.GetPanelStatus())
{
Debug.Log("UpdatePanelView");
//SkillsUIManager
SkillsUIManager.Instance.DynamicPanel.GetComponent<SkillsPanelController>().RefreshPanelView(
FreePoints,
StrenghtPoints,
DefensePoints,
HealthPoints,
InteligencePoints
);
}
}
}

View File

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

View File

@ -13,12 +13,7 @@ public enum ShopItemCardMode
Sell
}
public enum ShopCardPhrasesEnum
{
Atatck,
Deffence,
Speed,
}
// TODO Bonusy nie sa wyswietlane poprawnie - poprawic po dodaniu poprawnie wypeklnionych itemow!!!
class ShopItemCardKeeper : MonoBehaviour
{

View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TMPro;
using UnityEngine;
public class SkillsPanelController : MonoBehaviour
{
[Header("Current Value")]
public int FreePoints = 0;
[Header("Skills Section")]
[SerializeField] private GameObject FreePointsLabel;
[SerializeField] private GameObject HealthPointsLabel;
[SerializeField] private GameObject StrenghtPointsLabel;
[SerializeField] private GameObject DefensePointsLabel;
[SerializeField] private GameObject InteligencePointsLabel;
public void Start()
{
// Get current remembered value
var skillsPointManager = SkillsPointsManger.Instance;
if (skillsPointManager == null)
throw new NullReferenceException("AccountBalanceManager not found!!!");
// Fetch data from global scene manager responsible for player skill spoints
RefreshPanelView(
skillsPointManager.FreePoints,
skillsPointManager.StrenghtPoints,
skillsPointManager.DefensePoints,
skillsPointManager.HealthPoints,
skillsPointManager.InteligencePoints
);
}
public void RefreshPanelView(
int freePoints,
int strenghtPoints,
int defensePoints,
int healthPoints,
int inteligencePoints
) {
FreePointsLabel.transform.FindChild("Layer").transform.FindChild("Value").GetComponent<TextMeshProUGUI>().text = $"{freePoints}";
FreePoints = freePoints;
BildSkillLabelContent(HealthPointsLabel, healthPoints);
BildSkillLabelContent(StrenghtPointsLabel, strenghtPoints);
BildSkillLabelContent(DefensePointsLabel, defensePoints);
BildSkillLabelContent(InteligencePointsLabel, inteligencePoints);
}
public void BildSkillLabelContent(GameObject skillPanelLabel, int value)
{
skillPanelLabel.transform.FindChild("Layer").transform.FindChild("Value").GetComponent<TextMeshProUGUI>().text = $"{value}";
if (FreePoints > 0)
skillPanelLabel.transform.Find("Button").gameObject.active = true;
else
skillPanelLabel.transform.Find("Button").gameObject.active = false;
}
#region spend skills points actions
public void IncreaseHealth()
{
FreePoints -= 1;
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, FreePoints);
GameObject.FindGameObjectWithTag("Player").GetComponent<Player>().AddHealthPoint();
}
public void IncreaseStrenght()
{
FreePoints -= 1;
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, FreePoints);
GameObject.FindGameObjectWithTag("Player").GetComponent<Player>().AddStrengthPoint();
}
public void IncreaseDefence()
{
FreePoints -= 1;
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, FreePoints);
GameObject.FindGameObjectWithTag("Player").GetComponent<Player>().AddDefensePoint();
}
public void IncreaseInteligence()
{
FreePoints -= 1;
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, FreePoints);
GameObject.FindGameObjectWithTag("Player").GetComponent<Player>().AddIntelligencePoint();
}
#endregion
}

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: be459b6f9ce9acd488dea738b4479b4c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
class SkillsUIManager : MonoBehaviour
{
public const string ITEM_LOCALIZATION = "UiPanels/";
public const string PANEL_NAME = "SkillsPanel";
public static SkillsUIManager Instance { get; protected set; }
[SerializeField] public GameObject DynamicPanel;
[SerializeField] public KeyCode keyToOpen;
public virtual void Awake()
{
if (Instance == null)
{
Instance = this;
}
else
{
Debug.Log(gameObject);
Debug.Log(Instance);
Destroy(gameObject);
}
}
public void Update()
{
if (Input.GetKeyDown(keyToOpen))
{
if (!DynamicPanel)
{
this.OpenPanel();
}
else
{
this.ClosePanel();
}
}
}
/// <summary>
/// Function to fetch currently opened panel asociated with this UI manager
/// </summary>
/// <param name="panelConrtoller"></param>
public void SetPanelController(GameObject panelConrtoller)
{
// ToDo change fetched types
//DynamicPanel = dynamicPanelController;
}
public virtual bool OpenPanel()
{
Console.WriteLine("Panel opened");
GameObject globalGUI = GameObject.FindGameObjectWithTag("GUI");
if (!globalGUI)
throw new Exception("Panel could not be opened - can't find global GUI object!!");
GameObject uiPanelTemplate = GetTemplatePanel();
DynamicPanel = GameObject.Instantiate(uiPanelTemplate, uiPanelTemplate.transform.position, Quaternion.identity, globalGUI.transform); // 4'th arg allow set object as child
DynamicPanel.transform.localPosition = uiPanelTemplate.transform.position; // prevent overwritten position by... environment???
DynamicPanel.name = uiPanelTemplate.name;
SetupPanel();
return true;
}
public virtual bool ClosePanel()
{
Console.WriteLine("Panel closed");
try
{
Destroy(DynamicPanel);
return true;
}
catch (Exception ex) { Debug.LogError(ex.Message); }
return true;
}
public virtual void SetupPanel()
{
if (!DynamicPanel)
throw new Exception("Panel not found - UIBaseManager don't have UI Panel instance!!");
// bind this class instance
//DynamicPanel.GetComponent<TaskPanelController>().Bind(this);
}
/// <summary>
/// Function which return panel status
/// True - if panel is opened and it's instance is handled
/// false - if panel is closed and it's instance is not handled
/// </summary>
/// <returns></returns>
public bool GetPanelStatus()
{
return DynamicPanel != null;
}
protected GameObject GetTemplatePanel()
{
// Resources = default path - Asset/Resources ... .obj
return Resources.Load(ITEM_LOCALIZATION + PANEL_NAME) as GameObject;
}
}

View File

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