Exemple #1
0
 private void Awake()
 {
     playerInputs    = GetComponent <PlayerInputs>();
     playerCombat    = GetComponent <PlayerCombat>();
     playerHealth    = GetComponent <PlayerHealth>();
     playerMovements = GetComponent <PlayerMovements>();
     playerCollision = GetComponent <PlayerCollision>();
 }
Exemple #2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     Player.PlayerCombat player = other.GetComponent <Player.PlayerCombat>();
     if (player == null)
     {
         return;
     }
     potionSystem.AddPotion();
     Destroy(gameObject);
 }
Exemple #3
0
        private void Start()
        {
            GameObject p = GameObject.FindWithTag("Player");

            movement = p.GetComponent <PlayerMovement>();
            combat   = p.GetComponent <PlayerCombat>();

            player = p.transform;
            cam    = Camera.main;
        }
Exemple #4
0
    public override void Attack(Player.PlayerCombat player)
    {
        var isEnemy = Physics2D.OverlapCircle(player.transform.Find("Weapon").position, 0.5f, enemyLayer);

        player.transform.GetComponent <Animation>().Play("shortAttack");

        if (isEnemy)
        {
            isEnemy.gameObject.GetComponent <Enemy.EnemyController>().Damage(damageAmount);
        }
    }
Exemple #5
0
 public abstract void LongAttack(Player.PlayerCombat player);
Exemple #6
0
 public abstract void Setup(Player.PlayerCombat player);