コード例 #1
0
ファイル: fireMunition.cs プロジェクト: Trebla012/HellInside
 //Al tocar el trigger se almacena en la varible munición
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         throwAttack ta = collision.GetComponent <throwAttack>();
         ta.SetMunition(munitionCapacity);
         Destroy(gameObject);
     }
 }
コード例 #2
0
ファイル: HealthSystem.cs プロジェクト: Trebla012/HellInside
    // Start is called before the first frame update
    void Start()

    {
        melee = GetComponent <meleeAttack>(); //Asignamos a la variable los scripts antes mencionados

        fireball = GetComponent <throwAttack>();

        shoot = GetComponent <Shoot>();

        hero = GetComponent <PlayerController>();

        rb = GetComponent <Rigidbody2D>();

        CurrentHealthPoints = MaxHealthPoints;  //Pone la vida al máximo al empezar
        isFullHealth        = true;

        if (healthUI)
        {
            healthUI.SetMaxHealthUI(MaxHealthPoints);
        }
    }