Skip to content

Instantly share code, notes, and snippets.

@saitocastel1900
Last active November 7, 2022 03:48
Show Gist options
  • Save saitocastel1900/b98e5c6e955a514ab9d534f8ad86f091 to your computer and use it in GitHub Desktop.
Save saitocastel1900/b98e5c6e955a514ab9d534f8ad86f091 to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
public class Auger :Enemy,IDisposable
{
public Auger(string name,int hp)
{
_name = name;
_hp = hp;
}
public override string GetName() => this.name;
public override int GetHp() => this._hp;
public override void Attack(int damaged)
{
Debug.Log($"{this._name}へ攻撃");
_hp -= damaged;
if (this._hp <= 0) this.Dispose();
}
public void Dispose()
{
Debug.Log($"{this._name}は倒されました");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment