void CheckHP() { if (HP <= 0) { HP = 0; BoardBraver braver = BoardManager.instance.braver; braver.TargetDied(); Destroy(gameObject); } }
//MovingObjectの抽象メソッドのため必ず必要 protected override void OnCantMove <T>(T component) { if (component.GetComponent <BoardPlayer>()) { BoardPlayer other = component as BoardPlayer; other.LoseHP(attackDamage); iTween.MoveFrom(gameObject, iTween.Hash("position", other.transform.position, "time", 0.5f)); } else if (component.GetComponent <BoardBraver>()) { BoardBraver other = component as BoardBraver; other.LoseHP(attackDamage); } }
public void AddBraver(BoardBraver script) { braver = script; }