Пример #1
0
        protected Player(string name, IAttacking attacking)
        {
            Console.WriteLine($"New player created of class: {name}");

            _name      = name;
            _attacking = attacking;
        }
Пример #2
0
    private void Start()
    {
        Attacking = GetComponent <IAttacking>();
        Attacking.AssignAttackEvent(OnAttackEvent);
        SetWeaponData(StartingWeapon);

        CurrentHealth = Health;
    }
    public void FireArrow(IAttacking attackMethod)//starts moving the arrow towards the target
    {
        Vector3 currentTargetPos = BattleController.currentTarget.transform.position;

        targetPosition = currentTargetPos + targetPosAdj; //clarifies target coordinates
        dealsDamage    = attackMethod;
        ArrowFlies     = true;                            //starts moving the arrow
    }
Пример #4
0
    public void FireArrow(IAttacking attackMethod)// comienza a mover la flecha hacia el objetivo
    {
        Vector3 currentTargetPos = BattleController.currentTarget.transform.position;

        targetPosition = currentTargetPos + targetPosAdj; // aclara las coordenadas del objetivo
        dealsDamage    = attackMethod;
        ArrowFlies     = true;                            // comienza a mover la flecha
    }
Пример #5
0
    void Start()
    {
        attacker = transform.parent.gameObject.GetComponent <IAttacking>();
        isHit    = false;

        if (hitboxes.Length == 0)
        {
            hitboxes = this.GetComponents <BoxCollider2D>();
        }

        hurtboxes = new List <Collider2D>(50);
        enemies   = new List <GameObject>(20);
    }
Пример #6
0
 public AttackState(IAttacking attacking)
 {
     this.attacking = attacking;
 }