Ejemplo n.º 1
0
 public void setScaredBullet(ScaredBullet scaredBullet)
 {
     bulletSpe.scaredBullet = scaredBullet;
     Debug.Log("子弹特效更新:" + "\r\n" +
               "恐惧属性: " + bulletSpe.scaredBullet.scaredEffect + "\r\n" +
               "恐惧概率: " + bulletSpe.scaredBullet.sacredPercent);
 }
Ejemplo n.º 2
0
    //判断恐惧效果
    public void getScared(enemy_property enemyProperty, ScaredBullet scaredBullet)
    {
        int num = Random.Range(1, 101);

        if (num <= scaredBullet.sacredPercent)
        {
            Debug.Log("敌人被恐惧");
            enemyProperty.scared = true;
        }
    }
Ejemplo n.º 3
0
    //检查子弹的特殊效果
    override public void checkBulletEffect(GameObject enemy, GameObject bullet)
    {
        bullet_property bulletProperty = bullet.GetComponent <bullet_property> ();
        enemy_property  enemyProperty  = enemy.GetComponent <enemy_property> ();

        if (bulletProperty)
        {
            //是否具有恐惧效果
            if (bulletProperty.bulletSpe.scaredBullet.scaredEffect)
            {
                ScaredBullet scaredBullet = bulletProperty.bulletSpe.scaredBullet;
                getScared(enemyProperty, scaredBullet);
            }
        }
    }