コード例 #1
0
    private void Shoot(IGetDamage target)
    {
        IBullet bullet = new MachineGunBullet(bulletType, currentMachineGunStats.damage);

        target.GetDamage(bullet);
        machineGunClip--;
    }
コード例 #2
0
    private void LazerShoot(IGetDamage target)
    {
        IBullet bullet = new LazerBullet(lazerBulletType, currentLazerCanonStats.damage);

        target.GetDamage(bullet);
        lazerClip--;
    }
コード例 #3
0
 IEnumerator DoAttack()
 {
     while (target != null && target.isLive)
     {
         isCoroutineStart = true;
         target.GetDamage(this);
         parent.transform.LookAt(new Vector3((target.transform.position.x), 0, (target.transform.position.z)));
         DPanel.Add(this, string.Format("Unit <color=yellow>{0}</color> attacks unit <color=red>{1}</color>", parent.Type, target.parent.Type));
         yield return(new WaitForSeconds(TimeBeforeAttacks));
     }
     if (parent.Type == Unit.UnitType.Zombie)
     {
         parent.MoveController.Target = MarkersManager.inst.mainBase.MarkerPosition;
     }
     isAttack         = false;
     isCoroutineStart = false;
     StopCoroutine(DoAttack());
 }