-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerInputMenu.cs
823 lines (616 loc) · 24.1 KB
/
PlayerInputMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
using System;
public class PlayerInputMenu : MonoBehaviour
{
public static PlayerInputMenu instance;
private void Awake()
{
instance = this;
}
#region Class Related Variables
[Header("Class: Knight Menus")]
public GameObject knightClassPanel;
public GameObject knightMainActionMenu;
public GameObject knightMeleeMenu;
[Header("Class: Ranger Menus")]
public GameObject rangerClassPanel;
public GameObject rangerMainActionMenu;
public GameObject rangerMeleeMenu;
public GameObject rangerRangedMenu;
[Header("Class: FireMage Menus")]
public GameObject fireMageClassPanel;
public GameObject fireMageMainActionsMenu;
public GameObject fireMageMeleeMenu;
public GameObject fireMageSpellsMenu;
[Header("Class: Priest Menus")]
public GameObject priestClassPanel;
public GameObject priestMainActionsMenu;
public GameObject priestMeleeMenu;
public GameObject priestHealingMenu;
#endregion
#region UI Related Variables
[Header("UI & HUD Elements")]
[Tooltip("Assign the appropriate UI Elements")]
public GameObject noTargetsFoundParent;
public GameObject turnPointParent;
public TextMeshProUGUI turnPointText;
public TextMeshProUGUI noEnemyFoundText;
public float errorDisplayTime;
public float errorCounter;
[Header("Bools for Various controls")]
[Tooltip("Animation bool controls")]
public bool selectedWalk, selectedDash;
[Header("Fade Variables")] //FOR FADING OUT THE NO ENEMIES FOUND MESSAGE
bool isFade;
float startFade = 50;
float startTextFade = 255;
float endFade = 0;
float speed = 40;
#endregion
public CharacterControl characterControl;
private void Start()
{
}
#region Class Panels
public void ShowClassPanel()
{
characterControl = GameManager.instance.ActivePlayer;
turnPointParent.SetActive(true);
turnPointText.gameObject.SetActive(true); //Display the remaining turn points
if (characterControl.isKnight)
{
knightClassPanel.SetActive(true);
rangerClassPanel.SetActive(false);
priestClassPanel.SetActive(false);
fireMageClassPanel.SetActive(false);
//Fill the Action Related Menus according to the class
//Set the frame according to the class
}
if (characterControl.isRanger)
{
knightClassPanel.SetActive(false);
rangerClassPanel.SetActive(true);
priestClassPanel.SetActive(false);
fireMageClassPanel.SetActive(false);
//Fill the Action Related Menus according to the class
//Set the frame according to the class
}
if (characterControl.isMage)
{
knightClassPanel.SetActive(false);
rangerClassPanel.SetActive(false);
priestClassPanel.SetActive(false);
fireMageClassPanel.SetActive(true);
//Fill the Action Related Menus according to the class
//Set the frame according to the class
}
if (characterControl.isPriest)
{
knightClassPanel.SetActive(false);
rangerClassPanel.SetActive(false);
priestClassPanel.SetActive(true);
fireMageClassPanel.SetActive(false);
//Fill the Action Related Menus according to the class
//Set the frame according to the class
}
}
public void HideClassPanel()
{
characterControl = GameManager.instance.ActivePlayer;
turnPointParent.SetActive(false);
turnPointText.gameObject.SetActive(false); //Display the remaining turn points
knightClassPanel.SetActive(false);
rangerClassPanel.SetActive(false);
priestClassPanel.SetActive(false);
fireMageClassPanel.SetActive(false);
}
#endregion
#region Knight Class
#region Knight Class Menu Related
public void ShowKnightMeleeMenu() //Show Knight Attack Menu
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
knightMainActionMenu.SetActive(false);
knightMeleeMenu.SetActive(true);
}
public void HideKnightMeleeMenu() //Hide Knight Attack Menu
{
knightMeleeMenu.SetActive(false);
knightMainActionMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
#endregion
#region Knight Class Melee Related
public void KnightCheckMelee()
{
GameManager.instance.ActivePlayer.GetMeleeTargets();
if (GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.meleeTargets
[GameManager.instance.ActivePlayer.currentMeleeTarget].transform.position;
GameManager.instance.TargetDisplay.SetActive(true);
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range"); //Show the message if no enemies within melee range
}
}
public void KnightMeleeHit() //MELEE HIT FOR THE KNIGHT
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isAttacking", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range");
}
GameManager.instance.ActivePlayer.DisableMeleeAnimation();
GameManager.instance.ActivePlayer.DoMelee();
HideKnightMeleeMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
//IMPLEMENT STUN SKILL
public void KnightStunHit() //KNIGHT STUN SKILL
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("toStun", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range");
}
GameManager.instance.ActivePlayer.DisableMeleeAnimation();
GameManager.instance.ActivePlayer.DoMelee(true); //Doing the melee but it's not stunning the target
HideKnightMeleeMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#endregion
#region Ranger Class
#region Ranger Class Menu Related
public void ShowRangeMeleeMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
rangerMainActionMenu.SetActive(false);
rangerMeleeMenu.SetActive(true);
}
public void HideRangerMeleeMenu()
{
rangerMeleeMenu.SetActive(false);
rangerMainActionMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
public void ShowRangerRangedMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
rangerMainActionMenu.SetActive(false);
rangerRangedMenu.SetActive(true);
}
public void HideRangerRangedMenu()
{
rangerRangedMenu.SetActive(false);
rangerMainActionMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
#endregion
#region Ranger Melee Related
public void RangerMeleeCheck()
{
GameManager.instance.TargetDisplay.SetActive(true);
GameManager.instance.ActivePlayer.GetMeleeTargets();
if (GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.TargetDisplay.SetActive(true);
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.meleeTargets
[GameManager.instance.ActivePlayer.currentMeleeTarget].transform.position;
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range"); //Show the message if no enemies within melee range
}
}
public void RangerMeleeHit() //MELEE HIT FOR THE KNIGHT
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isAttacking", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range");
}
GameManager.instance.ActivePlayer.DisableMeleeAnimation();
GameManager.instance.ActivePlayer.DoMelee();
HideRangerMeleeMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#region Ranger Ranged Attack Related
public void RangerRangedCheck()
{
GameManager.instance.ActivePlayer.GetRangedTargets();
if (GameManager.instance.ActivePlayer.rangedTargets.Count > 0)
{
CameraSystem.instance.SetMoveTarget(characterControl.rangedTargets[characterControl.currentRangedTarget].transform.position); //Move the camera to the target
GameManager.instance.TargetDisplay.SetActive(true);
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.rangedTargets
[GameManager.instance.ActivePlayer.currentRangedTarget].transform.position;
}
else
{
NoEnemiesInRangeMessage("No Enemies within Range"); //Show the message if no enemies within melee range
}
}
public void RangerRangedAttack() //MELEE HIT FOR THE RANGER
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.rangedTargets.Count > 0)
{
Vector3 targetPosition = characterControl.rangedTargets[characterControl.currentRangedTarget].transform.position;
GameManager.instance.ActivePlayer.animator.SetBool("isRangedAttacking", true);
//GameObject missile = Instantiate(characterControl.Arrow, GameManager.instance.activePlayer.transform.position, transform.rotation.normalized);
//missile.transform.Translate(targetPosition * 20f * Time.deltaTime);
/*
if (Vector3.Distance(missile.transform.position,
characterControl.rangedTargets[characterControl.currentRangedTarget].transform.position) < 0.5f)
{
Destroy(missile);
}
*/
}
GameManager.instance.ActivePlayer.DisableRangedAnimation();
GameManager.instance.ActivePlayer.ShootTheTarget();
HideRangerRangedMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#endregion
#region Fire Mage Class
#region Fire Mage Class Menu Related
public void ShowFireMageMeleeMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
fireMageMeleeMenu.SetActive(true);
fireMageMainActionsMenu.SetActive(false);
}
public void HideFireMageMeleeMenu()
{
fireMageMeleeMenu.SetActive(false);
fireMageMainActionsMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
public void ShowFireMageSpellsMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
fireMageMainActionsMenu.SetActive(false);
fireMageSpellsMenu.SetActive(true);
}
public void HideFireMageSpellsMenu()
{
fireMageSpellsMenu.SetActive(false);
fireMageMainActionsMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
#endregion
#region Fire Mage Melee Related
public void FireMageMeleeCheck()
{
GameManager.instance.ActivePlayer.GetMeleeTargets();
if (GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.meleeTargets
[GameManager.instance.ActivePlayer.currentMeleeTarget].transform.position;
GameManager.instance.TargetDisplay.SetActive(true);
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range"); //Show the message if no enemies within melee range
}
}
public void FireMageMeleeHit() //MELEE HIT FOR THE KNIGHT
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isAttacking", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies within Range"); //Show the message if no enemies within melee range
}
GameManager.instance.ActivePlayer.DisableMeleeAnimation();
GameManager.instance.ActivePlayer.DoMelee();
HideFireMageMeleeMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#region Fire Mage Spells Related
public void FireMageRangedCheck()
{
GameManager.instance.ActivePlayer.GetRangedTargets();
if (GameManager.instance.ActivePlayer.rangedTargets.Count > 0)
{
CameraSystem.instance.SetMoveTarget(characterControl.rangedTargets[characterControl.currentRangedTarget].transform.position); //Move the camera to the target
GameManager.instance.TargetDisplay.SetActive(true);
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.rangedTargets
[GameManager.instance.ActivePlayer.currentRangedTarget].transform.position;
}
else
{
NoEnemiesInRangeMessage("No Enemies within Range"); //Show the message if no enemies within melee range
}
}
public void FireMageSpellAttack() //RANGED ATTACK FOR FIRE MAGE
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.rangedTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isSpellCasting", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies within Range"); //Show the message if no enemies within melee range
}
GameManager.instance.ActivePlayer.DisableRangedSpellAnimation();
GameManager.instance.ActivePlayer.ShootTheTarget();
HideFireMageSpellsMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#endregion
#region Priest Class
#region Priest Class Menu Related
public void ShowPriestMeleeMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
priestMeleeMenu.SetActive(true);
priestMainActionsMenu.SetActive(false);
}
public void HidePriestMeleeMenu()
{
priestMeleeMenu.SetActive(false);
priestMainActionsMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
public void ShowPriestHealingMenu()
{
selectedWalk = false;
selectedDash = false;
MoveGrid.instance.HideMovePoints();
priestMainActionsMenu.SetActive(false);
priestHealingMenu.SetActive(true);
}
public void HidePriestHealingMenu()
{
priestHealingMenu.SetActive(false);
priestMainActionsMenu.SetActive(true);
GameManager.instance.TargetDisplay.SetActive(false);
}
#endregion
#region Priest Melee Related
public void PriestMeleeCheck()
{
GameManager.instance.ActivePlayer.GetMeleeTargets();
if (GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.TargetDisplay.SetActive(true);
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.meleeTargets
[GameManager.instance.ActivePlayer.currentMeleeTarget].transform.position;
}
else
{
NoEnemiesInRangeMessage("No Enemies in Melee Range"); //Show the message if no enemies within melee range
}
}
public void PriestMeleeHit() //MELEE HIT FOR THE KNIGHT
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.meleeTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isAttacking", true);
}
else
{
NoEnemiesInRangeMessage("No Enemies within Range"); //Show the message if no enemies within melee range
}
GameManager.instance.ActivePlayer.DisableMeleeAnimation();
GameManager.instance.ActivePlayer.DoMelee();
HidePriestMeleeMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#region Priest Heal Related
public void PriestHealCheck()
{
GameManager.instance.ActivePlayer.GetTargetsToHeal();
if (GameManager.instance.ActivePlayer.healingTargets.Count > 0 )
{
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.healingTargets
[GameManager.instance.ActivePlayer.currentHealingTarget].transform.position;
GameManager.instance.TargetDisplay.SetActive(true);
}
else
{
NoEnemiesInRangeMessage("No Allies To Heal"); //Show the message if no enemies within melee range
}
}
public void PriestHealSpell() //DO THE HEAL
{
GameManager.instance.TargetDisplay.SetActive(false);
GameManager.instance.currentActionCost = 1;
if(GameManager.instance.ActivePlayer.healingTargets.Count > 0)
{
GameManager.instance.ActivePlayer.animator.SetBool("isSpellCasting", true);
}
GameManager.instance.ActivePlayer.DisableHealingAnimation();
GameManager.instance.ActivePlayer.DoHeal();
HidePriestHealingMenu();
HideClassPanel();
StartCoroutine(WaitToEndActionCo(2f));
}
#endregion
#endregion
#region No Targets Found Messages Related
public void NoEnemiesInRangeMessage(string messageToShow)
{
noEnemyFoundText.text = messageToShow;
//noEnemyFoundText.gameObject.SetActive(true);
noTargetsFoundParent.gameObject.SetActive(true);
noTargetsFoundParent.GetComponent<Image>().color = new Color32(0, 0, 0, 50); //FADE OUT
noEnemyFoundText.GetComponent<TextMeshProUGUI>().color = new Color32(255, 0, 0, 255); //FADE OUT
errorCounter = errorDisplayTime; //FADE OUT COUNTER
}
#endregion
#region Select the Next Target
public void NextMeleeTarget() //Switch to the next target in melee range
{
GameManager.instance.ActivePlayer.currentMeleeTarget++;
if (GameManager.instance.ActivePlayer.currentMeleeTarget >= GameManager.instance.ActivePlayer.meleeTargets.Count)
{
GameManager.instance.ActivePlayer.currentMeleeTarget = 0;
}
CameraSystem.instance.SetMoveTarget(characterControl.meleeTargets[characterControl.currentMeleeTarget].transform.position); //Move the camera to the target
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.meleeTargets
[GameManager.instance.ActivePlayer.currentMeleeTarget].transform.position;
}
public void NextRangedTarget() //Switch to next target in range
{
GameManager.instance.ActivePlayer.currentRangedTarget++;
if (GameManager.instance.ActivePlayer.currentRangedTarget >= GameManager.instance.ActivePlayer.rangedTargets.Count)
{
GameManager.instance.ActivePlayer.currentRangedTarget = 0;
}
CameraSystem.instance.SetMoveTarget(characterControl.rangedTargets[characterControl.currentRangedTarget].transform.position); //Move the camera to the target
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.rangedTargets
[GameManager.instance.ActivePlayer.currentRangedTarget].transform.position;
}
public void NextHealingTarget() //Switch to next healing target
{
GameManager.instance.ActivePlayer.currentHealingTarget++;
if (GameManager.instance.ActivePlayer.currentHealingTarget >= GameManager.instance.ActivePlayer.healingTargets.Count)
{
GameManager.instance.ActivePlayer.currentHealingTarget = 0;
}
CameraSystem.instance.SetMoveTarget(characterControl.healingTargets[characterControl.currentHealingTarget].transform.position); //Move the camera to the target
GameManager.instance.TargetDisplay.transform.position = GameManager.instance.ActivePlayer.healingTargets
[GameManager.instance.ActivePlayer.currentHealingTarget].transform.position;
}
#endregion
#region Grid Related Movement Range
public void ShowMove() //Shows Walk Range as Grid
{
if (GameManager.instance.turnPointsRemaining >= 1)
{
MoveGrid.instance.ShowPointsInRange(GameManager.instance.ActivePlayer.moveRange,
GameManager.instance.ActivePlayer.transform.position);
GameManager.instance.currentActionCost = 1;
selectedWalk = true;
selectedDash = false;
}
}
public void ShowDash() //Shows Dash Range as Grid
{
if (GameManager.instance.turnPointsRemaining >= 2)
{
MoveGrid.instance.ShowPointsInRange(GameManager.instance.ActivePlayer.dashRange,
GameManager.instance.ActivePlayer.transform.position);
GameManager.instance.currentActionCost = 2;
selectedWalk = false;
selectedDash = true;
}
else
{
NoEnemiesInRangeMessage("Not Enough Turn Points");
}
}
#endregion
#region SELF DAMAGE FOR DEBUG
/*
public void SelfDamage()
{
characterControl.animator.SetBool("isDamaged", true);
GameManager.instance.activePlayer.TakeDamage(characterControl.meleeDamage);
characterControl.UpdateHealthDisplay();
}
*/
#endregion
public void UpdateTurnPointText(int turnPoints)
{
turnPointText.text = "Remaining Turn Points: " + turnPoints;
}
public void SkipTurn()
{
MoveGrid.instance.HideMovePoints(); //Hide the movepoints
HideClassPanel(); //Hide the class panels
GameManager.instance.EndTurn();
}
public IEnumerator WaitToEndActionCo(float timeToWait)
{
yield return new WaitForSeconds(timeToWait);
GameManager.instance.SpendTurnPoints();
}
private void Update()
{
if(errorCounter > 0) //COUNTER FOR THE MESSAGE
{
errorCounter -= Time.deltaTime;
if(errorCounter <= 0)
{
//noEnemyPanel.gameObject.SetActive(false);
isFade = true;
}
}
if (isFade) //FADE OUT
{
if(startFade > endFade)
{
startFade -= speed * Time.deltaTime;
startTextFade -= speed * Time.deltaTime * 5;
noTargetsFoundParent.GetComponent<Image>().color = new Color32(0, 0, 0, Convert.ToByte(startFade));
noEnemyFoundText.GetComponent<TextMeshProUGUI>().color = new Color32(255, 0, 0, Convert.ToByte(startTextFade));
}
else
{
isFade = false;
startFade = 50;
startTextFade = 255;
noTargetsFoundParent.gameObject.SetActive(false);
}
}
}
}