Day 119 — Abstract Classes Vs Interfaces

float Health { get, set };void Damage();
float protected health = 3.0fpublic virtual void Damage()
{
Debug.Log("Ouch! I've been attacked!")
}
public class Skeleton : Enemy
{
// Even with no code here it already has the logic for the Damage
// method and their health is set to 3.0f!
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store