Serializé "DodgePercent"
Serializé la valeur "DodgePercent" qui détermine la probabilité qu'un ennemie fantôme a d'éviter un projectile.
This commit is contained in:
parent
5ea9e8aeab
commit
c14975d1f2
@ -104,6 +104,7 @@ MonoBehaviour:
|
|||||||
_attack_damage: 2
|
_attack_damage: 2
|
||||||
_attack_interval: 2
|
_attack_interval: 2
|
||||||
_enemy: {fileID: 0}
|
_enemy: {fileID: 0}
|
||||||
|
dodgePercent: 25
|
||||||
--- !u!114 &5416582167583119277
|
--- !u!114 &5416582167583119277
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -5,10 +5,14 @@ using UnityEngine;
|
|||||||
public class GhostOpponent : Opponent
|
public class GhostOpponent : Opponent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
//Le taux de chance, en pourcantage (un chiffre entre 0 et 99) que l'ennemie a d'eviter un projectile.
|
||||||
|
private int dodgePercent;
|
||||||
|
|
||||||
public bool dodgedProjectile()
|
public bool dodgedProjectile()
|
||||||
{
|
{
|
||||||
System.Random random = new System.Random();
|
System.Random random = new System.Random();
|
||||||
if(random.Next(0, 99) > 25) return false;
|
if(random.Next(0, 99) > dodgePercent) return false;
|
||||||
else return true;
|
else return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user