private void ShootUnit(UnitGridCombat unitGridCombat, Action onShootComplete)
    {
        GetComponent <IMoveVelocity>().Disable();
        Vector3 attackDir = (unitGridCombat.GetPosition() - transform.position).normalized;

        //UtilsClass.ShakeCamera(.6f, .1f);
        GameHandler_GridCombatSystem.Instance.ScreenShake();

        characterBase.PlayShootAnimation(attackDir, (Vector3 vec) => {
            Shoot_Flash.AddFlash(vec);
            WeaponTracer.Create(vec, unitGridCombat.GetPosition() + GetRandomDir() * UnityEngine.Random.Range(-2f, 4f));
            unitGridCombat.Damage(this, UnityEngine.Random.Range(4, 12));
        }, () => {
            characterBase.PlayIdleAnim();
            GetComponent <IMoveVelocity>().Enable();

            onShootComplete();
        });
    }
Beispiel #2
0
 public void AttackUnit(UnitGridCombat unitGridCombat)
 {
     GetComponent <IMoveVelocity>().Disable();
     unitGridCombat.Damage(this);
     GetComponent <IMoveVelocity>().Enable();
 }