Ejemplo n.º 1
0
    private void Update()
    {
        if (_takeDamage)
        {
            var position = _hitPoint.transform.position;
            if (_cutButtle)
            {
                var colliders = Physics2D.OverlapCircleAll(position, 0.9f, _layer);
                for (var i = colliders.Length - 1; i >= 0; i--)
                {
                    if (!colliders[i].CompareTag("Enemy"))
                    {
                        StartCoroutine(colliders[i].gameObject.GetComponent <Bullet>().ButtleDestroy());
                    }
                    else
                    {
                        var temp = _damage;
                        if (_memorizer.Crit(_crit))
                        {
                            temp = _damage * 2 + _playerInfo.NowAp / 2 + (_playerInfo.NowAp % 2 > 0 ? 1 : 0);
                        }
                        object[] parameter = { temp, _inDamage };
                        colliders[i].SendMessage("TakeDamege", parameter);
                    }
                }
            }
        }
        if (!_canuser())
        {
            return;
        }
        var attack = _main.GetInteger("Atk");

        if (attack != 0)
        {
            var temp = _accelerated;
            if (attack == 3)
            {
                temp *= 2;
            }
            if (!_controller.MFacingRight)
            {
                temp *= -1;
            }
            _controller.Move(temp * Time.fixedDeltaTime, false);
        }
        if (!_canFire)
        {
            return;
        }
        if (Input.GetButton("Fire1"))
        {
            Collect();
        }
        else
        {
            WeaponAtk();
        }
    }
Ejemplo n.º 2
0
 private IEnumerator Collider(GameObject colliders)
 {
     if (colliders.CompareTag("Player"))
     {
         var info = colliders.GetComponent <PlayerInfo>();
         if (info.Live)
         {
             info.TakeDamage(Damage + (_memorizer.Crit(Crit) ? Damage : 0));
         }
         else
         {
             yield break;
         }
     }
     StartCoroutine(ButtleDestroy());
     yield break;
 }