1+ using System . Collections . Generic ;
12using Code . Infrastructure . Factory ;
23using Code . Infrastructure . Services . PersistenceProgress ;
34using Code . Infrastructure . Services . PersistenceProgress . Player ;
45using Code . Infrastructure . Services . SaveLoad ;
6+ using UnityEditor ;
57using UnityEngine ;
68
79namespace Code . Infrastructure . Services . GameStater
@@ -28,14 +30,15 @@ public void Initialize()
2830
2931 InitProgress ( ) ;
3032 InitUI ( ) ;
33+
34+ SetUpRandomData ( ) ;
3135 }
32-
36+
3337 private void InitProgress ( )
3438 {
3539 _progressService . PlayerData = LoadProgress ( ) ?? SetUpBaseProgress ( ) ;
3640 }
3741
38-
3942 private void InitUI ( )
4043 {
4144 _uiFactory . CreateUIRoot ( ) ;
@@ -56,5 +59,60 @@ private PlayerData SetUpBaseProgress()
5659 _progressService . PlayerData = progress ;
5760 return progress ;
5861 }
62+
63+ private void SetUpRandomData ( )
64+ {
65+ var progress = new PlayerData
66+ {
67+ PlayerName = $ "Player_{ Random . Range ( 1 , 100 ) } ",
68+ Level = Random . Range ( 1 , 51 ) ,
69+ Health = Random . Range ( 0f , 100f ) ,
70+ HasPremium = Random . value > 0.5f ,
71+ LastLoginTime = System . DateTime . Now ,
72+
73+ Position = new Vector3 (
74+ Random . Range ( - 10f , 10f ) ,
75+ Random . Range ( - 10f , 10f ) ,
76+ Random . Range ( - 10f , 10f )
77+ ) ,
78+
79+ Settings = new GameSettings
80+ {
81+ MusicVolume = Random . Range ( 0f , 1f ) ,
82+ SfxVolume = Random . Range ( 0f , 1f ) ,
83+ IsVibrationEnabled = Random . value > 0.5f ,
84+ Resolution = new ResolutionSettings
85+ {
86+ Width = Random . Range ( 800 , 2560 ) ,
87+ Height = Random . Range ( 600 , 1440 ) ,
88+ Fullscreen = Random . value > 0.5f
89+ }
90+ } ,
91+
92+ Inventory = new InventoryData
93+ {
94+ Coins = Random . Range ( 0 , 1000 ) ,
95+ Gems = Random . Range ( 0 , 100 ) ,
96+ Items = new InventoryItem [ ]
97+ {
98+ new ( ) { Id = "sword_01" , Count = Random . Range ( 1 , 3 ) } ,
99+ new ( ) { Id = "potion_hp" , Count = Random . Range ( 1 , 10 ) } ,
100+ new ( ) { Id = "shield_02" , Count = Random . Range ( 1 , 5 ) }
101+ }
102+ } ,
103+
104+ Quests = new QuestProgress [ ]
105+ {
106+ new ( ) { QuestId = "quest_001" , IsCompleted = Random . value > 0.5f , Progress = Random . Range ( 0f , 1f ) } ,
107+ new ( ) { QuestId = "quest_002" , IsCompleted = Random . value > 0.5f , Progress = Random . Range ( 0f , 1f ) }
108+ }
109+ } ;
110+
111+ _progressService . PlayerData = progress ;
112+ _saveLoadService . SaveProgress ( ) ;
113+
114+ Debug . Log ( "✅ Random player data saved." ) ;
115+ }
116+
59117 }
60118}
0 commit comments