Ejemplo n.º 1
0
    public void activate(HPCharacterController attackee)
    {
        var rb = attackee.GetComponent <Rigidbody2D>();

        if (rb)
        {
            Vector2 vec = (Vector2)(attackee.transform.position - transform.position);
            var     dir = vec.normalized;
            rb.AddForce(dir * pushForce);
        }
    }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     enemyController = GetComponentInParent <HPCharacterController>();
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     agent           = GetComponent <NavMeshAgent>();
     enemyController = GetComponentInParent <HPCharacterController>();
 }
Ejemplo n.º 4
0
 public void activate(HPCharacterController attackee)
 {
     attackee.getDamage((int)baseDamage, element);
 }